diff options
author | Bob Arnson <bob@firegiant.com> | 2022-08-31 16:07:08 -0400 |
---|---|---|
committer | Bob Arnson <github@bobs.org> | 2022-08-31 19:59:16 -0400 |
commit | 914a92d16d7a0245f3cf0b42cc5e320c34d23d30 (patch) | |
tree | f145e999fc4ccefa2e92466a45b602f080a32440 /src/api/burn/WixToolset.Mba.Core | |
parent | f6c86c939af9f8b0036f4b197512f06e861e5fd3 (diff) | |
download | wix-914a92d16d7a0245f3cf0b42cc5e320c34d23d30.tar.gz wix-914a92d16d7a0245f3cf0b42cc5e320c34d23d30.tar.bz2 wix-914a92d16d7a0245f3cf0b42cc5e320c34d23d30.zip |
Supply hashes to BA if present in update feed.
Fixes https://github.com/wixtoolset/issues/issues/6353.
Diffstat (limited to 'src/api/burn/WixToolset.Mba.Core')
4 files changed, 22 insertions, 5 deletions
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs index fe9322ce..ecc99069 100644 --- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs | |||
@@ -1451,9 +1451,9 @@ namespace WixToolset.Mba.Core | |||
1451 | return args.HResult; | 1451 | return args.HResult; |
1452 | } | 1452 | } |
1453 | 1453 | ||
1454 | int IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, string wzVersion, string wzTitle, string wzSummary, string wzContentType, string wzContent, ref bool fCancel, ref bool fStopProcessingUpdates) | 1454 | int IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, string wzHash, UpdateHashType hashAlgorithm, string wzVersion, string wzTitle, string wzSummary, string wzContentType, string wzContent, ref bool fCancel, ref bool fStopProcessingUpdates) |
1455 | { | 1455 | { |
1456 | DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, wzVersion, wzTitle, wzSummary, wzContentType, wzContent, fCancel, fStopProcessingUpdates); | 1456 | DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, wzHash, hashAlgorithm, wzVersion, wzTitle, wzSummary, wzContentType, wzContent, fCancel, fStopProcessingUpdates); |
1457 | this.OnDetectUpdate(args); | 1457 | this.OnDetectUpdate(args); |
1458 | 1458 | ||
1459 | fCancel = args.Cancel; | 1459 | fCancel = args.Cancel; |
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs index 2b414d91..48850fd7 100644 --- a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs +++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs | |||
@@ -5,6 +5,7 @@ namespace WixToolset.Mba.Core | |||
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using System.Collections.ObjectModel; | 7 | using System.Collections.ObjectModel; |
8 | using System.Runtime.InteropServices; | ||
8 | 9 | ||
9 | /// <summary> | 10 | /// <summary> |
10 | /// Base class for BA <see cref="EventArgs"/> classes. | 11 | /// Base class for BA <see cref="EventArgs"/> classes. |
@@ -328,11 +329,13 @@ namespace WixToolset.Mba.Core | |||
328 | public class DetectUpdateEventArgs : CancellableHResultEventArgs | 329 | public class DetectUpdateEventArgs : CancellableHResultEventArgs |
329 | { | 330 | { |
330 | /// <summary /> | 331 | /// <summary /> |
331 | public DetectUpdateEventArgs(string updateLocation, long size, string version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation) | 332 | public DetectUpdateEventArgs(string updateLocation, long size, string hash, UpdateHashType hashAlgorithm, string version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation) |
332 | : base(cancelRecommendation) | 333 | : base(cancelRecommendation) |
333 | { | 334 | { |
334 | this.UpdateLocation = updateLocation; | 335 | this.UpdateLocation = updateLocation; |
335 | this.Size = size; | 336 | this.Size = size; |
337 | this.Hash = hash; | ||
338 | this.HashAlgorithm = hashAlgorithm; | ||
336 | this.Version = version; | 339 | this.Version = version; |
337 | this.Title = title; | 340 | this.Title = title; |
338 | this.Summary = summary; | 341 | this.Summary = summary; |
@@ -352,6 +355,16 @@ namespace WixToolset.Mba.Core | |||
352 | public long Size { get; private set; } | 355 | public long Size { get; private set; } |
353 | 356 | ||
354 | /// <summary> | 357 | /// <summary> |
358 | /// File hash of the updated bundle. | ||
359 | /// </summary> | ||
360 | public string Hash { get; } | ||
361 | |||
362 | /// <summary> | ||
363 | /// The algorithm of the updated bundle's hash. | ||
364 | /// </summary> | ||
365 | public UpdateHashType HashAlgorithm { get; } | ||
366 | |||
367 | /// <summary> | ||
355 | /// Gets the version of the updated bundle. | 368 | /// Gets the version of the updated bundle. |
356 | /// </summary> | 369 | /// </summary> |
357 | public string Version { get; private set; } | 370 | public string Version { get; private set; } |
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs index 87da2191..daa95e17 100644 --- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs | |||
@@ -106,6 +106,8 @@ namespace WixToolset.Mba.Core | |||
106 | /// <param name="wzUpdateLocation"></param> | 106 | /// <param name="wzUpdateLocation"></param> |
107 | /// <param name="dw64Size"></param> | 107 | /// <param name="dw64Size"></param> |
108 | /// <param name="wzVersion"></param> | 108 | /// <param name="wzVersion"></param> |
109 | /// <param name="wzHash"></param> | ||
110 | /// <param name="hashAlgorithm"></param> | ||
109 | /// <param name="wzTitle"></param> | 111 | /// <param name="wzTitle"></param> |
110 | /// <param name="wzSummary"></param> | 112 | /// <param name="wzSummary"></param> |
111 | /// <param name="wzContentType"></param> | 113 | /// <param name="wzContentType"></param> |
@@ -118,6 +120,8 @@ namespace WixToolset.Mba.Core | |||
118 | int OnDetectUpdate( | 120 | int OnDetectUpdate( |
119 | [MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation, | 121 | [MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation, |
120 | [MarshalAs(UnmanagedType.U8)] long dw64Size, | 122 | [MarshalAs(UnmanagedType.U8)] long dw64Size, |
123 | [MarshalAs(UnmanagedType.LPWStr)] string wzHash, | ||
124 | [MarshalAs(UnmanagedType.U4)] UpdateHashType hashAlgorithm, | ||
121 | [MarshalAs(UnmanagedType.LPWStr)] string wzVersion, | 125 | [MarshalAs(UnmanagedType.LPWStr)] string wzVersion, |
122 | [MarshalAs(UnmanagedType.LPWStr)] string wzTitle, | 126 | [MarshalAs(UnmanagedType.LPWStr)] string wzTitle, |
123 | [MarshalAs(UnmanagedType.LPWStr)] string wzSummary, | 127 | [MarshalAs(UnmanagedType.LPWStr)] string wzSummary, |
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs index ebea6c4f..fdc9c3f6 100644 --- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs +++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs | |||
@@ -421,9 +421,9 @@ namespace WixToolset.Mba.Core | |||
421 | None, | 421 | None, |
422 | 422 | ||
423 | /// <summary> | 423 | /// <summary> |
424 | /// SHA-1 based hash provided. | 424 | /// SHA-512 based hash provided. |
425 | /// </summary> | 425 | /// </summary> |
426 | Sha1, | 426 | Sha512, |
427 | } | 427 | } |
428 | 428 | ||
429 | /// <summary> | 429 | /// <summary> |