From bd0f3491f36f4e24dd899e0c3479beed6e3c00f9 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 12 Dec 2022 23:09:03 -0600 Subject: wixstdba should not change the action if not showing full UI. wixstdba should not block downgrading if run from an upgrade related bundle. Fixes 7081 --- .../WixStandardBootstrapperApplication.cpp | 5 ++-- .../BundleAv2wixstdba/BundleAv2wixstdba.wixproj | 15 ++++++++++++ .../BundleAv2wixstdba/BundleAv2wixstdba.wxs | 10 ++++++++ .../BundleAv2wixstdba/BundleAwixstdba.props | 11 +++++++++ .../BundleAv3wixstdba/BundleAv3wixstdba.wixproj | 16 +++++++++++++ .../BundleAv3wixstdba/BundleAv3wixstdba.wxs | 11 +++++++++ .../UpgradeRelatedBundleTests.cs | 27 ++++++++++++++++++++++ 7 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wixproj create mode 100644 src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wxs create mode 100644 src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAwixstdba.props create mode 100644 src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wixproj create mode 100644 src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wxs (limited to 'src') diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index 3539450e..998fe4cf 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp @@ -271,8 +271,9 @@ public: // IBootstrapperApplication } } } - else // maybe modify the action state if the bundle is or is not already installed. + else if (BOOTSTRAPPER_DISPLAY_FULL <= m_command.display) // only modify the action state if showing full UI. { + // Maybe modify the action state if the bundle is or is not already installed. if (fInstalled && BOOTSTRAPPER_RESUME_TYPE_REBOOT != m_command.resumeType && BOOTSTRAPPER_ACTION_INSTALL == m_command.action) { m_command.action = BOOTSTRAPPER_ACTION_MODIFY; @@ -329,7 +330,7 @@ public: // IBootstrapperApplication // Best effort } - if (BOOTSTRAPPER_ACTION_INSTALL == m_command.action && BOOTSTRAPPER_RELATION_UPGRADE == relationType) + if (BOOTSTRAPPER_ACTION_INSTALL == m_command.action && BOOTSTRAPPER_RELATION_UPGRADE != m_command.relationType && BOOTSTRAPPER_RELATION_UPGRADE == relationType) { int nResult = 0; HRESULT hr = VerCompareStringVersions(m_sczBundleVersion, wzVersion, TRUE/*fStrict*/, &nResult); diff --git a/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wixproj b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wixproj new file mode 100644 index 00000000..e92c5200 --- /dev/null +++ b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wixproj @@ -0,0 +1,15 @@ + + + + + 2.0.0.0 + + + + + + + + + + \ No newline at end of file diff --git a/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wxs b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wxs new file mode 100644 index 00000000..5cbee5a8 --- /dev/null +++ b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAv2wixstdba.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAwixstdba.props b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAwixstdba.props new file mode 100644 index 00000000..1c766faa --- /dev/null +++ b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv2wixstdba/BundleAwixstdba.props @@ -0,0 +1,11 @@ + + + + Bundle + hyperlinkLicense + {5AA6B2C7-F3BC-4A49-812D-90F10C0BA8A1} + + + + + diff --git a/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wixproj b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wixproj new file mode 100644 index 00000000..2eb881ab --- /dev/null +++ b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wixproj @@ -0,0 +1,16 @@ + + + + + 3.0.0.0 + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wxs b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wxs new file mode 100644 index 00000000..b969b504 --- /dev/null +++ b/src/test/burn/TestData/UpgradeRelatedBundleTests/BundleAv3wixstdba/BundleAv3wixstdba.wxs @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/test/burn/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs index fbd26d73..d5d01c9c 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs @@ -39,6 +39,33 @@ namespace WixToolsetTest.BurnE2E packageAv3.VerifyInstalled(false); } + [RuntimeFact] + public void ReinstallsOlderBundleAfterFailureWixstdba() + { + var packageAv2 = this.CreatePackageInstaller("PackageAv2"); + var packageAv3 = this.CreatePackageInstaller("PackageAv3"); + var bundleAv2 = this.CreateBundleInstaller("BundleAv2wixstdba"); + var bundleAv3 = this.CreateBundleInstaller("BundleAv3wixstdba"); + + packageAv2.VerifyInstalled(false); + packageAv3.VerifyInstalled(false); + + bundleAv2.Install(); + bundleAv2.VerifyRegisteredAndInPackageCache(); + + packageAv2.VerifyInstalled(true); + packageAv3.VerifyInstalled(false); + + // Verify https://github.com/wixtoolset/issues/issues/3421 + var bundleAv3InstallLogFilePath = bundleAv3.Install((int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); + bundleAv3.VerifyUnregisteredAndRemovedFromPackageCache(); + + Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv3InstallLogFilePath, @"Applied execute package: PackageA, result: 0x0, restart: None")); + + packageAv2.VerifyInstalled(true); + packageAv3.VerifyInstalled(false); + } + [RuntimeFact] public void ReportsRelatedBundleMissingFromCache() { -- cgit v1.2.3-55-g6feb