public ExePackage Build(Bundle bootstrapper)
        {
            const string nameForNetFx45Release = "NETFRAMEWORK45";

            bootstrapper.IncludeWixExtension(WixExtension.Util);

            var netFx40RelaseRegistrySearch = new UtilRegistrySearch
            {
                Root     = RegistryHive.LocalMachine,
                Key      = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full",
                Value    = "Release",
                Result   = SearchResult.value,
                Format   = SearchFormat.raw,
                Variable = nameForNetFx45Release,
            };

            bootstrapper.AddWixFragment("Wix/Bundle", netFx40RelaseRegistrySearch);

            var isInstalledCondition = $"{nameForNetFx45Release} >= 394254";

            var package = new ExePackage(@"..\redist\NDP461-KB3102438-Web.exe")
            {
                Name        = "Microsoft .NET Framework 4.6.1",
                Description = "Microsoft .NET Framework 4.6.1 Setup",
                Compressed  = true,
                DownloadUrl =
                    "https://download.microsoft.com/download/3/5/9/35980F81-60F4-4DE3-88FC-8F962B97253B/NDP461-KB3102438-Web.exe",
                //Name = "NDP461-KB3102438-Web.exe",
                //SourceFile = "NDP461-KB3102438-Web.exe",
                Vital      = true,
                PerMachine = true,
                Permanent  = true,
                //ExitCodes = new List<ExitCode>() { new ExitCode(){Value = "1641",Behavior = BehaviorValues.scheduleReboot}, new ExitCode() { Value = "3010", Behavior = BehaviorValues.scheduleReboot } },
                InstallCommand   = "/q /norestart",
                DetectCondition  = $"{isInstalledCondition}",
                InstallCondition = $"(VersionNT >= v6.0) AND (NOT ({isInstalledCondition}))",
            };

            return(package);
        }
示例#2
0
        public ExePackage Build(Bundle bootstrapper)
        {
            const string variableNameForNetFx40 = "NETFRAMEWORK40";

            bootstrapper.IncludeWixExtension(WixExtension.Util);

            var netFx40RegistrySearch = new UtilRegistrySearch
            {
                Root     = RegistryHive.LocalMachine,
                Key      = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full",
                Value    = "Install",
                Result   = SearchResult.value,
                Format   = SearchFormat.raw,
                Variable = variableNameForNetFx40,
            };

            bootstrapper.AddWixFragment("Wix/Bundle", netFx40RegistrySearch);

            var package = new ExePackage(@"..\redist\dotNetFx40_Full_setup.exe")
            {
                Name        = "Microsoft .NET Framework 4",
                Description = "Microsoft .NET Framework 4 Setup",
                Compressed  = true,
                DownloadUrl =
                    "https://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe",
                //Name = "dotNetFx40_Full_setup.exe",
                //SourceFile = "dotNetFx40_Full_setup.exe",
                Vital      = true,
                PerMachine = true,
                Permanent  = true,
                //ExitCodes = new List<ExitCode>() { new ExitCode(){Value = "1641",Behavior = BehaviorValues.scheduleReboot}, new ExitCode() { Value = "3010", Behavior = BehaviorValues.scheduleReboot } },
                InstallCommand   = "/q /norestart",
                DetectCondition  = $"({variableNameForNetFx40}) OR (VersionNT >= v6.0)",
                InstallCondition = $"(VersionNT < v6.0) AND (NOT {variableNameForNetFx40})",
            };

            return(package);
        }
        public ExePackage[] Build(Bundle bootstrapper)
        {
            const string variableNameForX86 = "KB2468871x86Installed";
            const string variableNameForX64 = "KB2468871x64Installed";

            bootstrapper.IncludeWixExtension(WixExtension.Util);

            var kb468871X86RegistrySearch = new UtilRegistrySearch
            {
                Root     = RegistryHive.LocalMachine,
                Key      = @"SOFTWARE\Microsoft\Updates\Microsoft .NET Framework 4 Extended\KB2468871",
                Result   = SearchResult.exists,
                Format   = SearchFormat.raw,
                Win64    = false,
                Variable = variableNameForX86,
            };
            var kb2468871X64RegistrySearch = new UtilRegistrySearch
            {
                Root     = RegistryHive.LocalMachine,
                Key      = @"SOFTWARE\Microsoft\Updates\Microsoft .NET Framework 4 Extended\KB2468871",//SOFTWARE\wow6432node\Microsoft\Updates\Microsoft .NET Framework 4 Extended\KB2468871
                Result   = SearchResult.exists,
                Format   = SearchFormat.raw,
                Win64    = true,
                Variable = variableNameForX64,
            };

            bootstrapper.AddWixFragment("Wix/Bundle", kb468871X86RegistrySearch, kb2468871X64RegistrySearch);

            //TODO: those packages binaries should not be included in repo
            //DownloadUrl should make it downloadable from web during build time
            _kb2468871X64Package = new ExePackage(@"..\redist\NDP40-KB2468871-v2-x64.exe")
            {
                Description =
                    "This prerequisite installs the .NET Framework 4.0 full profile update provided in Microsoft KB article 2468871.",
                Compressed  = false,
                DownloadUrl =
                    "http://download.microsoft.com/download/2/B/F/2BF4D7D1-E781-4EE0-9E4F-FDD44A2F8934/NDP40-KB2468871-v2-x64.exe",
                Name = "NDP40-KB2468871-v2-x64.exe",
                //SourceFile = "NDP40-KB2468871-v2-x64.exe",
                Vital      = true,
                PerMachine = true,
                Permanent  = true,
                //ExitCodes = new List<ExitCode>() { new ExitCode(){Value = "1641",Behavior = BehaviorValues.scheduleReboot}, new ExitCode() { Value = "3010", Behavior = BehaviorValues.scheduleReboot } },
                InstallCommand   = "/q /norestart",
                DetectCondition  = $"({variableNameForX64}) OR (VersionNT64 >= v6.0)",
                InstallCondition = $"(VersionNT64 < v6.0) AND (NOT {variableNameForX64})",
            };

            _kb2468871X86Package = new ExePackage(@"..\redist\NDP40-KB2468871-v2-x86.exe")
            {
                Description =
                    "This prerequisite installs the .NET Framework 4.0 full profile update provided in Microsoft KB article 2468871.",
                Compressed  = false,
                DownloadUrl =
                    "http://download.microsoft.com/download/2/B/F/2BF4D7D1-E781-4EE0-9E4F-FDD44A2F8934/NDP40-KB2468871-v2-x86.exe",
                Name = "NDP40-KB2468871-v2-x86.exe",
                //SourceFile = "NDP40-KB2468871-v2-x86.exe",
                Vital      = true,
                PerMachine = true,
                Permanent  = true,
                //ExitCodes = new List<ExitCode>() { new ExitCode(){Value = "1641",Behavior = BehaviorValues.scheduleReboot}, new ExitCode() { Value = "3010", Behavior = BehaviorValues.scheduleReboot } },
                InstallCommand   = "/q /norestart",
                DetectCondition  = $"({variableNameForX86}) OR (VersionNT >= v6.0)",
                InstallCondition = $"(VersionNT < v6.0) AND (NOT {variableNameForX86}) AND (NOT VersionNT64)",
            };

            return(new[]
            {
                _kb2468871X64Package,
                _kb2468871X86Package,
            });
        }