@joebigelow / wix-1 / commits / 41f239fb

Add test for same exact package in multiple versions of a bundle.

Sean Hall committed Jan 24, 2021 at 20:58 UTC 41f239fb378f8371e10805c3b186ae79d734e4d4
9 files changed +104 -2
src/TestData/DependencyTests/BundleKv1/BundleK.props 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 +<Project>
3 + <PropertyGroup>
4 + <OutputType>Bundle</OutputType>
5 + <UpgradeCode>{F7B7CCD8-ACFE-45D8-9EC2-934BBC3BE597}</UpgradeCode>
6 + </PropertyGroup>
7 + <ItemGroup>
8 + <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
9 + </ItemGroup>
10 +</Project>
src/TestData/DependencyTests/BundleKv1/BundleKv1.wixproj new
+12
@@ -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 +<Project Sdk="WixToolset.Sdk">
3 + <Import Project="BundleK.props" />
4 + <ItemGroup>
5 + <ProjectReference Include="..\PackageF\PackageF.wixproj" />
6 + <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
7 + </ItemGroup>
8 + <ItemGroup>
9 + <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.81" />
10 + <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.57" />
11 + </ItemGroup>
12 +</Project>
\ No newline at end of file
src/TestData/DependencyTests/BundleKv1/BundleKv1.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="PackageF" SourceFile="$(var.PackageF.TargetPath)" />
8 + </PackageGroup>
9 + </Fragment>
10 +</Wix>
src/TestData/DependencyTests/BundleKv2/BundleKv2.wixproj new
+15
@@ -0,0 +1,15 @@
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="..\BundleKv1\BundleK.props" />
4 + <PropertyGroup>
5 + <Version>2.0.0.0</Version>
6 + </PropertyGroup>
7 + <ItemGroup>
8 + <ProjectReference Include="..\PackageF\PackageF.wixproj" />
9 + <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
10 + </ItemGroup>
11 + <ItemGroup>
12 + <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.81" />
13 + <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.57" />
14 + </ItemGroup>
15 +</Project>
\ No newline at end of file
src/TestData/DependencyTests/BundleKv2/BundleKv2.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="PackageF" SourceFile="$(var.PackageF.TargetPath)" />
8 + </PackageGroup>
9 + </Fragment>
10 +</Wix>
src/TestData/DependencyTests/PackageF/PackageF.wixproj new
+9
@@ -0,0 +1,9 @@
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 + <UpgradeCode>{069AECC6-84DC-4FA4-B506-CD3A9A76F2F4}</UpgradeCode>
5 + </PropertyGroup>
6 + <ItemGroup>
7 + <Compile Include="..\..\Templates\Package.wxs" Link="Package.wxs" />
8 + </ItemGroup>
9 +</Project>
\ No newline at end of file
src/TestData/Templates/Package.wxs
-1
@@ -15,7 +15,6 @@
15 <MediaTemplate CabinetTemplate="{0}$(var.CabPrefix).cab" />
16 <?endif?>
17
18 - <Property Id="MsiLogging" Value="voicewarmup" />
18 <PropertyRef Id="TestVersion" />
19
20 <Feature Id="Complete" Level="1">
src/TestData/Templates/PackageFail.wxs
-1
@@ -11,7 +11,6 @@
11 <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
12 <MediaTemplate EmbedCab="yes" />
13
14 - <Property Id="MsiLogging" Value="voicewarmup" />
14 <PropertyRef Id="TestVersion" />
15
16 <Feature Id="Complete" Level="1">
src/WixToolsetTest.BurnE2E/DependencyTests.cs new
+38
@@ -0,0 +1,38 @@
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 WixToolsetTest.BurnE2E
4 +{
5 + using Xunit;
6 + using Xunit.Abstractions;
7 +
8 + public class DependencyTests : BurnE2ETests
9 + {
10 + public DependencyTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { }
11 +
12 + [Fact]
13 + public void CanKeepSameExactPackageAfterUpgradingBundle()
14 + {
15 + var packageA = this.CreatePackageInstaller("PackageF");
16 + var bundleAv1 = this.CreateBundleInstaller("BundleKv1");
17 + var bundleAv2 = this.CreateBundleInstaller("BundleKv2");
18 +
19 + packageA.VerifyInstalled(false);
20 +
21 + bundleAv1.Install();
22 + bundleAv1.VerifyRegisteredAndInPackageCache();
23 +
24 + packageA.VerifyInstalled(true);
25 +
26 + bundleAv2.Install();
27 + bundleAv2.VerifyRegisteredAndInPackageCache();
28 + bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache();
29 +
30 + packageA.VerifyInstalled(true);
31 +
32 + bundleAv2.Uninstall();
33 + bundleAv2.VerifyUnregisteredAndRemovedFromPackageCache();
34 +
35 + packageA.VerifyInstalled(false);
36 + }
37 + }
38 +}