Skip to content

Commit

Permalink
Don't fail on bad/missing update feed URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Dec 15, 2022
1 parent df98a76 commit be24495
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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*/
Expand Down
6 changes: 5 additions & 1 deletion src/test/burn/TestData/WixStdBaTests/BundleA/Bundle.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
<Bundle Name="~$(var.TestGroupName) - $(var.BundleName)" Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)" Compressed="yes" bal:CommandLineVariables="caseSensitive">
<Log Prefix="~$(var.TestGroupName)_$(var.BundleName)" />

<Update Location='http://wixtoolset.org/releases/feed/v3.14' />
<?ifndef UpdateFeed ?>
<?define UpdateFeed = "http://wixtoolset.org/releases/feed/v3.14" ?>
<?endif?>

<Update Location='$(UpdateFeed)' />

<Variable Name="TestGroupName" Value="$(var.TestGroupName)" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- 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. -->
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<OutputType>Bundle</OutputType>
<UpgradeCode>{7D977157-06C9-4176-A931-AC16E18AAB51}</UpgradeCode>
<DefineConstants>$(DefineConstants);Version=12.34;UpdateFeed=http://wixtoolsetZZZ.org/releases/feed/vSECRET.FEED</DefineConstants>
<OutputName>WixStdBaTest_BadUpdateFeed</OutputName>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\PackageA\PackageA.wixproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Bal.wixext" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions src/test/burn/WixToolsetTest.BurnE2E/WixStdBaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit be24495

Please sign in to comment.