From fafdaa522ff2a3888dfceb0ab56911c4f8cdf48d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 21 Jan 2026 21:20:40 -0500 Subject: Allow patched package to be uninstalled. Normally, a patched package is detected as superseded and therefore a normal uninstall takes no action. This change looks for applied patches and allows a normal uninstall to remove the package. Fixes https://github.com/wixtoolset/issues/issues/6350 --- .../BundleAv1_0_1/BundleAv1_0_1.wixproj | 19 +++++++++++++++++ .../BundleAv1_0_1/BundleAv1_0_1.wxs | 12 +++++++++++ .../PatchAMinor/PatchAMinor.wixproj | 12 +++++++++++ .../SlipstreamTests/PatchAMinor/PatchAMinor.wxs | 23 +++++++++++++++++++++ .../burn/WixToolsetTest.BurnE2E/SlipstreamTests.cs | 24 +++++++++++++++++++++- 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wixproj create mode 100644 src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wxs create mode 100644 src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wixproj create mode 100644 src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wxs (limited to 'src/test/burn') diff --git a/src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wixproj b/src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wixproj new file mode 100644 index 00000000..ac9cf71e --- /dev/null +++ b/src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wixproj @@ -0,0 +1,19 @@ + + + + Bundle + {62C28DAF-A13E-4F55-ACA1-FB843630789C} + + + + + + + + + + + + + + diff --git a/src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wxs b/src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wxs new file mode 100644 index 00000000..a14383d3 --- /dev/null +++ b/src/test/burn/TestData/SlipstreamTests/BundleAv1_0_1/BundleAv1_0_1.wxs @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wixproj b/src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wixproj new file mode 100644 index 00000000..3deb2263 --- /dev/null +++ b/src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wixproj @@ -0,0 +1,12 @@ + + + + Patch + .msp + 1079 + + + + + + diff --git a/src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wxs b/src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wxs new file mode 100644 index 00000000..0f4abd2b --- /dev/null +++ b/src/test/burn/TestData/SlipstreamTests/PatchAMinor/PatchAMinor.wxs @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/test/burn/WixToolsetTest.BurnE2E/SlipstreamTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/SlipstreamTests.cs index d07e80f1..d4cf447d 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/SlipstreamTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/SlipstreamTests.cs @@ -18,7 +18,7 @@ namespace WixToolsetTest.BurnE2E private const string V101 = "1.0.1.0"; [RuntimeFact] - public void CanInstallBundleWithSlipstreamedPatchThenRemoveIt() + public void CanInstallBundleWithSlipstreamedSmallUpdatePatchThenRemoveIt() { var testRegistryValue = "PackageA"; @@ -39,6 +39,28 @@ namespace WixToolsetTest.BurnE2E packageAv1.VerifyTestRegistryRootDeleted(); } + [RuntimeFact] + public void CanInstallBundleWithSlipstreamedMinorUpgradePatchThenRemoveIt() + { + var testRegistryValue = "PackageA"; + + var packageAv1 = this.CreatePackageInstaller("PackageAv1"); + var bundleA = this.CreateBundleInstaller("BundleAv1_0_1"); + + var packageAv1SourceCodeInstalled = packageAv1.GetInstalledFilePath("Package.wxs"); + Assert.False(File.Exists(packageAv1SourceCodeInstalled), $"PackageAv1 payload should not be there on test start: {packageAv1SourceCodeInstalled}"); + + bundleA.Install(); + bundleA.VerifyRegisteredAndInPackageCache(); + Assert.True(File.Exists(packageAv1SourceCodeInstalled), String.Concat("Should have found PackageAv1 payload installed at: ", packageAv1SourceCodeInstalled)); + packageAv1.VerifyTestRegistryValue(testRegistryValue, V101); + + bundleA.Uninstall(); + bundleA.VerifyUnregisteredAndRemovedFromPackageCache(); + Assert.False(File.Exists(packageAv1SourceCodeInstalled), String.Concat("PackageAv1 payload should have been removed by uninstall from: ", packageAv1SourceCodeInstalled)); + packageAv1.VerifyTestRegistryRootDeleted(); + } + /// /// BundleA installs PackageA with slipstreamed PatchA. /// BundleOnlyPatchA is installed which contains PatchA (which should be a no-op). -- cgit v1.2.3-55-g6feb