public static bool VerifyGACDependencyXP(ReferenceIdentity refId, string tempDir) { if (!PlatformSpecific.OnXPOrAbove) { return(false); } using (TempFile tempFile = new TempFile(tempDir, ".manifest")) { ManifestGenerator.GenerateGACDetectionManifest(refId, tempFile.Path); IntPtr actCtxW = NativeMethods.CreateActCtxW(new NativeMethods.ACTCTXW(tempFile.Path)); if (!(actCtxW != NativeMethods.INVALID_HANDLE_VALUE)) { return(false); } NativeMethods.ReleaseActCtx(actCtxW); return(true); } }
public static bool VerifyGACDependencyXP(ReferenceIdentity refId, string tempDir) { if (!PlatformSpecific.OnXPOrAbove) { return(false); } using (TempFile file = new TempFile(tempDir, ".manifest")) { ManifestGenerator.GenerateGACDetectionManifest(refId, file.Path); System.Deployment.Application.NativeMethods.ACTCTXW actCtx = new System.Deployment.Application.NativeMethods.ACTCTXW(file.Path); IntPtr hActCtx = System.Deployment.Application.NativeMethods.CreateActCtxW(actCtx); if (hActCtx != System.Deployment.Application.NativeMethods.INVALID_HANDLE_VALUE) { System.Deployment.Application.NativeMethods.ReleaseActCtx(hActCtx); return(true); } return(false); } }