@joebigelow / wix / commits / b60898e0

Add failing test for #3897.

Sean Hall committed Feb 17, 2021 at 16:07 UTC b60898e0bccbb0b0ddad74df6370e826cb9b7494
3 files changed +54
src/TestData/SlipstreamTests/BundleD/BundleD.wixproj new
+19
@@ -0,0 +1,19 @@
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 + <UpgradeCode>{5372D18C-8C62-4C22-A24B-6BB2FB4AA966}</UpgradeCode>
6 + </PropertyGroup>
7 + <ItemGroup>
8 + <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" />
9 + </ItemGroup>
10 + <ItemGroup>
11 + <ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
12 + <ProjectReference Include="..\PatchA\PatchA.wixproj" />
13 + <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
14 + </ItemGroup>
15 + <ItemGroup>
16 + <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.83" />
17 + <PackageReference Include="WixToolset.NetFx.wixext" Version="4.0.61" />
18 + </ItemGroup>
19 +</Project>
\ No newline at end of file
src/TestData/SlipstreamTests/BundleD/BundleD.wxs 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 +
3 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
4 + <Fragment>
5 + <PackageGroup Id="BundlePackages">
6 + <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)">
7 + <SlipstreamMsp Id="PatchA" />
8 + </MsiPackage>
9 + <MspPackage Id="PatchA" SourceFile="$(var.PatchA.TargetPath)" InstallCondition="WixBundleInstalled = 1" />
10 + </PackageGroup>
11 + </Fragment>
12 +</Wix>
src/WixToolsetTest.BurnE2E/SlipstreamTests.cs
+23
@@ -326,5 +326,28 @@ namespace WixToolsetTest.BurnE2E
326 packageAv1.VerifyInstalled(false);
327 packageAv1.VerifyTestRegistryRootDeleted();
328 }
329 +
330 + [Fact(Skip = "https://github.com/wixtoolset/issues/issues/3897")]
331 + public void RespectsSlipstreamedPatchInstallCondition()
332 + {
333 + var testRegistryValue = "PackageA";
334 +
335 + var packageAv1 = this.CreatePackageInstaller("PackageAv1");
336 + var bundleD = this.CreateBundleInstaller("BundleD");
337 +
338 + var packageAv1SourceCodeInstalled = packageAv1.GetInstalledFilePath("Package.wxs");
339 + Assert.False(File.Exists(packageAv1SourceCodeInstalled), $"PackageAv1 payload should not be there on test start: {packageAv1SourceCodeInstalled}");
340 +
341 + bundleD.Install();
342 + bundleD.VerifyRegisteredAndInPackageCache();
343 + Assert.True(File.Exists(packageAv1SourceCodeInstalled), String.Concat("Should have found PackageAv1 payload installed at: ", packageAv1SourceCodeInstalled));
344 + // The patch was not supposed to be installed.
345 + packageAv1.VerifyTestRegistryValue(testRegistryValue, V100);
346 +
347 + bundleD.Uninstall();
348 + bundleD.VerifyUnregisteredAndRemovedFromPackageCache();
349 + Assert.False(File.Exists(packageAv1SourceCodeInstalled), String.Concat("PackageAv1 payload should have been removed by uninstall from: ", packageAv1SourceCodeInstalled));
350 + packageAv1.VerifyTestRegistryRootDeleted();
351 + }
352 }
353 }