diff options
| author | Bob Arnson <bob@firegiant.com> | 2026-02-04 20:47:04 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2026-02-04 20:47:04 -0500 |
| commit | edccb203c421d2bd820062024088c6698424d9ee (patch) | |
| tree | 6b47c3eb5ca53bd9f79f3d032dc1a596d411bf38 /src/api/burn/WixToolset.BootstrapperApplicationApi | |
| parent | a3d3963f806117ce123d95e8b77e73e1c1545b25 (diff) | |
| download | wix-edccb203c421d2bd820062024088c6698424d9ee.tar.gz wix-edccb203c421d2bd820062024088c6698424d9ee.tar.bz2 wix-edccb203c421d2bd820062024088c6698424d9ee.zip | |
Support dual-purpose packages in Burn.bob/ConfigurableScopeBundles
Fixes https://github.com/wixtoolset/issues/issues/8958
Diffstat (limited to 'src/api/burn/WixToolset.BootstrapperApplicationApi')
5 files changed, 48 insertions, 14 deletions
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs index 612e8ce9..795a40d4 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs | |||
| @@ -20,6 +20,7 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 20 | [MarshalAs(UnmanagedType.I4)] internal int cbSize; | 20 | [MarshalAs(UnmanagedType.I4)] internal int cbSize; |
| 21 | [MarshalAs(UnmanagedType.U4)] private readonly LaunchAction action; | 21 | [MarshalAs(UnmanagedType.U4)] private readonly LaunchAction action; |
| 22 | [MarshalAs(UnmanagedType.U4)] private readonly Display display; | 22 | [MarshalAs(UnmanagedType.U4)] private readonly Display display; |
| 23 | [MarshalAs(UnmanagedType.U4)] private readonly BundleScope scope; | ||
| 23 | private readonly IntPtr wzCommandLine; | 24 | private readonly IntPtr wzCommandLine; |
| 24 | [MarshalAs(UnmanagedType.I4)] private readonly int nCmdShow; | 25 | [MarshalAs(UnmanagedType.I4)] private readonly int nCmdShow; |
| 25 | [MarshalAs(UnmanagedType.U4)] private readonly ResumeType resume; | 26 | [MarshalAs(UnmanagedType.U4)] private readonly ResumeType resume; |
| @@ -39,6 +40,7 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 39 | return new BootstrapperCommand( | 40 | return new BootstrapperCommand( |
| 40 | this.action, | 41 | this.action, |
| 41 | this.display, | 42 | this.display, |
| 43 | this.scope, | ||
| 42 | Marshal.PtrToStringUni(this.wzCommandLine), | 44 | Marshal.PtrToStringUni(this.wzCommandLine), |
| 43 | this.nCmdShow, | 45 | this.nCmdShow, |
| 44 | this.resume, | 46 | this.resume, |
| @@ -62,6 +64,7 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 62 | public BootstrapperCommand( | 64 | public BootstrapperCommand( |
| 63 | LaunchAction action, | 65 | LaunchAction action, |
| 64 | Display display, | 66 | Display display, |
| 67 | BundleScope scope, | ||
| 65 | string commandLine, | 68 | string commandLine, |
| 66 | int cmdShow, | 69 | int cmdShow, |
| 67 | ResumeType resume, | 70 | ResumeType resume, |
| @@ -74,6 +77,7 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 74 | { | 77 | { |
| 75 | this.Action = action; | 78 | this.Action = action; |
| 76 | this.Display = display; | 79 | this.Display = display; |
| 80 | this.Scope = scope; | ||
| 77 | this.CommandLine = commandLine; | 81 | this.CommandLine = commandLine; |
| 78 | this.CmdShow = cmdShow; | 82 | this.CmdShow = cmdShow; |
| 79 | this.Resume = resume; | 83 | this.Resume = resume; |
| @@ -92,6 +96,9 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 92 | public Display Display { get; } | 96 | public Display Display { get; } |
| 93 | 97 | ||
| 94 | /// <inheritdoc/> | 98 | /// <inheritdoc/> |
| 99 | public BundleScope Scope { get; } | ||
| 100 | |||
| 101 | /// <inheritdoc/> | ||
| 95 | public string CommandLine { get; } | 102 | public string CommandLine { get; } |
| 96 | 103 | ||
| 97 | /// <inheritdoc/> | 104 | /// <inheritdoc/> |
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs index 25413790..82978b7d 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs | |||
| @@ -12,7 +12,7 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 12 | /// </summary> | 12 | /// </summary> |
| 13 | public sealed class Engine : IEngine | 13 | public sealed class Engine : IEngine |
| 14 | { | 14 | { |
| 15 | private IBootstrapperEngine engine; | 15 | private readonly IBootstrapperEngine engine; |
| 16 | 16 | ||
| 17 | internal Engine(IBootstrapperEngine engine) | 17 | internal Engine(IBootstrapperEngine engine) |
| 18 | { | 18 | { |
| @@ -24,8 +24,7 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 24 | { | 24 | { |
| 25 | get | 25 | get |
| 26 | { | 26 | { |
| 27 | int count; | 27 | this.engine.GetPackageCount(out var count); |
| 28 | this.engine.GetPackageCount(out count); | ||
| 29 | 28 | ||
| 30 | return count; | 29 | return count; |
| 31 | } | 30 | } |
| @@ -110,8 +109,7 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 110 | /// <inheritdoc/> | 109 | /// <inheritdoc/> |
| 111 | public bool EvaluateCondition(string condition) | 110 | public bool EvaluateCondition(string condition) |
| 112 | { | 111 | { |
| 113 | bool value; | 112 | this.engine.EvaluateCondition(condition, out var value); |
| 114 | this.engine.EvaluateCondition(condition, out value); | ||
| 115 | 113 | ||
| 116 | return value; | 114 | return value; |
| 117 | } | 115 | } |
| @@ -247,9 +245,9 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 247 | } | 245 | } |
| 248 | 246 | ||
| 249 | /// <inheritdoc/> | 247 | /// <inheritdoc/> |
| 250 | public void Plan(LaunchAction action) | 248 | public void Plan(LaunchAction action, BundleScope plannedScope) |
| 251 | { | 249 | { |
| 252 | this.engine.Plan(action); | 250 | this.engine.Plan(action, plannedScope); |
| 253 | } | 251 | } |
| 254 | 252 | ||
| 255 | /// <inheritdoc/> | 253 | /// <inheritdoc/> |
| @@ -327,16 +325,16 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 327 | /// <inheritdoc/> | 325 | /// <inheritdoc/> |
| 328 | public int SendEmbeddedError(int errorCode, string message, int uiHint) | 326 | public int SendEmbeddedError(int errorCode, string message, int uiHint) |
| 329 | { | 327 | { |
| 330 | int result = 0; | 328 | this.engine.SendEmbeddedError(errorCode, message, uiHint, out var result); |
| 331 | this.engine.SendEmbeddedError(errorCode, message, uiHint, out result); | 329 | |
| 332 | return result; | 330 | return result; |
| 333 | } | 331 | } |
| 334 | 332 | ||
| 335 | /// <inheritdoc/> | 333 | /// <inheritdoc/> |
| 336 | public int SendEmbeddedProgress(int progressPercentage, int overallPercentage) | 334 | public int SendEmbeddedProgress(int progressPercentage, int overallPercentage) |
| 337 | { | 335 | { |
| 338 | int result = 0; | 336 | this.engine.SendEmbeddedProgress(progressPercentage, overallPercentage, out var result); |
| 339 | this.engine.SendEmbeddedProgress(progressPercentage, overallPercentage, out result); | 337 | |
| 340 | return result; | 338 | return result; |
| 341 | } | 339 | } |
| 342 | 340 | ||
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs index a1f8bfe0..7a5a4cfd 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs | |||
| @@ -20,6 +20,11 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 20 | Display Display { get; } | 20 | Display Display { get; } |
| 21 | 21 | ||
| 22 | /// <summary> | 22 | /// <summary> |
| 23 | /// Gets the bundle scope if set at the command line. | ||
| 24 | /// </summary> | ||
| 25 | BundleScope Scope { get; } | ||
| 26 | |||
| 27 | /// <summary> | ||
| 23 | /// Gets the command line arguments. | 28 | /// Gets the command line arguments. |
| 24 | /// </summary> | 29 | /// </summary> |
| 25 | /// <returns> | 30 | /// <returns> |
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs index 13702757..9df57cd3 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs | |||
| @@ -178,10 +178,11 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 178 | ); | 178 | ); |
| 179 | 179 | ||
| 180 | /// <summary> | 180 | /// <summary> |
| 181 | /// See <see cref="IEngine.Plan(LaunchAction)"/>. | 181 | /// See <see cref="IEngine.Plan(LaunchAction, BundleScope)"/>. |
| 182 | /// </summary> | 182 | /// </summary> |
| 183 | void Plan( | 183 | void Plan( |
| 184 | [MarshalAs(UnmanagedType.U4)] LaunchAction action | 184 | [MarshalAs(UnmanagedType.U4)] LaunchAction action, |
| 185 | [MarshalAs(UnmanagedType.U4)] BundleScope plannedScope | ||
| 185 | ); | 186 | ); |
| 186 | 187 | ||
| 187 | /// <summary> | 188 | /// <summary> |
| @@ -344,6 +345,28 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 344 | } | 345 | } |
| 345 | 346 | ||
| 346 | /// <summary> | 347 | /// <summary> |
| 348 | /// The scope of the bundle when the chain contains per-user-or-machine or per-machone-or-user packages. | ||
| 349 | /// </summary> | ||
| 350 | public enum BundleScope | ||
| 351 | { | ||
| 352 | /// <summary> | ||
| 353 | /// Let Burn choose the scope. Per-user-or-machine packages will be | ||
| 354 | /// planned as per-machine packages. | ||
| 355 | /// </summary> | ||
| 356 | Default, | ||
| 357 | |||
| 358 | /// <summary> | ||
| 359 | /// Set per-machine scope for per-user-or-machine packages. | ||
| 360 | /// </summary> | ||
| 361 | PerMachine, | ||
| 362 | |||
| 363 | /// <summary> | ||
| 364 | /// Set per-user scope for per-user-or-machine packages. | ||
| 365 | /// </summary> | ||
| 366 | PerUser, | ||
| 367 | } | ||
| 368 | |||
| 369 | /// <summary> | ||
| 347 | /// The message log level. | 370 | /// The message log level. |
| 348 | /// </summary> | 371 | /// </summary> |
| 349 | public enum LogLevel | 372 | public enum LogLevel |
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs index 03ceed06..a763d741 100644 --- a/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs +++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs | |||
| @@ -139,7 +139,8 @@ namespace WixToolset.BootstrapperApplicationApi | |||
| 139 | /// Determine the installation sequencing and costing. | 139 | /// Determine the installation sequencing and costing. |
| 140 | /// </summary> | 140 | /// </summary> |
| 141 | /// <param name="action">The action to perform when planning.</param> | 141 | /// <param name="action">The action to perform when planning.</param> |
| 142 | void Plan(LaunchAction action); | 142 | /// <param name="plannedScope">The bundle scope for per-user-or-machine packages.</param> |
| 143 | void Plan(LaunchAction action, BundleScope plannedScope); | ||
| 143 | 144 | ||
| 144 | /// <summary> | 145 | /// <summary> |
| 145 | /// Set the update information for a bundle. | 146 | /// Set the update information for a bundle. |
