diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-01-05 21:51:00 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-01-06 23:02:07 -0600 |
| commit | c2b00d75493798d9f2452d5e5014b14afcb14889 (patch) | |
| tree | 7788e6a9caf38ff1e921112cd893e53cccb8efbf /src | |
| parent | 5b48edfd77da6a7f1c499ad30ea95b66f26ee56d (diff) | |
| download | wix-c2b00d75493798d9f2452d5e5014b14afcb14889.tar.gz wix-c2b00d75493798d9f2452d5e5014b14afcb14889.tar.bz2 wix-c2b00d75493798d9f2452d5e5014b14afcb14889.zip | |
Always run upgrade related bundles last.
#5128
Diffstat (limited to 'src')
24 files changed, 602 insertions, 104 deletions
diff --git a/src/Directory.Build.props b/src/Directory.Build.props index da099c3d..d068e9e8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | 6 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
| 7 | <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink> | 7 | <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink> |
| 8 | <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | 8 | <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> |
| 9 | <NoWarn>$(NoWarn);MSB3026</NoWarn> | ||
| 9 | 10 | ||
| 10 | <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName> | 11 | <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName> |
| 11 | <RootBuildFolder>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</RootBuildFolder> | 12 | <RootBuildFolder>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</RootBuildFolder> |
diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp index 9cc4b199..ffeb39d1 100644 --- a/src/burn/engine/registration.cpp +++ b/src/burn/engine/registration.cpp | |||
| @@ -585,6 +585,8 @@ extern "C" HRESULT RegistrationDetectRelatedBundles( | |||
| 585 | hr = RelatedBundlesInitializeForScope(FALSE, pRegistration, &pRegistration->relatedBundles); | 585 | hr = RelatedBundlesInitializeForScope(FALSE, pRegistration, &pRegistration->relatedBundles); |
| 586 | ExitOnFailure(hr, "Failed to initialize per-user related bundles."); | 586 | ExitOnFailure(hr, "Failed to initialize per-user related bundles."); |
| 587 | 587 | ||
| 588 | RelatedBundlesSort(&pRegistration->relatedBundles); | ||
| 589 | |||
| 588 | LExit: | 590 | LExit: |
| 589 | return hr; | 591 | return hr; |
| 590 | } | 592 | } |
diff --git a/src/burn/engine/relatedbundle.cpp b/src/burn/engine/relatedbundle.cpp index e2380aab..1eafef07 100644 --- a/src/burn/engine/relatedbundle.cpp +++ b/src/burn/engine/relatedbundle.cpp | |||
| @@ -4,6 +4,11 @@ | |||
| 4 | 4 | ||
| 5 | // internal function declarations | 5 | // internal function declarations |
| 6 | 6 | ||
| 7 | static __callback int __cdecl CompareRelatedBundles( | ||
| 8 | __in void* pvContext, | ||
| 9 | __in const void* pvLeft, | ||
| 10 | __in const void* pvRight | ||
| 11 | ); | ||
| 7 | static HRESULT LoadIfRelatedBundle( | 12 | static HRESULT LoadIfRelatedBundle( |
| 8 | __in BOOL fPerMachine, | 13 | __in BOOL fPerMachine, |
| 9 | __in HKEY hkUninstallKey, | 14 | __in HKEY hkUninstallKey, |
| @@ -128,9 +133,59 @@ LExit: | |||
| 128 | return hr; | 133 | return hr; |
| 129 | } | 134 | } |
| 130 | 135 | ||
| 136 | extern "C" void RelatedBundlesSort( | ||
| 137 | __in BURN_RELATED_BUNDLES* pRelatedBundles | ||
| 138 | ) | ||
| 139 | { | ||
| 140 | qsort_s(pRelatedBundles->rgRelatedBundles, pRelatedBundles->cRelatedBundles, sizeof(BURN_RELATED_BUNDLE), CompareRelatedBundles, NULL); | ||
| 141 | } | ||
| 142 | |||
| 131 | 143 | ||
| 132 | // internal helper functions | 144 | // internal helper functions |
| 133 | 145 | ||
| 146 | static __callback int __cdecl CompareRelatedBundles( | ||
| 147 | __in void* /*pvContext*/, | ||
| 148 | __in const void* pvLeft, | ||
| 149 | __in const void* pvRight | ||
| 150 | ) | ||
| 151 | { | ||
| 152 | int ret = 0; | ||
| 153 | const BURN_RELATED_BUNDLE* pBundleLeft = static_cast<const BURN_RELATED_BUNDLE*>(pvLeft); | ||
| 154 | const BURN_RELATED_BUNDLE* pBundleRight = static_cast<const BURN_RELATED_BUNDLE*>(pvRight); | ||
| 155 | |||
| 156 | // Sort by relation type, then version, then bundle id. | ||
| 157 | if (pBundleLeft->relationType != pBundleRight->relationType) | ||
| 158 | { | ||
| 159 | // Upgrade bundles last, everything else according to the enum. | ||
| 160 | if (BOOTSTRAPPER_RELATION_UPGRADE == pBundleLeft->relationType) | ||
| 161 | { | ||
| 162 | ret = 1; | ||
| 163 | } | ||
| 164 | else if (BOOTSTRAPPER_RELATION_UPGRADE == pBundleRight->relationType) | ||
| 165 | { | ||
| 166 | ret = -1; | ||
| 167 | } | ||
| 168 | else if (pBundleLeft->relationType < pBundleRight->relationType) | ||
| 169 | { | ||
| 170 | ret = -1; | ||
| 171 | } | ||
| 172 | else | ||
| 173 | { | ||
| 174 | ret = 1; | ||
| 175 | } | ||
| 176 | } | ||
| 177 | else | ||
| 178 | { | ||
| 179 | VerCompareParsedVersions(pBundleLeft->pVersion, pBundleRight->pVersion, &ret); | ||
| 180 | if (0 == ret) | ||
| 181 | { | ||
| 182 | ret = ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, pBundleLeft->package.sczId, -1, pBundleRight->package.sczId, -1) - 2; | ||
| 183 | } | ||
| 184 | } | ||
| 185 | |||
| 186 | return ret; | ||
| 187 | } | ||
| 188 | |||
| 134 | static HRESULT LoadIfRelatedBundle( | 189 | static HRESULT LoadIfRelatedBundle( |
| 135 | __in BOOL fPerMachine, | 190 | __in BOOL fPerMachine, |
| 136 | __in HKEY hkUninstallKey, | 191 | __in HKEY hkUninstallKey, |
diff --git a/src/burn/engine/relatedbundle.h b/src/burn/engine/relatedbundle.h index 0113c8ee..be039421 100644 --- a/src/burn/engine/relatedbundle.h +++ b/src/burn/engine/relatedbundle.h | |||
| @@ -19,6 +19,9 @@ HRESULT RelatedBundleFindById( | |||
| 19 | __in_z LPCWSTR wzId, | 19 | __in_z LPCWSTR wzId, |
| 20 | __out BURN_RELATED_BUNDLE** ppRelatedBundle | 20 | __out BURN_RELATED_BUNDLE** ppRelatedBundle |
| 21 | ); | 21 | ); |
| 22 | void RelatedBundlesSort( | ||
| 23 | __in BURN_RELATED_BUNDLES* pRelatedBundles | ||
| 24 | ); | ||
| 22 | 25 | ||
| 23 | #if defined(__cplusplus) | 26 | #if defined(__cplusplus) |
| 24 | } | 27 | } |
diff --git a/src/test/burn/BurnE2ETests.sln b/src/test/burn/BurnE2ETests.sln index 5d69855c..98cd3575 100644 --- a/src/test/burn/BurnE2ETests.sln +++ b/src/test/burn/BurnE2ETests.sln | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | | 1 | |
| 2 | Microsoft Visual Studio Solution File, Format Version 12.00 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 |
| 3 | # Visual Studio Version 16 | 3 | # Visual Studio Version 17 |
| 4 | VisualStudioVersion = 16.0.29503.13 | 4 | VisualStudioVersion = 17.0.31919.166 |
| 5 | MinimumVisualStudioVersion = 10.0.40219.1 | 5 | MinimumVisualStudioVersion = 10.0.40219.1 |
| 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBA", "TestBA\TestBA.csproj", "{04022D35-6D75-49D0-91D2-4208E09DBA6D}" | 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBA", "TestBA\TestBA.csproj", "{04022D35-6D75-49D0-91D2-4208E09DBA6D}" |
| 7 | EndProject | 7 | EndProject |
| @@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolset.WixBA", "WixTool | |||
| 13 | EndProject | 13 | EndProject |
| 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.BurnE2E", "WixToolsetTest.BurnE2E\WixToolsetTest.BurnE2E.csproj", "{FED9D707-E5C3-4867-87B0-FABDB5EB0823}" | 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WixToolsetTest.BurnE2E", "WixToolsetTest.BurnE2E\WixToolsetTest.BurnE2E.csproj", "{FED9D707-E5C3-4867-87B0-FABDB5EB0823}" |
| 15 | EndProject | 15 | EndProject |
| 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ForTestingUseOnly.wixext", "ForTestingUseOnlyExtension\ForTestingUseOnly.wixext.csproj", "{0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}" | ||
| 17 | EndProject | ||
| 16 | Global | 18 | Global |
| 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| 18 | Debug|Any CPU = Debug|Any CPU | 20 | Debug|Any CPU = Debug|Any CPU |
| @@ -59,18 +61,6 @@ Global | |||
| 59 | {3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Release|x64.Build.0 = Release|Any CPU | 61 | {3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Release|x64.Build.0 = Release|Any CPU |
| 60 | {3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Release|x86.ActiveCfg = Release|Any CPU | 62 | {3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Release|x86.ActiveCfg = Release|Any CPU |
| 61 | {3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Release|x86.Build.0 = Release|Any CPU | 63 | {3D3B02F3-79B6-4BD5-AD49-2889DA3849A7}.Release|x86.Build.0 = Release|Any CPU |
| 62 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 63 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 64 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 65 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 66 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| 67 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x86.Build.0 = Debug|Any CPU | ||
| 68 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 69 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 70 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 71 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x64.Build.0 = Release|Any CPU | ||
| 72 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x86.ActiveCfg = Release|Any CPU | ||
| 73 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x86.Build.0 = Release|Any CPU | ||
| 74 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 64 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| 75 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Debug|Any CPU.Build.0 = Debug|Any CPU | 65 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| 76 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Debug|x64.ActiveCfg = Debug|Any CPU | 66 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Debug|x64.ActiveCfg = Debug|Any CPU |
| @@ -83,6 +73,30 @@ Global | |||
| 83 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Release|x64.Build.0 = Release|Any CPU | 73 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Release|x64.Build.0 = Release|Any CPU |
| 84 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Release|x86.ActiveCfg = Release|Any CPU | 74 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Release|x86.ActiveCfg = Release|Any CPU |
| 85 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Release|x86.Build.0 = Release|Any CPU | 75 | {7C27518B-84AD-4679-8EF4-29DF552CF1AC}.Release|x86.Build.0 = Release|Any CPU |
| 76 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 77 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 78 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 79 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 80 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| 81 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Debug|x86.Build.0 = Debug|Any CPU | ||
| 82 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 83 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 84 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 85 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x64.Build.0 = Release|Any CPU | ||
| 86 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x86.ActiveCfg = Release|Any CPU | ||
| 87 | {FED9D707-E5C3-4867-87B0-FABDB5EB0823}.Release|x86.Build.0 = Release|Any CPU | ||
| 88 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 89 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 90 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
| 91 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Debug|x64.Build.0 = Debug|Any CPU | ||
| 92 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
| 93 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Debug|x86.Build.0 = Debug|Any CPU | ||
| 94 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 95 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 96 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Release|x64.ActiveCfg = Release|Any CPU | ||
| 97 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Release|x64.Build.0 = Release|Any CPU | ||
| 98 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Release|x86.ActiveCfg = Release|Any CPU | ||
| 99 | {0037E6A3-45C6-4AB6-BC8C-1CB0C145E992}.Release|x86.Build.0 = Release|Any CPU | ||
| 86 | EndGlobalSection | 100 | EndGlobalSection |
| 87 | GlobalSection(SolutionProperties) = preSolution | 101 | GlobalSection(SolutionProperties) = preSolution |
| 88 | HideSolutionNode = FALSE | 102 | HideSolutionNode = FALSE |
diff --git a/src/test/burn/Directory.wixproj.props b/src/test/burn/Directory.wixproj.props index 06cf5b1d..af5ef196 100644 --- a/src/test/burn/Directory.wixproj.props +++ b/src/test/burn/Directory.wixproj.props | |||
| @@ -7,5 +7,6 @@ | |||
| 7 | <DefaultCompressionLevel>None</DefaultCompressionLevel> | 7 | <DefaultCompressionLevel>None</DefaultCompressionLevel> |
| 8 | <CompilerAdditionalOptions>-wx</CompilerAdditionalOptions> | 8 | <CompilerAdditionalOptions>-wx</CompilerAdditionalOptions> |
| 9 | <SuppressSpecificWarnings>1154;$(SuppressSpecificWarnings)</SuppressSpecificWarnings> | 9 | <SuppressSpecificWarnings>1154;$(SuppressSpecificWarnings)</SuppressSpecificWarnings> |
| 10 | <ForTestingUseOnlyWixextPath>$(BaseOutputPath)$(Configuration)\netstandard2.0\ForTestingUseOnly.wixext.dll</ForTestingUseOnlyWixextPath> | ||
| 10 | </PropertyGroup> | 11 | </PropertyGroup> |
| 11 | </Project> | 12 | </Project> |
diff --git a/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnly.wixext.csproj b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnly.wixext.csproj new file mode 100644 index 00000000..c3861a96 --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnly.wixext.csproj | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 3 | |||
| 4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>netstandard2.0</TargetFramework> | ||
| 7 | <RootNamespace>ForTestingUseOnly</RootNamespace> | ||
| 8 | <DebugType>embedded</DebugType> | ||
| 9 | <IncludeSymbols>true</IncludeSymbols> | ||
| 10 | </PropertyGroup> | ||
| 11 | |||
| 12 | <ItemGroup> | ||
| 13 | <PackageReference Include="WixToolset.Extensibility" PrivateAssets="all" /> | ||
| 14 | </ItemGroup> | ||
| 15 | </Project> | ||
diff --git a/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs new file mode 100644 index 00000000..fff23274 --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyBurnBackendExtension.cs | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace ForTestingUseOnly | ||
| 4 | { | ||
| 5 | using System.Collections.Generic; | ||
| 6 | using System.Linq; | ||
| 7 | using ForTestingUseOnly.Symbols; | ||
| 8 | using WixToolset.Data; | ||
| 9 | using WixToolset.Data.Symbols; | ||
| 10 | using WixToolset.Extensibility; | ||
| 11 | |||
| 12 | /// <summary> | ||
| 13 | /// Extension for doing completely unsupported things in the name of testing. | ||
| 14 | /// </summary> | ||
| 15 | public class ForTestingUseOnlyBurnBackendExtension : BaseBurnBackendBinderExtension | ||
| 16 | { | ||
| 17 | private static readonly IntermediateSymbolDefinition[] BurnSymbolDefinitions = | ||
| 18 | { | ||
| 19 | ForTestingUseOnlySymbolDefinitions.ForTestingUseOnlyBundle, | ||
| 20 | }; | ||
| 21 | |||
| 22 | protected override IReadOnlyCollection<IntermediateSymbolDefinition> SymbolDefinitions => BurnSymbolDefinitions; | ||
| 23 | |||
| 24 | public override void SymbolsFinalized(IntermediateSection section) | ||
| 25 | { | ||
| 26 | base.SymbolsFinalized(section); | ||
| 27 | |||
| 28 | this.FinalizeBundleSymbol(section); | ||
| 29 | } | ||
| 30 | |||
| 31 | private void FinalizeBundleSymbol(IntermediateSection section) | ||
| 32 | { | ||
| 33 | var forTestingUseOnlyBundleSymbol = section.Symbols.OfType<ForTestingUseOnlyBundleSymbol>().SingleOrDefault(); | ||
| 34 | if (null == forTestingUseOnlyBundleSymbol) | ||
| 35 | { | ||
| 36 | return; | ||
| 37 | } | ||
| 38 | |||
| 39 | var bundleSymbol = section.Symbols.OfType<WixBundleSymbol>().Single(); | ||
| 40 | bundleSymbol.ProviderKey = bundleSymbol.BundleId = forTestingUseOnlyBundleSymbol.BundleId; | ||
| 41 | } | ||
| 42 | } | ||
| 43 | } | ||
diff --git a/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyCompiler.cs b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyCompiler.cs new file mode 100644 index 00000000..4963c941 --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyCompiler.cs | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace ForTestingUseOnly | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using System.Xml.Linq; | ||
| 8 | using ForTestingUseOnly.Symbols; | ||
| 9 | using WixToolset.Data; | ||
| 10 | using WixToolset.Extensibility; | ||
| 11 | |||
| 12 | /// <summary> | ||
| 13 | /// Extension for doing completely unsupported things in the name of testing. | ||
| 14 | /// </summary> | ||
| 15 | public sealed class ForTestingUseOnlyCompiler : BaseCompilerExtension | ||
| 16 | { | ||
| 17 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/fortestinguseonly"; | ||
| 18 | |||
| 19 | public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) | ||
| 20 | { | ||
| 21 | switch (element.Name.LocalName) | ||
| 22 | { | ||
| 23 | case "ForTestingUseOnlyBundle": | ||
| 24 | this.ParseForTestingUseOnlyBundleElement(intermediate, section, element); | ||
| 25 | break; | ||
| 26 | default: | ||
| 27 | this.ParseHelper.UnexpectedElement(parentElement, element); | ||
| 28 | break; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | private void ParseForTestingUseOnlyBundleElement(Intermediate intermediate, IntermediateSection section, XElement element) | ||
| 33 | { | ||
| 34 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | ||
| 35 | string bundleId = null; | ||
| 36 | |||
| 37 | foreach (var attrib in element.Attributes()) | ||
| 38 | { | ||
| 39 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
| 40 | { | ||
| 41 | switch (attrib.Name.LocalName) | ||
| 42 | { | ||
| 43 | case "Id": | ||
| 44 | bundleId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 45 | break; | ||
| 46 | default: | ||
| 47 | this.ParseHelper.UnexpectedAttribute(element, attrib); | ||
| 48 | break; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | else | ||
| 52 | { | ||
| 53 | this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib); | ||
| 54 | } | ||
| 55 | } | ||
| 56 | |||
| 57 | if (null == bundleId) | ||
| 58 | { | ||
| 59 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | ||
| 60 | } | ||
| 61 | else | ||
| 62 | { | ||
| 63 | bundleId = Guid.Parse(bundleId).ToString("B").ToUpperInvariant(); | ||
| 64 | } | ||
| 65 | |||
| 66 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | ||
| 67 | |||
| 68 | if (!this.Messaging.EncounteredError) | ||
| 69 | { | ||
| 70 | section.AddSymbol(new ForTestingUseOnlyBundleSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "ForTestingUseOnlyBundle")) | ||
| 71 | { | ||
| 72 | BundleId = bundleId, | ||
| 73 | }); | ||
| 74 | } | ||
| 75 | } | ||
| 76 | } | ||
| 77 | } | ||
diff --git a/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyExtensionData.cs b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyExtensionData.cs new file mode 100644 index 00000000..3276b2db --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyExtensionData.cs | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace ForTestingUseOnly | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.Extensibility; | ||
| 7 | |||
| 8 | public sealed class ForTestingUseOnlyExtensionData : BaseExtensionData | ||
| 9 | { | ||
| 10 | public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition) | ||
| 11 | { | ||
| 12 | symbolDefinition = ForTestingUseOnlySymbolDefinitions.ByName(name); | ||
| 13 | return symbolDefinition != null; | ||
| 14 | } | ||
| 15 | } | ||
| 16 | } | ||
diff --git a/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyExtensionFactory.cs b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyExtensionFactory.cs new file mode 100644 index 00000000..f71a0c2e --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/ForTestingUseOnlyExtensionFactory.cs | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace ForTestingUseOnly | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.Collections.Generic; | ||
| 7 | using WixToolset.Extensibility; | ||
| 8 | |||
| 9 | public class ForTestingUseOnlyExtensionFactory : BaseExtensionFactory | ||
| 10 | { | ||
| 11 | protected override IReadOnlyCollection<Type> ExtensionTypes => new[] | ||
| 12 | { | ||
| 13 | typeof(ForTestingUseOnlyCompiler), | ||
| 14 | typeof(ForTestingUseOnlyExtensionData), | ||
| 15 | typeof(ForTestingUseOnlyBurnBackendExtension), | ||
| 16 | }; | ||
| 17 | } | ||
| 18 | } | ||
diff --git a/src/test/burn/ForTestingUseOnlyExtension/Symbols/ForTestingUseOnlyBundleSymbol.cs b/src/test/burn/ForTestingUseOnlyExtension/Symbols/ForTestingUseOnlyBundleSymbol.cs new file mode 100644 index 00000000..a17dfe31 --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/Symbols/ForTestingUseOnlyBundleSymbol.cs | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace ForTestingUseOnly | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using ForTestingUseOnly.Symbols; | ||
| 7 | |||
| 8 | public static partial class ForTestingUseOnlySymbolDefinitions | ||
| 9 | { | ||
| 10 | public static readonly IntermediateSymbolDefinition ForTestingUseOnlyBundle = new IntermediateSymbolDefinition( | ||
| 11 | ForTestingUseOnlySymbolDefinitionType.ForTestingUseOnlyBundle.ToString(), | ||
| 12 | new[] | ||
| 13 | { | ||
| 14 | new IntermediateFieldDefinition(nameof(ForTestingUseOnlyBundleSymbolFields.BundleId), IntermediateFieldType.String), | ||
| 15 | }, | ||
| 16 | typeof(ForTestingUseOnlyBundleSymbol)); | ||
| 17 | } | ||
| 18 | } | ||
| 19 | |||
| 20 | namespace ForTestingUseOnly.Symbols | ||
| 21 | { | ||
| 22 | using WixToolset.Data; | ||
| 23 | |||
| 24 | public enum ForTestingUseOnlyBundleSymbolFields | ||
| 25 | { | ||
| 26 | BundleId, | ||
| 27 | } | ||
| 28 | |||
| 29 | public class ForTestingUseOnlyBundleSymbol : IntermediateSymbol | ||
| 30 | { | ||
| 31 | public ForTestingUseOnlyBundleSymbol() : base(ForTestingUseOnlySymbolDefinitions.ForTestingUseOnlyBundle, null, null) | ||
| 32 | { | ||
| 33 | } | ||
| 34 | |||
| 35 | public ForTestingUseOnlyBundleSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(ForTestingUseOnlySymbolDefinitions.ForTestingUseOnlyBundle, sourceLineNumber, id) | ||
| 36 | { | ||
| 37 | } | ||
| 38 | |||
| 39 | public IntermediateField this[ForTestingUseOnlyBundleSymbolFields index] => this.Fields[(int)index]; | ||
| 40 | |||
| 41 | public string BundleId | ||
| 42 | { | ||
| 43 | get => this.Fields[(int)ForTestingUseOnlyBundleSymbolFields.BundleId].AsString(); | ||
| 44 | set => this.Set((int)ForTestingUseOnlyBundleSymbolFields.BundleId, value); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
diff --git a/src/test/burn/ForTestingUseOnlyExtension/Symbols/ForTestingUseOnlySymbolDefinitions.cs b/src/test/burn/ForTestingUseOnlyExtension/Symbols/ForTestingUseOnlySymbolDefinitions.cs new file mode 100644 index 00000000..82c3833e --- /dev/null +++ b/src/test/burn/ForTestingUseOnlyExtension/Symbols/ForTestingUseOnlySymbolDefinitions.cs | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace ForTestingUseOnly | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using WixToolset.Data; | ||
| 7 | using WixToolset.Data.Burn; | ||
| 8 | |||
| 9 | public enum ForTestingUseOnlySymbolDefinitionType | ||
| 10 | { | ||
| 11 | ForTestingUseOnlyBundle, | ||
| 12 | } | ||
| 13 | |||
| 14 | public static partial class ForTestingUseOnlySymbolDefinitions | ||
| 15 | { | ||
| 16 | public static IntermediateSymbolDefinition ByName(string name) | ||
| 17 | { | ||
| 18 | if (!Enum.TryParse(name, out ForTestingUseOnlySymbolDefinitionType type)) | ||
| 19 | { | ||
| 20 | return null; | ||
| 21 | } | ||
| 22 | |||
| 23 | return ByType(type); | ||
| 24 | } | ||
| 25 | |||
| 26 | public static IntermediateSymbolDefinition ByType(ForTestingUseOnlySymbolDefinitionType type) | ||
| 27 | { | ||
| 28 | switch (type) | ||
| 29 | { | ||
| 30 | case ForTestingUseOnlySymbolDefinitionType.ForTestingUseOnlyBundle: | ||
| 31 | return ForTestingUseOnlySymbolDefinitions.ForTestingUseOnlyBundle; | ||
| 32 | |||
| 33 | default: | ||
| 34 | throw new ArgumentOutOfRangeException(nameof(type)); | ||
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 38 | static ForTestingUseOnlySymbolDefinitions() | ||
| 39 | { | ||
| 40 | ForTestingUseOnlyBundle.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | } | ||
diff --git a/src/test/burn/TestData/DependencyTests/BundleF/BundleF.props b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.props new file mode 100644 index 00000000..91fdc82c --- /dev/null +++ b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.props | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 2 | <Project> | ||
| 3 | <PropertyGroup> | ||
| 4 | <OutputType>Bundle</OutputType> | ||
| 5 | <UpgradeCode>{EC2B2B3F-E57C-45A4-A0E8-762156DAD99D}</UpgradeCode> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> | ||
| 9 | </ItemGroup> | ||
| 10 | </Project> | ||
diff --git a/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wixproj b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wixproj index 4473657a..75481940 100644 --- a/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wixproj +++ b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wixproj | |||
| @@ -1,14 +1,11 @@ | |||
| 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
| 2 | <Project Sdk="WixToolset.Sdk"> | 2 | <Project Sdk="WixToolset.Sdk"> |
| 3 | <Import Project="BundleF.props" /> | ||
| 3 | <PropertyGroup> | 4 | <PropertyGroup> |
| 4 | <OutputType>Bundle</OutputType> | 5 | <OutputType>Bundle</OutputType> |
| 5 | <UpgradeCode>{EC2B2B3F-E57C-45A4-A0E8-762156DAD99D}</UpgradeCode> | ||
| 6 | <Version>1.0.0.0</Version> | 6 | <Version>1.0.0.0</Version> |
| 7 | </PropertyGroup> | 7 | </PropertyGroup> |
| 8 | <ItemGroup> | 8 | <ItemGroup> |
| 9 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> | ||
| 10 | </ItemGroup> | ||
| 11 | <ItemGroup> | ||
| 12 | <ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" /> | 9 | <ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" /> |
| 13 | <ProjectReference Include="..\PackageB\PackageB.wixproj" /> | 10 | <ProjectReference Include="..\PackageB\PackageB.wixproj" /> |
| 14 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | 11 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> |
| @@ -18,4 +15,7 @@ | |||
| 18 | <PackageReference Include="WixToolset.NetFx.wixext" /> | 15 | <PackageReference Include="WixToolset.NetFx.wixext" /> |
| 19 | <PackageReference Include="WixToolset.Util.wixext" /> | 16 | <PackageReference Include="WixToolset.Util.wixext" /> |
| 20 | </ItemGroup> | 17 | </ItemGroup> |
| 18 | <ItemGroup> | ||
| 19 | <WixExtension Include="$(ForTestingUseOnlyWixextPath)" /> | ||
| 20 | </ItemGroup> | ||
| 21 | </Project> \ No newline at end of file | 21 | </Project> \ No newline at end of file |
diff --git a/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs index 1347836a..0f51b00d 100644 --- a/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs +++ b/src/test/burn/TestData/DependencyTests/BundleF/BundleF.wxs | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
| 2 | 2 | ||
| 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fortestinguseonly="http://wixtoolset.org/schemas/v4/wxs/fortestinguseonly"> |
| 4 | <Fragment> | 4 | <Fragment> |
| 5 | <fortestinguseonly:ForTestingUseOnlyBundle Id="{5E9D5B04-41EA-4196-954C-1F7357C31FB0}" /> | ||
| 5 | <RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Detect" /> | 6 | <RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Detect" /> |
| 6 | 7 | ||
| 7 | <PackageGroup Id="BundlePackages"> | 8 | <PackageGroup Id="BundlePackages"> |
diff --git a/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj b/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj index 2674b9d6..14072fed 100644 --- a/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj +++ b/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj | |||
| @@ -17,4 +17,7 @@ | |||
| 17 | <PackageReference Include="WixToolset.NetFx.wixext" /> | 17 | <PackageReference Include="WixToolset.NetFx.wixext" /> |
| 18 | <PackageReference Include="WixToolset.Util.wixext" /> | 18 | <PackageReference Include="WixToolset.Util.wixext" /> |
| 19 | </ItemGroup> | 19 | </ItemGroup> |
| 20 | <ItemGroup> | ||
| 21 | <WixExtension Include="$(ForTestingUseOnlyWixextPath)" /> | ||
| 22 | </ItemGroup> | ||
| 20 | </Project> \ No newline at end of file | 23 | </Project> \ No newline at end of file |
diff --git a/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOn.wxs b/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wxs index 30fba657..c1b65656 100644 --- a/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOn.wxs +++ b/src/test/burn/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wxs | |||
| @@ -2,8 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | <?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?> | 3 | <?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?> |
| 4 | 4 | ||
| 5 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | 5 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util" xmlns:fortestinguseonly="http://wixtoolset.org/schemas/v4/wxs/fortestinguseonly"> |
| 6 | <Fragment> | 6 | <Fragment> |
| 7 | <fortestinguseonly:ForTestingUseOnlyBundle Id="{FE6B19EC-D52F-4F77-88E5-87FAE11E95D6}" /> | ||
| 7 | <RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Addon" /> | 8 | <RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Addon" /> |
| 8 | <util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" /> | 9 | <util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" /> |
| 9 | 10 | ||
diff --git a/src/test/burn/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj b/src/test/burn/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj index 542f3562..c467222f 100644 --- a/src/test/burn/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj +++ b/src/test/burn/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | <Version>1.0.0.0</Version> | 6 | <Version>1.0.0.0</Version> |
| 7 | </PropertyGroup> | 7 | </PropertyGroup> |
| 8 | <ItemGroup> | 8 | <ItemGroup> |
| 9 | <Compile Include="..\BundleF_AddOnA\BundleF_AddOn.wxs" Link="BundleF_AddOn.wxs" /> | ||
| 10 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> | 9 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> |
| 11 | </ItemGroup> | 10 | </ItemGroup> |
| 12 | <ItemGroup> | 11 | <ItemGroup> |
| @@ -18,4 +17,7 @@ | |||
| 18 | <PackageReference Include="WixToolset.NetFx.wixext" /> | 17 | <PackageReference Include="WixToolset.NetFx.wixext" /> |
| 19 | <PackageReference Include="WixToolset.Util.wixext" /> | 18 | <PackageReference Include="WixToolset.Util.wixext" /> |
| 20 | </ItemGroup> | 19 | </ItemGroup> |
| 20 | <ItemGroup> | ||
| 21 | <WixExtension Include="$(ForTestingUseOnlyWixextPath)" /> | ||
| 22 | </ItemGroup> | ||
| 21 | </Project> \ No newline at end of file | 23 | </Project> \ No newline at end of file |
diff --git a/src/test/burn/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wxs b/src/test/burn/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wxs new file mode 100644 index 00000000..8a5722f7 --- /dev/null +++ b/src/test/burn/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wxs | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 2 | |||
| 3 | <?define TestExeRegistryKey = Software\WiX\Tests\$(var.TestGroupName)\ExeA?> | ||
| 4 | |||
| 5 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util" xmlns:fortestinguseonly="http://wixtoolset.org/schemas/v4/wxs/fortestinguseonly"> | ||
| 6 | <Fragment> | ||
| 7 | <fortestinguseonly:ForTestingUseOnlyBundle Id="{B774BF3B-3E89-4D42-9D29-AFAB27C5772D}" /> | ||
| 8 | <RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Addon" /> | ||
| 9 | <util:RegistrySearch Root="HKLM" Key="$(var.TestExeRegistryKey)" Value="Version" Variable="ExeA_Version" /> | ||
| 10 | |||
| 11 | <PackageGroup Id="BundlePackages"> | ||
| 12 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> | ||
| 13 | <ExePackage Id="ExeA" Cache="remove" PerMachine="yes" | ||
| 14 | DetectCondition="ExeA_Version AND ExeA_Version >= v$(var.Version)" | ||
| 15 | InstallArguments="/regw "HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)"" | ||
| 16 | RepairArguments="/regw "HKLM\$(var.TestExeRegistryKey),Version,String,$(var.Version)"" | ||
| 17 | UninstallArguments="/regd "HKLM\$(var.TestExeRegistryKey),Version""> | ||
| 18 | <Provides Key="$(var.TestGroupName)_ExeA,v1.0" Version="$(var.Version)" /> | ||
| 19 | <PayloadGroupRef Id="TestExePayloads" /> | ||
| 20 | </ExePackage> | ||
| 21 | </PackageGroup> | ||
| 22 | </Fragment> | ||
| 23 | </Wix> | ||
diff --git a/src/test/burn/TestData/DependencyTests/BundleFv2/BundleFv2.wixproj b/src/test/burn/TestData/DependencyTests/BundleFv2/BundleFv2.wixproj new file mode 100644 index 00000000..7b6aa9f3 --- /dev/null +++ b/src/test/burn/TestData/DependencyTests/BundleFv2/BundleFv2.wixproj | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 2 | <Project Sdk="WixToolset.Sdk"> | ||
| 3 | <Import Project="..\BundleF\BundleF.props" /> | ||
| 4 | <PropertyGroup> | ||
| 5 | <Version>2.0.0.0</Version> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" /> | ||
| 9 | <ProjectReference Include="..\PackageB\PackageB.wixproj" /> | ||
| 10 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | ||
| 11 | </ItemGroup> | ||
| 12 | <ItemGroup> | ||
| 13 | <PackageReference Include="WixToolset.Bal.wixext" /> | ||
| 14 | <PackageReference Include="WixToolset.NetFx.wixext" /> | ||
| 15 | <PackageReference Include="WixToolset.Util.wixext" /> | ||
| 16 | </ItemGroup> | ||
| 17 | </Project> \ No newline at end of file | ||
diff --git a/src/test/burn/TestData/DependencyTests/BundleFv2/BundleFv2.wxs b/src/test/burn/TestData/DependencyTests/BundleFv2/BundleFv2.wxs new file mode 100644 index 00000000..1347836a --- /dev/null +++ b/src/test/burn/TestData/DependencyTests/BundleFv2/BundleFv2.wxs | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 2 | |||
| 3 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 4 | <Fragment> | ||
| 5 | <RelatedBundle Id="583B5ECB-04E6-4837-A30C-A1ADCBE24235" Action="Detect" /> | ||
| 6 | |||
| 7 | <PackageGroup Id="BundlePackages"> | ||
| 8 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> | ||
| 9 | <MsiPackage Id="PackageB" SourceFile="$(var.PackageB.TargetPath)" /> | ||
| 10 | </PackageGroup> | ||
| 11 | </Fragment> | ||
| 12 | </Wix> | ||
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/BurnE2ETests.cs b/src/test/burn/WixToolsetTest.BurnE2E/BurnE2ETests.cs index 392b675d..a7402d94 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/BurnE2ETests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/BurnE2ETests.cs | |||
| @@ -15,6 +15,13 @@ namespace WixToolsetTest.BurnE2E | |||
| 15 | 15 | ||
| 16 | private Stack<IDisposable> Installers { get; } = new Stack<IDisposable>(); | 16 | private Stack<IDisposable> Installers { get; } = new Stack<IDisposable>(); |
| 17 | 17 | ||
| 18 | protected bool SupportAddonAndPatchRelatedBundles => | ||
| 19 | #if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES | ||
| 20 | true; | ||
| 21 | #else | ||
| 22 | false; | ||
| 23 | #endif | ||
| 24 | |||
| 18 | protected BundleInstaller CreateBundleInstaller(string name) | 25 | protected BundleInstaller CreateBundleInstaller(string name) |
| 19 | { | 26 | { |
| 20 | var installer = new BundleInstaller(this.TestContext, name); | 27 | var installer = new BundleInstaller(this.TestContext, name); |
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/DependencyTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/DependencyTests.cs index 309241d9..b08cd54f 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/DependencyTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/DependencyTests.cs | |||
| @@ -123,11 +123,7 @@ namespace WixToolsetTest.BurnE2E | |||
| 123 | bundleAv1.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.1.0"); | 123 | bundleAv1.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.1.0"); |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | #if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES | ||
| 127 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")] | 126 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")] |
| 128 | #else | ||
| 129 | [Fact(Skip = "addon/patch related bundle")] | ||
| 130 | #endif | ||
| 131 | public void CanMinorUpgradeDependencyPackageFromPatchBundle() | 127 | public void CanMinorUpgradeDependencyPackageFromPatchBundle() |
| 132 | { | 128 | { |
| 133 | var originalVersion = "1.0.0.0"; | 129 | var originalVersion = "1.0.0.0"; |
| @@ -145,34 +141,39 @@ namespace WixToolsetTest.BurnE2E | |||
| 145 | packageBv101.VerifyInstalled(false); | 141 | packageBv101.VerifyInstalled(false); |
| 146 | 142 | ||
| 147 | bundleJ.Install(); | 143 | bundleJ.Install(); |
| 148 | bundleJ.VerifyRegisteredAndInPackageCache(); | 144 | if (this.SupportAddonAndPatchRelatedBundles) |
| 145 | { | ||
| 146 | bundleJ.VerifyRegisteredAndInPackageCache(); | ||
| 149 | 147 | ||
| 150 | packageA.VerifyInstalled(true); | 148 | packageA.VerifyInstalled(true); |
| 151 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); | 149 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); |
| 152 | packageBv1.VerifyInstalled(true); | 150 | packageBv1.VerifyInstalled(true); |
| 151 | } | ||
| 153 | 152 | ||
| 154 | bundleJ_Patch.Install(); | 153 | bundleJ_Patch.Install(); |
| 155 | bundleJ_Patch.VerifyRegisteredAndInPackageCache(); | 154 | if (this.SupportAddonAndPatchRelatedBundles) |
| 155 | { | ||
| 156 | bundleJ_Patch.VerifyRegisteredAndInPackageCache(); | ||
| 156 | 157 | ||
| 157 | packageA.VerifyInstalled(true); | 158 | packageA.VerifyInstalled(true); |
| 158 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion); | 159 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion); |
| 159 | packageBv1.VerifyInstalled(false); | 160 | packageBv1.VerifyInstalled(false); |
| 160 | packageBv101.VerifyInstalled(true); | 161 | packageBv101.VerifyInstalled(true); |
| 162 | } | ||
| 161 | 163 | ||
| 162 | bundleJ.Uninstall(); | 164 | bundleJ.Uninstall(); |
| 163 | bundleJ.VerifyUnregisteredAndRemovedFromPackageCache(); | 165 | if (this.SupportAddonAndPatchRelatedBundles) |
| 164 | bundleJ_Patch.VerifyUnregisteredAndRemovedFromPackageCache(); | 166 | { |
| 165 | 167 | bundleJ.VerifyUnregisteredAndRemovedFromPackageCache(); | |
| 166 | packageA.VerifyInstalled(false); | 168 | bundleJ_Patch.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 167 | packageBv1.VerifyInstalled(false); | 169 | |
| 168 | packageBv101.VerifyInstalled(false); | 170 | packageA.VerifyInstalled(false); |
| 171 | packageBv1.VerifyInstalled(false); | ||
| 172 | packageBv101.VerifyInstalled(false); | ||
| 173 | } | ||
| 169 | } | 174 | } |
| 170 | 175 | ||
| 171 | #if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES | ||
| 172 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")] | 176 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")] |
| 173 | #else | ||
| 174 | [Fact(Skip = "addon/patch related bundle")] | ||
| 175 | #endif | ||
| 176 | public void CanMinorUpgradeDependencyPackageFromPatchBundleThenUninstallToRestoreBase() | 177 | public void CanMinorUpgradeDependencyPackageFromPatchBundleThenUninstallToRestoreBase() |
| 177 | { | 178 | { |
| 178 | var originalVersion = "1.0.0.0"; | 179 | var originalVersion = "1.0.0.0"; |
| @@ -190,41 +191,49 @@ namespace WixToolsetTest.BurnE2E | |||
| 190 | packageBv101.VerifyInstalled(false); | 191 | packageBv101.VerifyInstalled(false); |
| 191 | 192 | ||
| 192 | bundleJ.Install(); | 193 | bundleJ.Install(); |
| 193 | bundleJ.VerifyRegisteredAndInPackageCache(); | 194 | if (this.SupportAddonAndPatchRelatedBundles) |
| 195 | { | ||
| 196 | bundleJ.VerifyRegisteredAndInPackageCache(); | ||
| 194 | 197 | ||
| 195 | packageA.VerifyInstalled(true); | 198 | packageA.VerifyInstalled(true); |
| 196 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); | 199 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); |
| 197 | packageBv1.VerifyInstalled(true); | 200 | packageBv1.VerifyInstalled(true); |
| 201 | } | ||
| 198 | 202 | ||
| 199 | bundleJ_Patch.Install(); | 203 | bundleJ_Patch.Install(); |
| 200 | bundleJ_Patch.VerifyRegisteredAndInPackageCache(); | 204 | if (this.SupportAddonAndPatchRelatedBundles) |
| 205 | { | ||
| 206 | bundleJ_Patch.VerifyRegisteredAndInPackageCache(); | ||
| 201 | 207 | ||
| 202 | packageA.VerifyInstalled(true); | 208 | packageA.VerifyInstalled(true); |
| 203 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion); | 209 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion); |
| 204 | packageBv1.VerifyInstalled(false); | 210 | packageBv1.VerifyInstalled(false); |
| 205 | packageBv101.VerifyInstalled(true); | 211 | packageBv101.VerifyInstalled(true); |
| 212 | } | ||
| 206 | 213 | ||
| 207 | bundleJ_Patch.Uninstall(); | 214 | bundleJ_Patch.Uninstall(); |
| 208 | bundleJ_Patch.VerifyUnregisteredAndRemovedFromPackageCache(); | 215 | if (this.SupportAddonAndPatchRelatedBundles) |
| 216 | { | ||
| 217 | bundleJ_Patch.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 209 | 218 | ||
| 210 | packageA.VerifyInstalled(true); | 219 | packageA.VerifyInstalled(true); |
| 211 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); | 220 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); |
| 212 | packageBv1.VerifyInstalled(true); | 221 | packageBv1.VerifyInstalled(true); |
| 213 | packageBv101.VerifyInstalled(false); | 222 | packageBv101.VerifyInstalled(false); |
| 223 | } | ||
| 214 | 224 | ||
| 215 | bundleJ.Uninstall(); | 225 | bundleJ.Uninstall(); |
| 216 | bundleJ.VerifyUnregisteredAndRemovedFromPackageCache(); | 226 | if (this.SupportAddonAndPatchRelatedBundles) |
| 217 | 227 | { | |
| 218 | packageA.VerifyInstalled(false); | 228 | bundleJ.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 219 | packageBv1.VerifyInstalled(false); | 229 | |
| 220 | packageBv101.VerifyInstalled(false); | 230 | packageA.VerifyInstalled(false); |
| 231 | packageBv1.VerifyInstalled(false); | ||
| 232 | packageBv101.VerifyInstalled(false); | ||
| 233 | } | ||
| 221 | } | 234 | } |
| 222 | 235 | ||
| 223 | #if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES | ||
| 224 | [Fact] | 236 | [Fact] |
| 225 | #else | ||
| 226 | [Fact(Skip = "addon/patch related bundle")] | ||
| 227 | #endif | ||
| 228 | public void CanUninstallBaseWithAddOnsWhenAllSharePackages() | 237 | public void CanUninstallBaseWithAddOnsWhenAllSharePackages() |
| 229 | { | 238 | { |
| 230 | var testRegistryValueExe = "ExeA"; | 239 | var testRegistryValueExe = "ExeA"; |
| @@ -239,33 +248,103 @@ namespace WixToolsetTest.BurnE2E | |||
| 239 | packageB.VerifyInstalled(false); | 248 | packageB.VerifyInstalled(false); |
| 240 | 249 | ||
| 241 | bundleF.Install(); | 250 | bundleF.Install(); |
| 242 | bundleF.VerifyRegisteredAndInPackageCache(); | 251 | if (this.SupportAddonAndPatchRelatedBundles) |
| 252 | { | ||
| 253 | bundleF.VerifyRegisteredAndInPackageCache(); | ||
| 243 | 254 | ||
| 244 | packageA.VerifyInstalled(true); | 255 | packageA.VerifyInstalled(true); |
| 245 | packageB.VerifyInstalled(true); | 256 | packageB.VerifyInstalled(true); |
| 257 | } | ||
| 246 | 258 | ||
| 247 | bundleF_AddOnA.Install(); | 259 | bundleF_AddOnA.Install(); |
| 248 | bundleF_AddOnA.VerifyRegisteredAndInPackageCache(); | 260 | if (this.SupportAddonAndPatchRelatedBundles) |
| 261 | { | ||
| 262 | bundleF_AddOnA.VerifyRegisteredAndInPackageCache(); | ||
| 249 | 263 | ||
| 250 | packageA.VerifyInstalled(true); | 264 | packageA.VerifyInstalled(true); |
| 251 | bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0"); | 265 | bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0"); |
| 252 | packageB.VerifyInstalled(true); | 266 | packageB.VerifyInstalled(true); |
| 267 | } | ||
| 253 | 268 | ||
| 254 | bundleF_AddOnB.Install(); | 269 | bundleF_AddOnB.Install(); |
| 255 | bundleF_AddOnB.VerifyRegisteredAndInPackageCache(); | 270 | if (this.SupportAddonAndPatchRelatedBundles) |
| 271 | { | ||
| 272 | bundleF_AddOnB.VerifyRegisteredAndInPackageCache(); | ||
| 256 | 273 | ||
| 257 | packageA.VerifyInstalled(true); | 274 | packageA.VerifyInstalled(true); |
| 258 | bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0"); | 275 | bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0"); |
| 259 | packageB.VerifyInstalled(true); | 276 | packageB.VerifyInstalled(true); |
| 277 | } | ||
| 260 | 278 | ||
| 261 | bundleF.Uninstall(); | 279 | bundleF.Uninstall(); |
| 262 | bundleF.VerifyUnregisteredAndRemovedFromPackageCache(); | 280 | if (this.SupportAddonAndPatchRelatedBundles) |
| 263 | bundleF_AddOnA.VerifyUnregisteredAndRemovedFromPackageCache(); | 281 | { |
| 264 | bundleF_AddOnB.VerifyUnregisteredAndRemovedFromPackageCache(); | 282 | bundleF.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 283 | bundleF_AddOnA.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 284 | bundleF_AddOnB.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 285 | |||
| 286 | packageA.VerifyInstalled(false); | ||
| 287 | bundleF.VerifyExeTestRegistryRootDeleted(testRegistryValueExe); | ||
| 288 | packageB.VerifyInstalled(false); | ||
| 289 | } | ||
| 290 | } | ||
| 291 | |||
| 292 | [Fact] | ||
| 293 | public void CanUpgradeBaseWithAddOns() | ||
| 294 | { | ||
| 295 | var testRegistryValueExe = "ExeA"; | ||
| 296 | |||
| 297 | var packageA = this.CreatePackageInstaller("PackageAv1"); | ||
| 298 | var packageB = this.CreatePackageInstaller("PackageB"); | ||
| 299 | var bundleF = this.CreateBundleInstaller("BundleF"); | ||
| 300 | var bundleF_AddOnA = this.CreateBundleInstaller("BundleF_AddOnA"); | ||
| 301 | var bundleF_AddOnB = this.CreateBundleInstaller("BundleF_AddOnB"); | ||
| 302 | var bundleFv2 = this.CreateBundleInstaller("BundleFv2"); | ||
| 265 | 303 | ||
| 266 | packageA.VerifyInstalled(false); | 304 | packageA.VerifyInstalled(false); |
| 267 | bundleF.VerifyExeTestRegistryRootDeleted(testRegistryValueExe); | ||
| 268 | packageB.VerifyInstalled(false); | 305 | packageB.VerifyInstalled(false); |
| 306 | |||
| 307 | bundleF.Install(); | ||
| 308 | if (this.SupportAddonAndPatchRelatedBundles) | ||
| 309 | { | ||
| 310 | bundleF.VerifyRegisteredAndInPackageCache(); | ||
| 311 | |||
| 312 | packageA.VerifyInstalled(true); | ||
| 313 | packageB.VerifyInstalled(true); | ||
| 314 | } | ||
| 315 | |||
| 316 | bundleF_AddOnA.Install(); | ||
| 317 | if (this.SupportAddonAndPatchRelatedBundles) | ||
| 318 | { | ||
| 319 | bundleF_AddOnA.VerifyRegisteredAndInPackageCache(); | ||
| 320 | |||
| 321 | packageA.VerifyInstalled(true); | ||
| 322 | bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0"); | ||
| 323 | packageB.VerifyInstalled(true); | ||
| 324 | } | ||
| 325 | |||
| 326 | bundleF_AddOnB.Install(); | ||
| 327 | if (this.SupportAddonAndPatchRelatedBundles) | ||
| 328 | { | ||
| 329 | bundleF_AddOnB.VerifyRegisteredAndInPackageCache(); | ||
| 330 | |||
| 331 | packageA.VerifyInstalled(true); | ||
| 332 | bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0"); | ||
| 333 | packageB.VerifyInstalled(true); | ||
| 334 | } | ||
| 335 | |||
| 336 | bundleFv2.Install(); | ||
| 337 | if (this.SupportAddonAndPatchRelatedBundles) | ||
| 338 | { | ||
| 339 | bundleFv2.VerifyRegisteredAndInPackageCache(); | ||
| 340 | bundleF.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 341 | bundleF_AddOnA.VerifyRegisteredAndInPackageCache(); | ||
| 342 | bundleF_AddOnB.VerifyRegisteredAndInPackageCache(); | ||
| 343 | |||
| 344 | packageA.VerifyInstalled(true); | ||
| 345 | bundleF.VerifyExeTestRegistryValue(testRegistryValueExe, "1.0.0.0"); | ||
| 346 | packageB.VerifyInstalled(true); | ||
| 347 | } | ||
| 269 | } | 348 | } |
| 270 | 349 | ||
| 271 | [Fact] | 350 | [Fact] |
| @@ -343,11 +422,7 @@ namespace WixToolsetTest.BurnE2E | |||
| 343 | packageB.VerifyInstalled(false); | 422 | packageB.VerifyInstalled(false); |
| 344 | } | 423 | } |
| 345 | 424 | ||
| 346 | #if SUPPORT_ADDON_AND_PATCH_RELATED_BUNDLES | ||
| 347 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")] | 425 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6401")] |
| 348 | #else | ||
| 349 | [Fact(Skip = "addon/patch related bundle")] | ||
| 350 | #endif | ||
| 351 | public void CanUpgradePatchBundleWithAdditionalPatch() | 426 | public void CanUpgradePatchBundleWithAdditionalPatch() |
| 352 | { | 427 | { |
| 353 | var originalVersion = "1.0.0.0"; | 428 | var originalVersion = "1.0.0.0"; |
| @@ -365,33 +440,45 @@ namespace WixToolsetTest.BurnE2E | |||
| 365 | packageB.VerifyInstalled(false); | 440 | packageB.VerifyInstalled(false); |
| 366 | 441 | ||
| 367 | bundleF.Install(); | 442 | bundleF.Install(); |
| 368 | bundleF.VerifyRegisteredAndInPackageCache(); | 443 | if (this.SupportAddonAndPatchRelatedBundles) |
| 444 | { | ||
| 445 | bundleF.VerifyRegisteredAndInPackageCache(); | ||
| 369 | 446 | ||
| 370 | packageA.VerifyInstalled(true); | 447 | packageA.VerifyInstalled(true); |
| 371 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); | 448 | packageA.VerifyTestRegistryValue(testRegistryValue, originalVersion); |
| 372 | packageB.VerifyInstalled(true); | 449 | packageB.VerifyInstalled(true); |
| 450 | } | ||
| 373 | 451 | ||
| 374 | bundleF_PatchAv101.Install(); | 452 | bundleF_PatchAv101.Install(); |
| 375 | bundleF_PatchAv101.VerifyRegisteredAndInPackageCache(); | 453 | if (this.SupportAddonAndPatchRelatedBundles) |
| 454 | { | ||
| 455 | bundleF_PatchAv101.VerifyRegisteredAndInPackageCache(); | ||
| 376 | 456 | ||
| 377 | packageA.VerifyInstalled(true); | 457 | packageA.VerifyInstalled(true); |
| 378 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion); | 458 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion); |
| 379 | packageB.VerifyInstalled(false); | 459 | packageB.VerifyInstalled(false); |
| 460 | } | ||
| 380 | 461 | ||
| 381 | bundleF_PatchAv102.Install(); | 462 | bundleF_PatchAv102.Install(); |
| 382 | bundleF_PatchAv102.VerifyRegisteredAndInPackageCache(); | 463 | if (this.SupportAddonAndPatchRelatedBundles) |
| 464 | { | ||
| 465 | bundleF_PatchAv102.VerifyRegisteredAndInPackageCache(); | ||
| 383 | 466 | ||
| 384 | packageA.VerifyInstalled(true); | 467 | packageA.VerifyInstalled(true); |
| 385 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion2); | 468 | packageA.VerifyTestRegistryValue(testRegistryValue, patchedVersion2); |
| 386 | packageB.VerifyInstalled(false); | 469 | packageB.VerifyInstalled(false); |
| 470 | } | ||
| 387 | 471 | ||
| 388 | bundleF.Uninstall(); | 472 | bundleF.Uninstall(); |
| 389 | bundleF.VerifyUnregisteredAndRemovedFromPackageCache(); | 473 | if (this.SupportAddonAndPatchRelatedBundles) |
| 390 | bundleF_PatchAv101.VerifyUnregisteredAndRemovedFromPackageCache(); | 474 | { |
| 391 | bundleF_PatchAv102.VerifyUnregisteredAndRemovedFromPackageCache(); | 475 | bundleF.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 392 | 476 | bundleF_PatchAv101.VerifyUnregisteredAndRemovedFromPackageCache(); | |
| 393 | packageA.VerifyInstalled(false); | 477 | bundleF_PatchAv102.VerifyUnregisteredAndRemovedFromPackageCache(); |
| 394 | packageB.VerifyInstalled(false); | 478 | |
| 479 | packageA.VerifyInstalled(false); | ||
| 480 | packageB.VerifyInstalled(false); | ||
| 481 | } | ||
| 395 | } | 482 | } |
| 396 | 483 | ||
| 397 | [Fact] | 484 | [Fact] |
