diff options
author | Nir Bar <nir.bar@panel-sw.co.il> | 2021-08-11 15:37:34 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-08-12 14:50:55 -0500 |
commit | 0042e3d4554a0d92e1da6141854b0f1aafa07d5b (patch) | |
tree | 7dcd25456993d6a9d68b9afd21fd1d1f77bd2a5e /src/api/burn/WixToolset.Mba.Core | |
parent | c6b138ed166e30c750e499919b858dc6913937b6 (diff) | |
download | wix-0042e3d4554a0d92e1da6141854b0f1aafa07d5b.tar.gz wix-0042e3d4554a0d92e1da6141854b0f1aafa07d5b.tar.bz2 wix-0042e3d4554a0d92e1da6141854b0f1aafa07d5b.zip |
Allow BA to opt out of MSI transaction.
Diffstat (limited to 'src/api/burn/WixToolset.Mba.Core')
4 files changed, 75 insertions, 0 deletions
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs index d7dbf04c..b6fdca1e 100644 --- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs | |||
@@ -86,6 +86,9 @@ namespace WixToolset.Mba.Core | |||
86 | public event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle; | 86 | public event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle; |
87 | 87 | ||
88 | /// <inheritdoc/> | 88 | /// <inheritdoc/> |
89 | public event EventHandler<PlanRollbackBoundaryEventArgs> PlanRollbackBoundary; | ||
90 | |||
91 | /// <inheritdoc/> | ||
89 | public event EventHandler<PlanPackageBeginEventArgs> PlanPackageBegin; | 92 | public event EventHandler<PlanPackageBeginEventArgs> PlanPackageBegin; |
90 | 93 | ||
91 | /// <inheritdoc/> | 94 | /// <inheritdoc/> |
@@ -497,6 +500,18 @@ namespace WixToolset.Mba.Core | |||
497 | } | 500 | } |
498 | 501 | ||
499 | /// <summary> | 502 | /// <summary> |
503 | /// Called by the engine, raises the <see cref="PlanRollbackBoundary"/> event. | ||
504 | /// </summary> | ||
505 | protected virtual void OnPlanRollbackBoundary(PlanRollbackBoundaryEventArgs args) | ||
506 | { | ||
507 | EventHandler<PlanRollbackBoundaryEventArgs> handler = this.PlanRollbackBoundary; | ||
508 | if (null != handler) | ||
509 | { | ||
510 | handler(this, args); | ||
511 | } | ||
512 | } | ||
513 | |||
514 | /// <summary> | ||
500 | /// Called by the engine, raises the <see cref="PlanPackageBegin"/> event. | 515 | /// Called by the engine, raises the <see cref="PlanPackageBegin"/> event. |
501 | /// </summary> | 516 | /// </summary> |
502 | /// <param name="args">Additional arguments for this event.</param> | 517 | /// <param name="args">Additional arguments for this event.</param> |
@@ -1378,6 +1393,16 @@ namespace WixToolset.Mba.Core | |||
1378 | return args.HResult; | 1393 | return args.HResult; |
1379 | } | 1394 | } |
1380 | 1395 | ||
1396 | int IBootstrapperApplication.OnPlanRollbackBoundary(string wzRollbackBoundaryId, bool fRecommendedTransaction, ref bool fTransaction, ref bool fCancel) | ||
1397 | { | ||
1398 | PlanRollbackBoundaryEventArgs args = new PlanRollbackBoundaryEventArgs(wzRollbackBoundaryId, fRecommendedTransaction, fTransaction, fCancel); | ||
1399 | this.OnPlanRollbackBoundary(args); | ||
1400 | |||
1401 | fTransaction = args.Transaction; | ||
1402 | fCancel = args.Cancel; | ||
1403 | return args.HResult; | ||
1404 | } | ||
1405 | |||
1381 | int IBootstrapperApplication.OnPlanPackageBegin(string wzPackageId, PackageState state, bool fCached, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, RequestState recommendedState, BOOTSTRAPPER_CACHE_TYPE recommendedCacheType, ref RequestState pRequestedState, ref BOOTSTRAPPER_CACHE_TYPE pRequestedCacheType, ref bool fCancel) | 1406 | int IBootstrapperApplication.OnPlanPackageBegin(string wzPackageId, PackageState state, bool fCached, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, RequestState recommendedState, BOOTSTRAPPER_CACHE_TYPE recommendedCacheType, ref RequestState pRequestedState, ref BOOTSTRAPPER_CACHE_TYPE pRequestedCacheType, ref bool fCancel) |
1382 | { | 1407 | { |
1383 | PlanPackageBeginEventArgs args = new PlanPackageBeginEventArgs(wzPackageId, state, fCached, installCondition, recommendedState, recommendedCacheType, pRequestedState, pRequestedCacheType, fCancel); | 1408 | PlanPackageBeginEventArgs args = new PlanPackageBeginEventArgs(wzPackageId, state, fCached, installCondition, recommendedState, recommendedCacheType, pRequestedState, pRequestedCacheType, fCancel); |
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs index 00d90c83..04e7b579 100644 --- a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs +++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs | |||
@@ -782,6 +782,39 @@ namespace WixToolset.Mba.Core | |||
782 | } | 782 | } |
783 | 783 | ||
784 | /// <summary> | 784 | /// <summary> |
785 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRollbackBoundary"/> | ||
786 | /// </summary> | ||
787 | [Serializable] | ||
788 | public class PlanRollbackBoundaryEventArgs : CancellableHResultEventArgs | ||
789 | { | ||
790 | /// <summary /> | ||
791 | public PlanRollbackBoundaryEventArgs(string rollbackBoundaryId, bool recommendedTransaction, bool transaction, bool cancelRecommendation) | ||
792 | : base(cancelRecommendation) | ||
793 | { | ||
794 | this.RollbackBoundaryId = rollbackBoundaryId; | ||
795 | this.RecommendedTransaction = recommendedTransaction; | ||
796 | this.Transaction = transaction; | ||
797 | } | ||
798 | |||
799 | /// <summary> | ||
800 | /// Gets the identity of the rollback boundary to plan for. | ||
801 | /// </summary> | ||
802 | public string RollbackBoundaryId { get; private set; } | ||
803 | |||
804 | /// <summary> | ||
805 | /// Whether or not the rollback boundary was authored to use an MSI transaction. | ||
806 | /// </summary> | ||
807 | public bool RecommendedTransaction { get; private set; } | ||
808 | |||
809 | /// <summary> | ||
810 | /// Whether or not an MSI transaction will be used in the rollback boundary. | ||
811 | /// If <see cref="RecommendedTransaction"/> is false, setting the value to true has no effect. | ||
812 | /// If <see cref="RecommendedTransaction"/> is true, setting the value to false will cause the packages inside this rollback boundary to be executed without a wrapping MSI transaction. | ||
813 | /// </summary> | ||
814 | public bool Transaction { get; set; } | ||
815 | } | ||
816 | |||
817 | /// <summary> | ||
785 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPatchTarget"/> | 818 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPatchTarget"/> |
786 | /// </summary> | 819 | /// </summary> |
787 | [Serializable] | 820 | [Serializable] |
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs index e6e03906..07c1a23b 100644 --- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs | |||
@@ -304,6 +304,18 @@ namespace WixToolset.Mba.Core | |||
304 | ); | 304 | ); |
305 | 305 | ||
306 | /// <summary> | 306 | /// <summary> |
307 | /// See <see cref="IDefaultBootstrapperApplication.PlanRollbackBoundary"/>. | ||
308 | /// </summary> | ||
309 | [PreserveSig] | ||
310 | [return: MarshalAs(UnmanagedType.I4)] | ||
311 | int OnPlanRollbackBoundary( | ||
312 | [MarshalAs(UnmanagedType.LPWStr)] string wzRollbackBoundaryId, | ||
313 | [MarshalAs(UnmanagedType.Bool)] bool fRecommendedTransaction, | ||
314 | [MarshalAs(UnmanagedType.Bool)] ref bool fTransaction, | ||
315 | [MarshalAs(UnmanagedType.Bool)] ref bool fCancel | ||
316 | ); | ||
317 | |||
318 | /// <summary> | ||
307 | /// See <see cref="IDefaultBootstrapperApplication.PlanPackageBegin"/>. | 319 | /// See <see cref="IDefaultBootstrapperApplication.PlanPackageBegin"/>. |
308 | /// </summary> | 320 | /// </summary> |
309 | [PreserveSig] | 321 | [PreserveSig] |
diff --git a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs index a295f6c0..20ce9f88 100644 --- a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs | |||
@@ -314,6 +314,11 @@ namespace WixToolset.Mba.Core | |||
314 | event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle; | 314 | event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle; |
315 | 315 | ||
316 | /// <summary> | 316 | /// <summary> |
317 | /// Fired when the engine is planning a rollback boundary. | ||
318 | /// </summary> | ||
319 | event EventHandler<PlanRollbackBoundaryEventArgs> PlanRollbackBoundary; | ||
320 | |||
321 | /// <summary> | ||
317 | /// Fired when the engine has changed progress for the bundle installation. | 322 | /// Fired when the engine has changed progress for the bundle installation. |
318 | /// </summary> | 323 | /// </summary> |
319 | event EventHandler<ProgressEventArgs> Progress; | 324 | event EventHandler<ProgressEventArgs> Progress; |