Use WixBA in an upgrade.
Bob Arnson committed
Mar 18, 2024 at 10:49 UTC
3b842aeea892c9dae01e5167e5f2e35c448f5bda
5 files changed
+79
-2
src/test/burn/TestData/UpgradeRelatedBundleTests/BundleD_x64_v2/BundleD_x64_v2.wixproj
new
+21
@@ -0,0 +1,21 @@
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
+ <PropertyGroup>
4
+ <OutputType>Bundle</OutputType>
5
+ <BA>WixBAdnc_x64</BA>
6
+ <UpgradeCode>{62E3DFA4-6849-44F0-93A1-C8F60DBB76E3}</UpgradeCode>
7
+ <InstallerPlatform>x64</InstallerPlatform>
8
+ <Version>2.0.0.0</Version>
9
+ </PropertyGroup>
10
+ <ItemGroup>
11
+ <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
12
+ </ItemGroup>
13
+ <ItemGroup>
14
+ <ProjectReference Include="..\PackageAv2\PackageAv2.wixproj" />
15
+ <ProjectReference Include="..\..\TestBA\TestBAWixlib_x64\testbawixlib_x64.wixproj" />
16
+ </ItemGroup>
17
+ <ItemGroup>
18
+ <PackageReference Include="WixToolset.BootstrapperApplications.wixext" />
19
+ <PackageReference Include="WixToolset.NetFx.wixext" />
20
+ </ItemGroup>
21
+</Project>
src/test/burn/TestData/UpgradeRelatedBundleTests/BundleD_x64_v2/BundleD_x64_v2.wxs
new
+10
@@ -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
+
3
+
4
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5
+ <Fragment>
6
+ <PackageGroup Id="BundlePackages">
7
+ <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv2.TargetPath)" />
8
+ </PackageGroup>
9
+ </Fragment>
10
+</Wix>
src/test/burn/TestData/UpgradeRelatedBundleTests/BundleD_x64_v3/BundleD_x64_v3.wixproj
new
+21
@@ -0,0 +1,21 @@
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
+ <PropertyGroup>
4
+ <OutputType>Bundle</OutputType>
5
+ <BA>WixBAdnc_x64</BA>
6
+ <UpgradeCode>{62E3DFA4-6849-44F0-93A1-C8F60DBB76E3}</UpgradeCode>
7
+ <InstallerPlatform>x64</InstallerPlatform>
8
+ <Version>3.0.0.0</Version>
9
+ </PropertyGroup>
10
+ <ItemGroup>
11
+ <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
12
+ </ItemGroup>
13
+ <ItemGroup>
14
+ <ProjectReference Include="..\PackageAv3\PackageAv3.wixproj" />
15
+ <ProjectReference Include="..\..\TestBA\TestBAWixlib_x64\testbawixlib_x64.wixproj" />
16
+ </ItemGroup>
17
+ <ItemGroup>
18
+ <PackageReference Include="WixToolset.BootstrapperApplications.wixext" />
19
+ <PackageReference Include="WixToolset.NetFx.wixext" />
20
+ </ItemGroup>
21
+</Project>
src/test/burn/TestData/UpgradeRelatedBundleTests/BundleD_x64_v3/BundleD_x64_v3.wxs
new
+10
@@ -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
+
3
+
4
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5
+ <Fragment>
6
+ <PackageGroup Id="BundlePackages">
7
+ <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv3.TargetPath)" />
8
+ </PackageGroup>
9
+ </Fragment>
10
+</Wix>
src/test/burn/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs
+17
-2
@@ -102,7 +102,7 @@ namespace WixToolsetTest.BurnE2E
102
bundleAv2x64.VerifyRegisteredAndInPackageCache();
103
104
bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache();
105
-
105
+
106
Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2x64InstallLogFilePath, @"Detected related package: \{[0-9A-Za-z\-]{36}\}, scope: PerMachine, version: 1.0.0.0, language: 1033 operation: MajorUpgrade"));
107
}
108
@@ -119,8 +119,23 @@ namespace WixToolsetTest.BurnE2E
119
120
bundleAv2.Install();
121
bundleAv2.VerifyRegisteredAndInPackageCache();
122
-
122
+
123
bundleAv1x64.VerifyUnregisteredAndRemovedFromPackageCache();
124
}
125
+
126
+ [RuntimeFact]
127
+ public void DncBABundleUpgradesDncBABundle()
128
+ {
129
+ var bundleDv2 = this.CreateBundleInstaller("BundleD_x64_v2");
130
+ var bundleDv3 = this.CreateBundleInstaller("BundleD_x64_v3");
131
+
132
+ bundleDv2.Install();
133
+ bundleDv2.VerifyRegisteredAndInPackageCache();
134
+
135
+ bundleDv3.Install();
136
+ bundleDv3.VerifyRegisteredAndInPackageCache();
137
+
138
+ bundleDv2.VerifyUnregisteredAndRemovedFromPackageCache();
139
+ }
140
}
141
}