diff options
| author | Bob Arnson <bob@firegiant.com> | 2025-04-04 19:19:56 -0400 |
|---|---|---|
| committer | Bob Arnson <github@bobs.org> | 2025-04-04 20:10:19 -0400 |
| commit | 717ac8183b04da445b751865deb40330e5da87c3 (patch) | |
| tree | ee4a67d33053b01396b9fa21474a0151d4d38d70 /src | |
| parent | 90b1d345326fd05e701c82fa874590aeb6d1ee93 (diff) | |
| download | wix-717ac8183b04da445b751865deb40330e5da87c3.tar.gz wix-717ac8183b04da445b751865deb40330e5da87c3.tar.bz2 wix-717ac8183b04da445b751865deb40330e5da87c3.zip | |
Sync IEngine.SetUpdateSource with native side.
Fixes https://github.com/wixtoolset/issues/issues/9023
Diffstat (limited to 'src')
8 files changed, 96 insertions, 4 deletions
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs index 52ac90c5..25413790 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs | |||
| @@ -259,9 +259,9 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | /// <inheritdoc/> | 261 | /// <inheritdoc/> |
| 262 | public void SetUpdateSource(string url) | 262 | public void SetUpdateSource(string url, string authorizationHeader) |
| 263 | { | 263 | { |
| 264 | this.engine.SetUpdateSource(url); | 264 | this.engine.SetUpdateSource(url, authorizationHeader); |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | /// <inheritdoc/> | 267 | /// <inheritdoc/> |
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs index 172bafe8..13702757 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs | |||
| @@ -220,7 +220,8 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 220 | /// Sets the URL to the update feed. | 220 | /// Sets the URL to the update feed. |
| 221 | /// </summary> | 221 | /// </summary> |
| 222 | void SetUpdateSource( | 222 | void SetUpdateSource( |
| 223 | [MarshalAs(UnmanagedType.LPWStr)] string url | 223 | [MarshalAs(UnmanagedType.LPWStr)] string url, |
| 224 | [MarshalAs(UnmanagedType.LPWStr)] string wzAuthorizationHeader | ||
| 224 | ); | 225 | ); |
| 225 | 226 | ||
| 226 | /// <summary> | 227 | /// <summary> |
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs index ca423309..03ceed06 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs | |||
| @@ -156,7 +156,8 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 156 | /// Sets the URL to the update feed. | 156 | /// Sets the URL to the update feed. |
| 157 | /// </summary> | 157 | /// </summary> |
| 158 | /// <param name="url">URL of the update feed.</param> | 158 | /// <param name="url">URL of the update feed.</param> |
| 159 | void SetUpdateSource(string url); | 159 | /// <param name="authorizationHeader">Additional proxy authentication header. Not currently used.</param> |
| 160 | void SetUpdateSource(string url, string authorizationHeader); | ||
| 160 | 161 | ||
| 161 | /// <summary> | 162 | /// <summary> |
| 162 | /// Set the local source for a package or container. | 163 | /// Set the local source for a package or container. |
diff --git a/src/test/burn/TestBA/TestBA.cs b/src/test/burn/TestBA/TestBA.cs index 4f75a055..51fc1cbd 100644 --- a/src/test/burn/TestBA/TestBA.cs +++ b/src/test/burn/TestBA/TestBA.cs | |||
| @@ -42,6 +42,7 @@ namespace WixToolset.Test.BA | |||
| 42 | private int retryExecuteFilesInUse; | 42 | private int retryExecuteFilesInUse; |
| 43 | private bool rollingBack; | 43 | private bool rollingBack; |
| 44 | private string forceDownloadSource; | 44 | private string forceDownloadSource; |
| 45 | private string forceUpdateSource; | ||
| 45 | 46 | ||
| 46 | private IBootstrapperCommand Command { get; set; } | 47 | private IBootstrapperCommand Command { get; set; } |
| 47 | 48 | ||
| @@ -217,9 +218,28 @@ namespace WixToolset.Test.BA | |||
| 217 | } | 218 | } |
| 218 | } | 219 | } |
| 219 | 220 | ||
| 221 | protected override void OnDetectBegin(DetectBeginEventArgs args) | ||
| 222 | { | ||
| 223 | this.Log("OnDetectBegin"); | ||
| 224 | |||
| 225 | this.forceUpdateSource = this.ReadPackageAction(null, "ForceUpdateSource"); | ||
| 226 | if (!String.IsNullOrEmpty(this.forceUpdateSource)) | ||
| 227 | { | ||
| 228 | this.Log(" OnDetectBegin::ForceUpdateSource: {0}", this.forceUpdateSource); | ||
| 229 | } | ||
| 230 | |||
| 231 | } | ||
| 232 | |||
| 220 | protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) | 233 | protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) |
| 221 | { | 234 | { |
| 222 | this.Log("OnDetectUpdateBegin"); | 235 | this.Log("OnDetectUpdateBegin"); |
| 236 | |||
| 237 | if (!String.IsNullOrEmpty(this.forceUpdateSource)) | ||
| 238 | { | ||
| 239 | this.Log(" OnDetectUpdateBegin::ForceUpdateSource: {0}", this.forceUpdateSource); | ||
| 240 | this.Engine.SetUpdateSource(this.forceUpdateSource, String.Empty); | ||
| 241 | } | ||
| 242 | |||
| 223 | if (LaunchAction.UpdateReplaceEmbedded == this.action || LaunchAction.UpdateReplace == this.action) | 243 | if (LaunchAction.UpdateReplaceEmbedded == this.action || LaunchAction.UpdateReplace == this.action) |
| 224 | { | 244 | { |
| 225 | args.Skip = false; | 245 | args.Skip = false; |
diff --git a/src/test/burn/TestData/FailureTests/BundleUpdate/Bundle.wxs b/src/test/burn/TestData/FailureTests/BundleUpdate/Bundle.wxs new file mode 100644 index 00000000..0af817c1 --- /dev/null +++ b/src/test/burn/TestData/FailureTests/BundleUpdate/Bundle.wxs | |||
| @@ -0,0 +1,31 @@ | |||
| 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 | |||
| 3 | <?ifndef TestVersion?> | ||
| 4 | <?define TestVersion = 1.0.0.0?> | ||
| 5 | <?endif?> | ||
| 6 | |||
| 7 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
| 8 | <Bundle | ||
| 9 | Name="~$(var.TestGroupName) - $(var.BundleName)" | ||
| 10 | Version="$(var.TestVersion)" | ||
| 11 | Id="WixToolset.Burn.SetUpdateSourceTest" | ||
| 12 | Compressed="yes"> | ||
| 13 | |||
| 14 | <Update Location="updateurl" /> | ||
| 15 | |||
| 16 | <Log Prefix="~$(var.TestGroupName)_$(var.BundleName)" /> | ||
| 17 | |||
| 18 | <Variable Name="TestGroupName" Value="$(var.TestGroupName)" /> | ||
| 19 | |||
| 20 | <Chain> | ||
| 21 | <PackageGroupRef Id="TestBA" /> | ||
| 22 | <PackageGroupRef Id="BundlePackages" /> | ||
| 23 | </Chain> | ||
| 24 | </Bundle> | ||
| 25 | |||
| 26 | <Fragment> | ||
| 27 | <PackageGroup Id="BundlePackages"> | ||
| 28 | <MsiPackage Id="PackageA" SourceFile="$(var.PackageA.TargetPath)" /> | ||
| 29 | </PackageGroup> | ||
| 30 | </Fragment> | ||
| 31 | </Wix> | ||
diff --git a/src/test/burn/TestData/FailureTests/BundleUpdate/BundleUpdate.wixproj b/src/test/burn/TestData/FailureTests/BundleUpdate/BundleUpdate.wixproj new file mode 100644 index 00000000..34ab1aef --- /dev/null +++ b/src/test/burn/TestData/FailureTests/BundleUpdate/BundleUpdate.wixproj | |||
| @@ -0,0 +1,16 @@ | |||
| 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>{C60B9483-CE87-4FDA-AE5A-B39A52E956E8}</UpgradeCode> | ||
| 6 | </PropertyGroup> | ||
| 7 | <ItemGroup> | ||
| 8 | <ProjectReference Include="..\PackageA\PackageA.wixproj" /> | ||
| 9 | <ProjectReference Include="..\PackageB\PackageB.wixproj" /> | ||
| 10 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | ||
| 11 | </ItemGroup> | ||
| 12 | <ItemGroup> | ||
| 13 | <PackageReference Include="WixToolset.BootstrapperApplications.wixext" /> | ||
| 14 | <PackageReference Include="WixToolset.NetFx.wixext" /> | ||
| 15 | </ItemGroup> | ||
| 16 | </Project> | ||
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/FailureTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/FailureTests.cs index 4bbfc7e9..7d399df0 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/FailureTests.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/FailureTests.cs | |||
| @@ -30,6 +30,24 @@ namespace WixToolsetTest.BurnE2E | |||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | [RuntimeFact] | 32 | [RuntimeFact] |
| 33 | public void CanSetUpdateSource() | ||
| 34 | { | ||
| 35 | var packageA = this.CreatePackageInstaller("PackageA"); | ||
| 36 | var bundleA = this.CreateBundleInstaller("BundleUpdate"); | ||
| 37 | var testBAController = this.CreateTestBAController(); | ||
| 38 | |||
| 39 | testBAController.SetForceUpdateSource("https://1e1bf2be1c384fd1a0c4c0500eef971b/update_feed.atom.xml"); | ||
| 40 | |||
| 41 | packageA.VerifyInstalled(false); | ||
| 42 | |||
| 43 | bundleA.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
| 44 | |||
| 45 | bundleA.Install(); | ||
| 46 | |||
| 47 | packageA.VerifyInstalled(true); | ||
| 48 | } | ||
| 49 | |||
| 50 | [RuntimeFact] | ||
| 33 | public void CanCancelExePackageAndAbandonIt() | 51 | public void CanCancelExePackageAndAbandonIt() |
| 34 | { | 52 | { |
| 35 | var bundleD = this.CreateBundleInstaller("BundleD"); | 53 | var bundleD = this.CreateBundleInstaller("BundleD"); |
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestBAController.cs b/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestBAController.cs index ca395f56..c344ebce 100644 --- a/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestBAController.cs +++ b/src/test/burn/WixToolsetTest.BurnE2E/Utilities/TestBAController.cs | |||
| @@ -67,6 +67,11 @@ namespace WixToolsetTest.BurnE2E | |||
| 67 | this.SetBurnTestValue("QuitAfterDetect", value); | 67 | this.SetBurnTestValue("QuitAfterDetect", value); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | public void SetForceUpdateSource(string url) | ||
| 71 | { | ||
| 72 | this.SetBurnTestValue("ForceUpdateSource", url); | ||
| 73 | } | ||
| 74 | |||
| 70 | /// <summary> | 75 | /// <summary> |
| 71 | /// Slows the cache progress of a package. | 76 | /// Slows the cache progress of a package. |
| 72 | /// </summary> | 77 | /// </summary> |
