@joebigelow / wix-1 / commits / be244959

Don't fail on bad/missing update feed URL.

Bob Arnson committed Dec 14, 2022 at 18:04 UTC be2449594668fab0f21eea3a80fa1efede85de77
4 files changed +56 -1
src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
+15
@@ -384,6 +384,10 @@ public: // IBootstrapperApplication
384 __inout BOOL* pfStopProcessingUpdates
385 )
386 {
387 +#ifdef DEBUG
388 + BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnDetectUpdate() - update location: %ls, version: %ls", wzUpdateLocation, wzUpdateVersion);
389 +#endif
390 +
391 HRESULT hr = S_OK;
392 int nResult = 0;
393
@@ -413,6 +417,17 @@ public: // IBootstrapperApplication
417 }
418
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 +
431 virtual STDMETHODIMP OnDetectComplete(
432 __in HRESULT hrStatus,
433 __in BOOL /*fEligibleForCleanup*/
src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs
+5 -1
@@ -4,7 +4,11 @@
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)" />
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)' />
12
13 <Variable Name="TestGroupName" Value="$(var.TestGroupName)" />
14
src/test/burn/TestData/WixStdBaTests/BundleA/BundleA_BadUpdateFeed.wixproj new
+15
@@ -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
src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs
+21
@@ -50,5 +50,26 @@ namespace WixToolsetTest.BurnE2E
50
51 packageA.VerifyInstalled(true);
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 + }
74 }
75 }