diff options
author | Bob Arnson <bob@firegiant.com> | 2022-12-14 18:04:23 -0500 |
---|---|---|
committer | Bob Arnson <github@bobs.org> | 2022-12-15 14:41:19 -0500 |
commit | be2449594668fab0f21eea3a80fa1efede85de77 (patch) | |
tree | 72a4cdaadbca2c6ce3d63e2675cd1a7a56187780 | |
parent | df98a76a0b3873dea86a3e1ccfb8e39f9eddac13 (diff) | |
download | wix-be2449594668fab0f21eea3a80fa1efede85de77.tar.gz wix-be2449594668fab0f21eea3a80fa1efede85de77.tar.bz2 wix-be2449594668fab0f21eea3a80fa1efede85de77.zip |
Don't fail on bad/missing update feed URL.
4 files changed, 56 insertions, 1 deletions
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index 998fe4cf..e4eee002 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -384,6 +384,10 @@ public: // IBootstrapperApplication | |||
384 | __inout BOOL* pfStopProcessingUpdates | 384 | __inout BOOL* pfStopProcessingUpdates |
385 | ) | 385 | ) |
386 | { | 386 | { |
387 | #ifdef DEBUG | ||
388 | BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnDetectUpdate() - update location: %ls, version: %ls", wzUpdateLocation, wzUpdateVersion); | ||
389 | #endif | ||
390 | |||
387 | HRESULT hr = S_OK; | 391 | HRESULT hr = S_OK; |
388 | int nResult = 0; | 392 | int nResult = 0; |
389 | 393 | ||
@@ -413,6 +417,17 @@ public: // IBootstrapperApplication | |||
413 | } | 417 | } |
414 | 418 | ||
415 | 419 | ||
420 | virtual STDMETHODIMP OnDetectUpdateComplete( | ||
421 | __in HRESULT /*hrStatus*/, | ||
422 | __inout BOOL* pfIgnoreError | ||
423 | ) | ||
424 | { | ||
425 | // A failed update is very sad indeed, but shouldn't be fatal. | ||
426 | *pfIgnoreError = TRUE; | ||
427 | |||
428 | return S_OK; | ||
429 | } | ||
430 | |||
416 | virtual STDMETHODIMP OnDetectComplete( | 431 | virtual STDMETHODIMP OnDetectComplete( |
417 | __in HRESULT hrStatus, | 432 | __in HRESULT hrStatus, |
418 | __in BOOL /*fEligibleForCleanup*/ | 433 | __in BOOL /*fEligibleForCleanup*/ |
diff --git a/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs b/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs index 98a00344..70b8ed1f 100644 --- a/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs +++ b/src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs | |||
@@ -4,7 +4,11 @@ | |||
4 | <Bundle Name="~$(var.TestGroupName) - $(var.BundleName)" Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)" Compressed="yes" bal:CommandLineVariables="caseSensitive"> | 4 | <Bundle Name="~$(var.TestGroupName) - $(var.BundleName)" Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)" Compressed="yes" bal:CommandLineVariables="caseSensitive"> |
5 | <Log Prefix="~$(var.TestGroupName)_$(var.BundleName)" /> | 5 | <Log Prefix="~$(var.TestGroupName)_$(var.BundleName)" /> |
6 | 6 | ||
7 | <Update Location='http://wixtoolset.org/releases/feed/v3.14' /> | 7 | <?ifndef UpdateFeed ?> |
8 | <?define UpdateFeed = "http://wixtoolset.org/releases/feed/v3.14" ?> | ||
9 | <?endif?> | ||
10 | |||
11 | <Update Location='$(UpdateFeed)' /> | ||
8 | 12 | ||
9 | <Variable Name="TestGroupName" Value="$(var.TestGroupName)" /> | 13 | <Variable Name="TestGroupName" Value="$(var.TestGroupName)" /> |
10 | 14 | ||
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 00000000..0abf0077 --- /dev/null +++ b/src/test/burn/TestData/WixStdBaTests/BundleA/BundleA_BadUpdateFeed.wixproj | |||
@@ -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 | <PropertyGroup> | ||
4 | <OutputType>Bundle</OutputType> | ||
5 | <UpgradeCode>{7D977157-06C9-4176-A931-AC16E18AAB51}</UpgradeCode> | ||
6 | <DefineConstants>$(DefineConstants);Version=12.34;UpdateFeed=http://wixtoolsetZZZ.org/releases/feed/vSECRET.FEED</DefineConstants> | ||
7 | <OutputName>WixStdBaTest_BadUpdateFeed</OutputName> | ||
8 | </PropertyGroup> | ||
9 | <ItemGroup> | ||
10 | <ProjectReference Include="..\PackageA\PackageA.wixproj" /> | ||
11 | </ItemGroup> | ||
12 | <ItemGroup> | ||
13 | <PackageReference Include="WixToolset.Bal.wixext" /> | ||
14 | </ItemGroup> | ||
15 | </Project> \ 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 fe05419f..ec7bca6f 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs | |||
@@ -50,5 +50,26 @@ namespace WixToolsetTest.BurnE2E | |||
50 | 50 | ||
51 | packageA.VerifyInstalled(true); | 51 | packageA.VerifyInstalled(true); |
52 | } | 52 | } |
53 | |||
54 | [RuntimeFact] | ||
55 | public void SucceedsWhenFeedUrlIsBad() | ||
56 | { | ||
57 | // This test never fails because update checks are skipped in -quiet. | ||
58 | // See https://github.com/wixtoolset/issues/issues/7090. | ||
59 | var packageA = this.CreatePackageInstaller("PackageA"); | ||
60 | var bundle = this.CreateBundleInstaller("WixStdBaTest_BadUpdateFeed"); | ||
61 | |||
62 | packageA.VerifyInstalled(false); | ||
63 | |||
64 | bundle.Install(); | ||
65 | bundle.VerifyRegisteredAndInPackageCache(); | ||
66 | |||
67 | packageA.VerifyInstalled(true); | ||
68 | |||
69 | bundle.Uninstall(); | ||
70 | bundle.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
71 | |||
72 | packageA.VerifyInstalled(false); | ||
73 | } | ||
53 | } | 74 | } |
54 | } | 75 | } |