From be2449594668fab0f21eea3a80fa1efede85de77 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 14 Dec 2022 18:04:23 -0500 Subject: [PATCH] Don't fail on bad/missing update feed URL. --- .../WixStandardBootstrapperApplication.cpp | 15 +++++++++++++ .../TestData/WixStdBaTests/BundleA/Bundle.wxs | 6 +++++- .../BundleA/BundleA_BadUpdateFeed.wixproj | 15 +++++++++++++ .../WixToolsetTest.BurnE2E/WixStdBaTests.cs | 21 +++++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/test/burn/TestData/WixStdBaTests/BundleA/BundleA_BadUpdateFeed.wixproj diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index 998fe4cf7..e4eee0021 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp @@ -384,6 +384,10 @@ class CWixStandardBootstrapperApplication : public CBalBaseBootstrapperApplicati __inout BOOL* pfStopProcessingUpdates ) { +#ifdef DEBUG + BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnDetectUpdate() - update location: %ls, version: %ls", wzUpdateLocation, wzUpdateVersion); +#endif + HRESULT hr = S_OK; int nResult = 0; @@ -413,6 +417,17 @@ class CWixStandardBootstrapperApplication : public CBalBaseBootstrapperApplicati } + virtual STDMETHODIMP OnDetectUpdateComplete( + __in HRESULT /*hrStatus*/, + __inout BOOL* pfIgnoreError + ) + { + // A failed update is very sad indeed, but shouldn't be fatal. + *pfIgnoreError = TRUE; + + return S_OK; + } + virtual STDMETHODIMP OnDetectComplete( __in HRESULT hrStatus, __in BOOL /*fEligibleForCleanup*/ diff --git a/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs b/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs index 98a00344f..70b8ed1f7 100644 --- a/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs +++ b/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs @@ -4,7 +4,11 @@ - + + + + + diff --git a/src/test/burn/TestData/WixStdBaTests/BundleA/BundleA_BadUpdateFeed.wixproj b/src/test/burn/TestData/WixStdBaTests/BundleA/BundleA_BadUpdateFeed.wixproj new file mode 100644 index 000000000..0abf0077a --- /dev/null +++ b/src/test/burn/TestData/WixStdBaTests/BundleA/BundleA_BadUpdateFeed.wixproj @@ -0,0 +1,15 @@ + + + + Bundle + {7D977157-06C9-4176-A931-AC16E18AAB51} + $(DefineConstants);Version=12.34;UpdateFeed=http://wixtoolsetZZZ.org/releases/feed/vSECRET.FEED + WixStdBaTest_BadUpdateFeed + + + + + + + + \ No newline at end of file diff --git a/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs index fe05419fb..ec7bca6f9 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs @@ -50,5 +50,26 @@ public void ExitsWithoutErrorWhenDowngradingWithSuppression() packageA.VerifyInstalled(true); } + + [RuntimeFact] + public void SucceedsWhenFeedUrlIsBad() + { + // This test never fails because update checks are skipped in -quiet. + // See https://github.com/wixtoolset/issues/issues/7090. + var packageA = this.CreatePackageInstaller("PackageA"); + var bundle = this.CreateBundleInstaller("WixStdBaTest_BadUpdateFeed"); + + packageA.VerifyInstalled(false); + + bundle.Install(); + bundle.VerifyRegisteredAndInPackageCache(); + + packageA.VerifyInstalled(true); + + bundle.Uninstall(); + bundle.VerifyUnregisteredAndRemovedFromPackageCache(); + + packageA.VerifyInstalled(false); + } } }