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 | |
| 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')
22 files changed, 269 insertions, 9 deletions
diff --git a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h index 8301d45f..b7dc17c2 100644 --- a/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h +++ b/src/api/burn/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | |||
| @@ -189,6 +189,7 @@ enum BOOTSTRAPPER_APPLICATION_MESSAGE | |||
| 189 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN, | 189 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN, |
| 190 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE, | 190 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE, |
| 191 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, | 191 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, |
| 192 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY, | ||
| 192 | }; | 193 | }; |
| 193 | 194 | ||
| 194 | enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION | 195 | enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION |
| @@ -1129,6 +1130,20 @@ struct BA_ONPLANRELATEDBUNDLE_RESULTS | |||
| 1129 | BOOTSTRAPPER_REQUEST_STATE requestedState; | 1130 | BOOTSTRAPPER_REQUEST_STATE requestedState; |
| 1130 | }; | 1131 | }; |
| 1131 | 1132 | ||
| 1133 | struct BA_ONPLANROLLBACKBOUNDARY_ARGS | ||
| 1134 | { | ||
| 1135 | DWORD cbSize; | ||
| 1136 | LPCWSTR wzRollbackBoundaryId; | ||
| 1137 | BOOL fRecommendedTransaction; | ||
| 1138 | }; | ||
| 1139 | |||
| 1140 | struct BA_ONPLANROLLBACKBOUNDARY_RESULTS | ||
| 1141 | { | ||
| 1142 | DWORD cbSize; | ||
| 1143 | BOOL fTransaction; | ||
| 1144 | BOOL fCancel; | ||
| 1145 | }; | ||
| 1146 | |||
| 1132 | struct BA_ONPLANPATCHTARGET_ARGS | 1147 | struct BA_ONPLANPATCHTARGET_ARGS |
| 1133 | { | 1148 | { |
| 1134 | DWORD cbSize; | 1149 | DWORD cbSize; |
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; |
diff --git a/src/api/burn/balutil/inc/BAFunctions.h b/src/api/burn/balutil/inc/BAFunctions.h index 2970478f..43786701 100644 --- a/src/api/burn/balutil/inc/BAFunctions.h +++ b/src/api/burn/balutil/inc/BAFunctions.h | |||
| @@ -81,6 +81,7 @@ enum BA_FUNCTIONS_MESSAGE | |||
| 81 | BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN, | 81 | BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN, |
| 82 | BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE, | 82 | BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE, |
| 83 | BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, | 83 | BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS = BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, |
| 84 | BA_FUNCTIONS_MESSAGE_ONPLANROLLBACKBOUNDARY = BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY, | ||
| 84 | 85 | ||
| 85 | BA_FUNCTIONS_MESSAGE_ONTHEMELOADED = 1024, | 86 | BA_FUNCTIONS_MESSAGE_ONTHEMELOADED = 1024, |
| 86 | BA_FUNCTIONS_MESSAGE_WNDPROC, | 87 | BA_FUNCTIONS_MESSAGE_WNDPROC, |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index c5771efc..a3054709 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h | |||
| @@ -255,6 +255,16 @@ public: // IBootstrapperApplication | |||
| 255 | return S_OK; | 255 | return S_OK; |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | virtual STDMETHODIMP OnPlanRollbackBoundary( | ||
| 259 | __in_z LPCWSTR /*wzRollbackBoundaryId*/, | ||
| 260 | __in BOOL /*fRecommendedTransaction*/, | ||
| 261 | __inout BOOL* /*pfTransaction*/, | ||
| 262 | __inout BOOL* /*pfCancel*/ | ||
| 263 | ) | ||
| 264 | { | ||
| 265 | return S_OK; | ||
| 266 | } | ||
| 267 | |||
| 258 | virtual STDMETHODIMP OnPlanPackageBegin( | 268 | virtual STDMETHODIMP OnPlanPackageBegin( |
| 259 | __in_z LPCWSTR /*wzPackageId*/, | 269 | __in_z LPCWSTR /*wzPackageId*/, |
| 260 | __in BOOTSTRAPPER_PACKAGE_STATE /*state*/, | 270 | __in BOOTSTRAPPER_PACKAGE_STATE /*state*/, |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h index 7e89fe83..8d1227fc 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | |||
| @@ -109,6 +109,14 @@ static HRESULT WINAPI BalBaseBAFunctionsProc( | |||
| 109 | case BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE: | 109 | case BA_FUNCTIONS_MESSAGE_ONSYSTEMRESTOREPOINTCOMPLETE: |
| 110 | case BA_FUNCTIONS_MESSAGE_ONPLANNEDPACKAGE: | 110 | case BA_FUNCTIONS_MESSAGE_ONPLANNEDPACKAGE: |
| 111 | case BA_FUNCTIONS_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE: | 111 | case BA_FUNCTIONS_MESSAGE_ONPLANFORWARDCOMPATIBLEBUNDLE: |
| 112 | case BA_FUNCTIONS_MESSAGE_ONCACHEVERIFYPROGRESS: | ||
| 113 | case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYBEGIN: | ||
| 114 | case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYCOMPLETE: | ||
| 115 | case BA_FUNCTIONS_MESSAGE_ONCACHECONTAINERORPAYLOADVERIFYPROGRESS: | ||
| 116 | case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTBEGIN: | ||
| 117 | case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE: | ||
| 118 | case BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS: | ||
| 119 | case BA_FUNCTIONS_MESSAGE_ONPLANROLLBACKBOUNDARY: | ||
| 112 | hr = BalBaseBootstrapperApplicationProc((BOOTSTRAPPER_APPLICATION_MESSAGE)message, pvArgs, pvResults, pvContext); | 120 | hr = BalBaseBootstrapperApplicationProc((BOOTSTRAPPER_APPLICATION_MESSAGE)message, pvArgs, pvResults, pvContext); |
| 113 | break; | 121 | break; |
| 114 | case BA_FUNCTIONS_MESSAGE_ONTHEMELOADED: | 122 | case BA_FUNCTIONS_MESSAGE_ONTHEMELOADED: |
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h index 53fa369b..4c07ba89 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h | |||
| @@ -264,6 +264,17 @@ public: // IBootstrapperApplication | |||
| 264 | return S_OK; | 264 | return S_OK; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | virtual STDMETHODIMP OnPlanRollbackBoundary( | ||
| 268 | __in_z LPCWSTR /*wzRollbackBoundaryId*/, | ||
| 269 | __in BOOL /*fRecommendedTransaction*/, | ||
| 270 | __inout BOOL* /*pfTransaction*/, | ||
| 271 | __inout BOOL* pfCancel | ||
| 272 | ) | ||
| 273 | { | ||
| 274 | *pfCancel |= CheckCanceled(); | ||
| 275 | return S_OK; | ||
| 276 | } | ||
| 277 | |||
| 267 | virtual STDMETHODIMP OnPlanPackageBegin( | 278 | virtual STDMETHODIMP OnPlanPackageBegin( |
| 268 | __in_z LPCWSTR /*wzPackageId*/, | 279 | __in_z LPCWSTR /*wzPackageId*/, |
| 269 | __in BOOTSTRAPPER_PACKAGE_STATE /*state*/, | 280 | __in BOOTSTRAPPER_PACKAGE_STATE /*state*/, |
diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h index 69031d62..d536729f 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplicationProc.h | |||
| @@ -171,6 +171,15 @@ static HRESULT BalBaseBAProcOnPlanRelatedBundle( | |||
| 171 | return pBA->OnPlanRelatedBundle(pArgs->wzBundleId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel); | 171 | return pBA->OnPlanRelatedBundle(pArgs->wzBundleId, pArgs->recommendedState, &pResults->requestedState, &pResults->fCancel); |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | static HRESULT BalBaseBAProcOnPlanRollbackBoundary( | ||
| 175 | __in IBootstrapperApplication* pBA, | ||
| 176 | __in BA_ONPLANROLLBACKBOUNDARY_ARGS* pArgs, | ||
| 177 | __inout BA_ONPLANROLLBACKBOUNDARY_RESULTS* pResults | ||
| 178 | ) | ||
| 179 | { | ||
| 180 | return pBA->OnPlanRollbackBoundary(pArgs->wzRollbackBoundaryId, pArgs->fRecommendedTransaction, &pResults->fTransaction, &pResults->fCancel); | ||
| 181 | } | ||
| 182 | |||
| 174 | static HRESULT BalBaseBAProcOnPlanPackageBegin( | 183 | static HRESULT BalBaseBAProcOnPlanPackageBegin( |
| 175 | __in IBootstrapperApplication* pBA, | 184 | __in IBootstrapperApplication* pBA, |
| 176 | __in BA_ONPLANPACKAGEBEGIN_ARGS* pArgs, | 185 | __in BA_ONPLANPACKAGEBEGIN_ARGS* pArgs, |
| @@ -892,6 +901,9 @@ static HRESULT WINAPI BalBaseBootstrapperApplicationProc( | |||
| 892 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE: | 901 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTCOMPLETE: |
| 893 | hr = BalBaseBAProcOnCachePayloadExtractComplete(pBA, reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS*>(pvResults)); | 902 | hr = BalBaseBAProcOnCachePayloadExtractComplete(pBA, reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTCOMPLETE_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTCOMPLETE_RESULTS*>(pvResults)); |
| 894 | break; | 903 | break; |
| 904 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY: | ||
| 905 | hr = BalBaseBAProcOnPlanRollbackBoundary(pBA, reinterpret_cast<BA_ONPLANROLLBACKBOUNDARY_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANROLLBACKBOUNDARY_RESULTS*>(pvResults)); | ||
| 906 | break; | ||
| 895 | } | 907 | } |
| 896 | } | 908 | } |
| 897 | 909 | ||
diff --git a/src/api/burn/balutil/inc/IBootstrapperApplication.h b/src/api/burn/balutil/inc/IBootstrapperApplication.h index 98b88f44..51f58ec7 100644 --- a/src/api/burn/balutil/inc/IBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/IBootstrapperApplication.h | |||
| @@ -160,6 +160,14 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A | |||
| 160 | __inout BOOL* pfCancel | 160 | __inout BOOL* pfCancel |
| 161 | ) = 0; | 161 | ) = 0; |
| 162 | 162 | ||
| 163 | // OnPlanRollbackBoundary - called when the engine is planning a rollback boundary. | ||
| 164 | STDMETHOD(OnPlanRollbackBoundary)( | ||
| 165 | __in_z LPCWSTR wzRollbackBoundaryId, | ||
| 166 | __in BOOL fRecommendedTransaction, | ||
| 167 | __inout BOOL* pfTransaction, | ||
| 168 | __inout BOOL* pfCancel | ||
| 169 | ) = 0; | ||
| 170 | |||
| 163 | // OnPlanPackageBegin - called when the engine has begun getting the BA's input | 171 | // OnPlanPackageBegin - called when the engine has begun getting the BA's input |
| 164 | // for planning a package. | 172 | // for planning a package. |
| 165 | STDMETHOD(OnPlanPackageBegin)( | 173 | STDMETHOD(OnPlanPackageBegin)( |
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index 87d748cc..bbd0ff96 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
| @@ -79,6 +79,9 @@ static void LogRelatedBundles( | |||
| 79 | __in const BURN_RELATED_BUNDLES* pRelatedBundles, | 79 | __in const BURN_RELATED_BUNDLES* pRelatedBundles, |
| 80 | __in BOOL fReverse | 80 | __in BOOL fReverse |
| 81 | ); | 81 | ); |
| 82 | static void LogRollbackBoundary( | ||
| 83 | __in const BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | ||
| 84 | ); | ||
| 82 | 85 | ||
| 83 | 86 | ||
| 84 | // function definitions | 87 | // function definitions |
| @@ -2222,6 +2225,8 @@ static void LogPackages( | |||
| 2222 | __in const BOOTSTRAPPER_ACTION action | 2225 | __in const BOOTSTRAPPER_ACTION action |
| 2223 | ) | 2226 | ) |
| 2224 | { | 2227 | { |
| 2228 | BOOL fUninstalling = BOOTSTRAPPER_ACTION_UNINSTALL == action; | ||
| 2229 | |||
| 2225 | if (pUpgradeBundlePackage) | 2230 | if (pUpgradeBundlePackage) |
| 2226 | { | 2231 | { |
| 2227 | LogId(REPORT_STANDARD, MSG_PLANNED_UPGRADE_BUNDLE, pUpgradeBundlePackage->sczId, LoggingRequestStateToString(pUpgradeBundlePackage->defaultRequested), LoggingRequestStateToString(pUpgradeBundlePackage->requested), LoggingActionStateToString(pUpgradeBundlePackage->execute), LoggingActionStateToString(pUpgradeBundlePackage->rollback), LoggingDependencyActionToString(pUpgradeBundlePackage->dependencyExecute)); | 2232 | LogId(REPORT_STANDARD, MSG_PLANNED_UPGRADE_BUNDLE, pUpgradeBundlePackage->sczId, LoggingRequestStateToString(pUpgradeBundlePackage->defaultRequested), LoggingRequestStateToString(pUpgradeBundlePackage->requested), LoggingActionStateToString(pUpgradeBundlePackage->execute), LoggingActionStateToString(pUpgradeBundlePackage->rollback), LoggingDependencyActionToString(pUpgradeBundlePackage->dependencyExecute)); |
| @@ -2233,7 +2238,7 @@ static void LogPackages( | |||
| 2233 | else | 2238 | else |
| 2234 | { | 2239 | { |
| 2235 | // Display related bundles first if uninstalling. | 2240 | // Display related bundles first if uninstalling. |
| 2236 | if (BOOTSTRAPPER_ACTION_UNINSTALL == action) | 2241 | if (fUninstalling) |
| 2237 | { | 2242 | { |
| 2238 | LogRelatedBundles(pRelatedBundles, TRUE); | 2243 | LogRelatedBundles(pRelatedBundles, TRUE); |
| 2239 | } | 2244 | } |
| @@ -2241,9 +2246,18 @@ static void LogPackages( | |||
| 2241 | // Display all the packages in the log. | 2246 | // Display all the packages in the log. |
| 2242 | for (DWORD i = 0; i < pPackages->cPackages; ++i) | 2247 | for (DWORD i = 0; i < pPackages->cPackages; ++i) |
| 2243 | { | 2248 | { |
| 2244 | const DWORD iPackage = (BOOTSTRAPPER_ACTION_UNINSTALL == action) ? pPackages->cPackages - 1 - i : i; | 2249 | const DWORD iPackage = fUninstalling ? pPackages->cPackages - 1 - i : i; |
| 2245 | const BURN_PACKAGE* pPackage = &pPackages->rgPackages[iPackage]; | 2250 | const BURN_PACKAGE* pPackage = &pPackages->rgPackages[iPackage]; |
| 2246 | 2251 | ||
| 2252 | if (!fUninstalling && pPackage->pRollbackBoundaryForward) | ||
| 2253 | { | ||
| 2254 | LogRollbackBoundary(pPackage->pRollbackBoundaryForward); | ||
| 2255 | } | ||
| 2256 | else if (fUninstalling && pPackage->pRollbackBoundaryBackward) | ||
| 2257 | { | ||
| 2258 | LogRollbackBoundary(pPackage->pRollbackBoundaryBackward); | ||
| 2259 | } | ||
| 2260 | |||
| 2247 | LogId(REPORT_STANDARD, MSG_PLANNED_PACKAGE, pPackage->sczId, LoggingPackageStateToString(pPackage->currentState), LoggingRequestStateToString(pPackage->defaultRequested), LoggingRequestStateToString(pPackage->requested), LoggingActionStateToString(pPackage->execute), LoggingActionStateToString(pPackage->rollback), LoggingCacheTypeToString(pPackage->authoredCacheType), LoggingCacheTypeToString(pPackage->cacheType), LoggingBoolToString(pPackage->fPlannedCache), LoggingBoolToString(pPackage->fPlannedUncache), LoggingDependencyActionToString(pPackage->dependencyExecute), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedInstallRegistrationState), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedCacheRegistrationState)); | 2261 | LogId(REPORT_STANDARD, MSG_PLANNED_PACKAGE, pPackage->sczId, LoggingPackageStateToString(pPackage->currentState), LoggingRequestStateToString(pPackage->defaultRequested), LoggingRequestStateToString(pPackage->requested), LoggingActionStateToString(pPackage->execute), LoggingActionStateToString(pPackage->rollback), LoggingCacheTypeToString(pPackage->authoredCacheType), LoggingCacheTypeToString(pPackage->cacheType), LoggingBoolToString(pPackage->fPlannedCache), LoggingBoolToString(pPackage->fPlannedUncache), LoggingDependencyActionToString(pPackage->dependencyExecute), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedInstallRegistrationState), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedCacheRegistrationState)); |
| 2248 | 2262 | ||
| 2249 | if (BURN_PACKAGE_TYPE_MSI == pPackage->type) | 2263 | if (BURN_PACKAGE_TYPE_MSI == pPackage->type) |
| @@ -2313,3 +2327,10 @@ static void LogRelatedBundles( | |||
| 2313 | } | 2327 | } |
| 2314 | } | 2328 | } |
| 2315 | } | 2329 | } |
| 2330 | |||
| 2331 | static void LogRollbackBoundary( | ||
| 2332 | __in const BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | ||
| 2333 | ) | ||
| 2334 | { | ||
| 2335 | LogId(REPORT_STANDARD, MSG_PLANNED_ROLLBACK_BOUNDARY, pRollbackBoundary->sczId, LoggingBoolToString(pRollbackBoundary->fVital), LoggingBoolToString(pRollbackBoundary->fTransaction), LoggingBoolToString(pRollbackBoundary->fTransactionAuthored)); | ||
| 2336 | } | ||
diff --git a/src/burn/engine/engine.mc b/src/burn/engine/engine.mc index f1ecebcd..dcd18074 100644 --- a/src/burn/engine/engine.mc +++ b/src/burn/engine/engine.mc | |||
| @@ -471,6 +471,13 @@ Language=English | |||
| 471 | Planned slipstreamed patch: %1!ls!, execute: %2!hs!, rollback: %3!hs! | 471 | Planned slipstreamed patch: %1!ls!, execute: %2!hs!, rollback: %3!hs! |
| 472 | . | 472 | . |
| 473 | 473 | ||
| 474 | MessageId=222 | ||
| 475 | Severity=Success | ||
| 476 | SymbolicName=MSG_PLANNED_ROLLBACK_BOUNDARY | ||
| 477 | Language=English | ||
| 478 | Planned rollback boundary: '%1!ls!', vital: %2!hs!, transaction: %3!hs! (default: %4!hs!) | ||
| 479 | . | ||
| 480 | |||
| 474 | MessageId=299 | 481 | MessageId=299 |
| 475 | Severity=Success | 482 | Severity=Success |
| 476 | SymbolicName=MSG_PLAN_COMPLETE | 483 | SymbolicName=MSG_PLAN_COMPLETE |
diff --git a/src/burn/engine/package.cpp b/src/burn/engine/package.cpp index 0d52d575..cd871bc5 100644 --- a/src/burn/engine/package.cpp +++ b/src/burn/engine/package.cpp | |||
| @@ -70,7 +70,7 @@ extern "C" HRESULT PackagesParseFromXml( | |||
| 70 | ExitOnFailure(hr, "Failed to get @Vital."); | 70 | ExitOnFailure(hr, "Failed to get @Vital."); |
| 71 | 71 | ||
| 72 | // @Transaction | 72 | // @Transaction |
| 73 | hr = XmlGetYesNoAttribute(pixnNode, L"Transaction", &pRollbackBoundary->fTransaction); | 73 | hr = XmlGetYesNoAttribute(pixnNode, L"Transaction", &pRollbackBoundary->fTransactionAuthored); |
| 74 | ExitOnFailure(hr, "Failed to get @Transaction."); | 74 | ExitOnFailure(hr, "Failed to get @Transaction."); |
| 75 | 75 | ||
| 76 | // prepare next iteration | 76 | // prepare next iteration |
diff --git a/src/burn/engine/package.h b/src/burn/engine/package.h index f14064db..3d8233d1 100644 --- a/src/burn/engine/package.h +++ b/src/burn/engine/package.h | |||
| @@ -192,6 +192,7 @@ typedef struct _BURN_ROLLBACK_BOUNDARY | |||
| 192 | { | 192 | { |
| 193 | LPWSTR sczId; | 193 | LPWSTR sczId; |
| 194 | BOOL fVital; | 194 | BOOL fVital; |
| 195 | BOOL fTransactionAuthored; | ||
| 195 | BOOL fTransaction; | 196 | BOOL fTransaction; |
| 196 | BOOL fActiveTransaction; // only valid during Apply. | 197 | BOOL fActiveTransaction; // only valid during Apply. |
| 197 | LPWSTR sczLogPath; | 198 | LPWSTR sczLogPath; |
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index d78f2846..85d958a6 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
| @@ -59,6 +59,9 @@ static HRESULT ProcessPackage( | |||
| 59 | ); | 59 | ); |
| 60 | static HRESULT ProcessPackageRollbackBoundary( | 60 | static HRESULT ProcessPackageRollbackBoundary( |
| 61 | __in BURN_PLAN* pPlan, | 61 | __in BURN_PLAN* pPlan, |
| 62 | __in BURN_USER_EXPERIENCE* pUX, | ||
| 63 | __in BURN_LOGGING* pLog, | ||
| 64 | __in BURN_VARIABLES* pVariables, | ||
| 62 | __in_opt BURN_ROLLBACK_BOUNDARY* pEffectiveRollbackBoundary, | 65 | __in_opt BURN_ROLLBACK_BOUNDARY* pEffectiveRollbackBoundary, |
| 63 | __inout BURN_ROLLBACK_BOUNDARY** ppRollbackBoundary | 66 | __inout BURN_ROLLBACK_BOUNDARY** ppRollbackBoundary |
| 64 | ); | 67 | ); |
| @@ -901,7 +904,7 @@ static HRESULT ProcessPackage( | |||
| 901 | BURN_ROLLBACK_BOUNDARY* pEffectiveRollbackBoundary = NULL; | 904 | BURN_ROLLBACK_BOUNDARY* pEffectiveRollbackBoundary = NULL; |
| 902 | 905 | ||
| 903 | pEffectiveRollbackBoundary = (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action) ? pPackage->pRollbackBoundaryBackward : pPackage->pRollbackBoundaryForward; | 906 | pEffectiveRollbackBoundary = (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action) ? pPackage->pRollbackBoundaryBackward : pPackage->pRollbackBoundaryForward; |
| 904 | hr = ProcessPackageRollbackBoundary(pPlan, pEffectiveRollbackBoundary, ppRollbackBoundary); | 907 | hr = ProcessPackageRollbackBoundary(pPlan, pUX, pLog, pVariables, pEffectiveRollbackBoundary, ppRollbackBoundary); |
| 905 | ExitOnFailure(hr, "Failed to process package rollback boundary."); | 908 | ExitOnFailure(hr, "Failed to process package rollback boundary."); |
| 906 | 909 | ||
| 907 | if (BOOTSTRAPPER_ACTION_LAYOUT == pPlan->action) | 910 | if (BOOTSTRAPPER_ACTION_LAYOUT == pPlan->action) |
| @@ -952,6 +955,9 @@ LExit: | |||
| 952 | 955 | ||
| 953 | static HRESULT ProcessPackageRollbackBoundary( | 956 | static HRESULT ProcessPackageRollbackBoundary( |
| 954 | __in BURN_PLAN* pPlan, | 957 | __in BURN_PLAN* pPlan, |
| 958 | __in BURN_USER_EXPERIENCE* pUX, | ||
| 959 | __in BURN_LOGGING* pLog, | ||
| 960 | __in BURN_VARIABLES* pVariables, | ||
| 955 | __in_opt BURN_ROLLBACK_BOUNDARY* pEffectiveRollbackBoundary, | 961 | __in_opt BURN_ROLLBACK_BOUNDARY* pEffectiveRollbackBoundary, |
| 956 | __inout BURN_ROLLBACK_BOUNDARY** ppRollbackBoundary | 962 | __inout BURN_ROLLBACK_BOUNDARY** ppRollbackBoundary |
| 957 | ) | 963 | ) |
| @@ -969,7 +975,7 @@ static HRESULT ProcessPackageRollbackBoundary( | |||
| 969 | } | 975 | } |
| 970 | 976 | ||
| 971 | // Start new rollback boundary. | 977 | // Start new rollback boundary. |
| 972 | hr = PlanRollbackBoundaryBegin(pPlan, pEffectiveRollbackBoundary); | 978 | hr = PlanRollbackBoundaryBegin(pPlan, pUX, pLog, pVariables, pEffectiveRollbackBoundary); |
| 973 | ExitOnFailure(hr, "Failed to plan rollback boundary begin."); | 979 | ExitOnFailure(hr, "Failed to plan rollback boundary begin."); |
| 974 | 980 | ||
| 975 | *ppRollbackBoundary = pEffectiveRollbackBoundary; | 981 | *ppRollbackBoundary = pEffectiveRollbackBoundary; |
| @@ -1702,6 +1708,9 @@ LExit: | |||
| 1702 | 1708 | ||
| 1703 | extern "C" HRESULT PlanRollbackBoundaryBegin( | 1709 | extern "C" HRESULT PlanRollbackBoundaryBegin( |
| 1704 | __in BURN_PLAN* pPlan, | 1710 | __in BURN_PLAN* pPlan, |
| 1711 | __in BURN_USER_EXPERIENCE* pUX, | ||
| 1712 | __in BURN_LOGGING* /*pLog*/, | ||
| 1713 | __in BURN_VARIABLES* /*pVariables*/, | ||
| 1705 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 1714 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary |
| 1706 | ) | 1715 | ) |
| 1707 | { | 1716 | { |
| @@ -1725,9 +1734,17 @@ extern "C" HRESULT PlanRollbackBoundaryBegin( | |||
| 1725 | pExecuteAction->type = BURN_EXECUTE_ACTION_TYPE_ROLLBACK_BOUNDARY; | 1734 | pExecuteAction->type = BURN_EXECUTE_ACTION_TYPE_ROLLBACK_BOUNDARY; |
| 1726 | pExecuteAction->rollbackBoundary.pRollbackBoundary = pRollbackBoundary; | 1735 | pExecuteAction->rollbackBoundary.pRollbackBoundary = pRollbackBoundary; |
| 1727 | 1736 | ||
| 1728 | // Add begin MSI transaction to execute plan. | 1737 | hr = UserExperienceOnPlanRollbackBoundary(pUX, pRollbackBoundary->sczId, &pRollbackBoundary->fTransaction); |
| 1729 | if (pRollbackBoundary->fTransaction) | 1738 | ExitOnRootFailure(hr, "BA aborted plan rollback boundary."); |
| 1739 | |||
| 1740 | // Only use MSI transaction if authored and the BA requested it. | ||
| 1741 | if (!pRollbackBoundary->fTransactionAuthored || !pRollbackBoundary->fTransaction) | ||
| 1742 | { | ||
| 1743 | pRollbackBoundary->fTransaction = FALSE; | ||
| 1744 | } | ||
| 1745 | else | ||
| 1730 | { | 1746 | { |
| 1747 | // Add begin MSI transaction to execute plan. | ||
| 1731 | hr = PlanExecuteCheckpoint(pPlan); | 1748 | hr = PlanExecuteCheckpoint(pPlan); |
| 1732 | ExitOnFailure(hr, "Failed to append checkpoint before MSI transaction begin action."); | 1749 | ExitOnFailure(hr, "Failed to append checkpoint before MSI transaction begin action."); |
| 1733 | 1750 | ||
| @@ -1925,6 +1942,7 @@ static void ResetPlannedRollbackBoundaryState( | |||
| 1925 | ) | 1942 | ) |
| 1926 | { | 1943 | { |
| 1927 | pRollbackBoundary->fActiveTransaction = FALSE; | 1944 | pRollbackBoundary->fActiveTransaction = FALSE; |
| 1945 | pRollbackBoundary->fTransaction = pRollbackBoundary->fTransactionAuthored; | ||
| 1928 | ReleaseNullStr(pRollbackBoundary->sczLogPath); | 1946 | ReleaseNullStr(pRollbackBoundary->sczLogPath); |
| 1929 | } | 1947 | } |
| 1930 | 1948 | ||
diff --git a/src/burn/engine/plan.h b/src/burn/engine/plan.h index b148c75b..b8bb8c3d 100644 --- a/src/burn/engine/plan.h +++ b/src/burn/engine/plan.h | |||
| @@ -438,6 +438,9 @@ HRESULT PlanAppendRollbackAction( | |||
| 438 | ); | 438 | ); |
| 439 | HRESULT PlanRollbackBoundaryBegin( | 439 | HRESULT PlanRollbackBoundaryBegin( |
| 440 | __in BURN_PLAN* pPlan, | 440 | __in BURN_PLAN* pPlan, |
| 441 | __in BURN_USER_EXPERIENCE* pUX, | ||
| 442 | __in BURN_LOGGING* pLog, | ||
| 443 | __in BURN_VARIABLES* pVariables, | ||
| 441 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary | 444 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary |
| 442 | ); | 445 | ); |
| 443 | HRESULT PlanRollbackBoundaryComplete( | 446 | HRESULT PlanRollbackBoundaryComplete( |
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp index f48e60de..c974f4d4 100644 --- a/src/burn/engine/userexperience.cpp +++ b/src/burn/engine/userexperience.cpp | |||
| @@ -104,7 +104,7 @@ extern "C" HRESULT UserExperienceLoad( | |||
| 104 | args.pCommand = pCommand; | 104 | args.pCommand = pCommand; |
| 105 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; | 105 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; |
| 106 | args.pvBootstrapperEngineProcContext = pEngineContext; | 106 | args.pvBootstrapperEngineProcContext = pEngineContext; |
| 107 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 4, 27, 0); | 107 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 8, 10, 0); |
| 108 | 108 | ||
| 109 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | 109 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); |
| 110 | 110 | ||
| @@ -2056,6 +2056,36 @@ LExit: | |||
| 2056 | return hr; | 2056 | return hr; |
| 2057 | } | 2057 | } |
| 2058 | 2058 | ||
| 2059 | EXTERN_C BAAPI UserExperienceOnPlanRollbackBoundary( | ||
| 2060 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 2061 | __in_z LPCWSTR wzRollbackBoundaryId, | ||
| 2062 | __inout BOOL* pfTransaction | ||
| 2063 | ) | ||
| 2064 | { | ||
| 2065 | HRESULT hr = S_OK; | ||
| 2066 | BA_ONPLANROLLBACKBOUNDARY_ARGS args = { }; | ||
| 2067 | BA_ONPLANROLLBACKBOUNDARY_RESULTS results = { }; | ||
| 2068 | |||
| 2069 | args.cbSize = sizeof(args); | ||
| 2070 | args.wzRollbackBoundaryId = wzRollbackBoundaryId; | ||
| 2071 | args.fRecommendedTransaction = *pfTransaction; | ||
| 2072 | |||
| 2073 | results.cbSize = sizeof(results); | ||
| 2074 | results.fTransaction = *pfTransaction; | ||
| 2075 | |||
| 2076 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY, &args, &results); | ||
| 2077 | ExitOnFailure(hr, "BA OnPlanRollbackBoundary failed."); | ||
| 2078 | |||
| 2079 | if (results.fCancel) | ||
| 2080 | { | ||
| 2081 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | ||
| 2082 | } | ||
| 2083 | *pfTransaction = results.fTransaction; | ||
| 2084 | |||
| 2085 | LExit: | ||
| 2086 | return hr; | ||
| 2087 | } | ||
| 2088 | |||
| 2059 | EXTERN_C BAAPI UserExperienceOnPlanPatchTarget( | 2089 | EXTERN_C BAAPI UserExperienceOnPlanPatchTarget( |
| 2060 | __in BURN_USER_EXPERIENCE* pUserExperience, | 2090 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 2061 | __in_z LPCWSTR wzPackageId, | 2091 | __in_z LPCWSTR wzPackageId, |
diff --git a/src/burn/engine/userexperience.h b/src/burn/engine/userexperience.h index aaf69083..c2219f7e 100644 --- a/src/burn/engine/userexperience.h +++ b/src/burn/engine/userexperience.h | |||
| @@ -470,6 +470,11 @@ BAAPI UserExperienceOnPlanRelatedBundle( | |||
| 470 | __in_z LPCWSTR wzBundleId, | 470 | __in_z LPCWSTR wzBundleId, |
| 471 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState | 471 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState |
| 472 | ); | 472 | ); |
| 473 | BAAPI UserExperienceOnPlanRollbackBoundary( | ||
| 474 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 475 | __in_z LPCWSTR wzRollbackBoundaryId, | ||
| 476 | __inout BOOL *pfTransaction | ||
| 477 | ); | ||
| 473 | BAAPI UserExperienceOnPlanPatchTarget( | 478 | BAAPI UserExperienceOnPlanPatchTarget( |
| 474 | __in BURN_USER_EXPERIENCE* pUserExperience, | 479 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 475 | __in_z LPCWSTR wzPackageId, | 480 | __in_z LPCWSTR wzPackageId, |
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index bbe926f1..be2dde1f 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | |||
| @@ -186,6 +186,9 @@ static HRESULT DAPI SetVariableStringCallback( | |||
| 186 | __in BOOL fFormatted, | 186 | __in BOOL fFormatted, |
| 187 | __in_opt LPVOID pvContext | 187 | __in_opt LPVOID pvContext |
| 188 | ); | 188 | ); |
| 189 | static LPCSTR LoggingBoolToString( | ||
| 190 | __in BOOL f | ||
| 191 | ); | ||
| 189 | static LPCSTR LoggingRequestStateToString( | 192 | static LPCSTR LoggingRequestStateToString( |
| 190 | __in BOOTSTRAPPER_REQUEST_STATE requestState | 193 | __in BOOTSTRAPPER_REQUEST_STATE requestState |
| 191 | ); | 194 | ); |
| @@ -1393,6 +1396,9 @@ public: // IBootstrapperApplication | |||
| 1393 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS: | 1396 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS: |
| 1394 | OnCachePayloadExtractProgressFallback(reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS*>(pvResults)); | 1397 | OnCachePayloadExtractProgressFallback(reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTPROGRESS_ARGS*>(pvArgs), reinterpret_cast<BA_ONCACHEPAYLOADEXTRACTPROGRESS_RESULTS*>(pvResults)); |
| 1395 | break; | 1398 | break; |
| 1399 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY: | ||
| 1400 | OnPlanRollbackBoundaryFallback(reinterpret_cast<BA_ONPLANROLLBACKBOUNDARY_ARGS*>(pvArgs), reinterpret_cast<BA_ONPLANROLLBACKBOUNDARY_RESULTS*>(pvResults)); | ||
| 1401 | break; | ||
| 1396 | default: | 1402 | default: |
| 1397 | #ifdef DEBUG | 1403 | #ifdef DEBUG |
| 1398 | BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: Forwarding unknown BA message: %d", message); | 1404 | BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: Forwarding unknown BA message: %d", message); |
| @@ -1986,6 +1992,16 @@ private: // privates | |||
| 1986 | m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext); | 1992 | m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext); |
| 1987 | } | 1993 | } |
| 1988 | 1994 | ||
| 1995 | void OnPlanRollbackBoundaryFallback( | ||
| 1996 | __in BA_ONPLANROLLBACKBOUNDARY_ARGS* pArgs, | ||
| 1997 | __inout BA_ONPLANROLLBACKBOUNDARY_RESULTS* pResults | ||
| 1998 | ) | ||
| 1999 | { | ||
| 2000 | BOOL fTransaction = pResults->fTransaction; | ||
| 2001 | m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANROLLBACKBOUNDARY, pArgs, pResults, m_pvBAFunctionsProcContext); | ||
| 2002 | BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_ROLLBACK_BOUNDARY, m_hModule, pArgs->wzRollbackBoundaryId, LoggingBoolToString(fTransaction), LoggingBoolToString(pResults->fTransaction)); | ||
| 2003 | } | ||
| 2004 | |||
| 1989 | 2005 | ||
| 1990 | public: //CBalBaseBootstrapperApplication | 2006 | public: //CBalBaseBootstrapperApplication |
| 1991 | virtual STDMETHODIMP Initialize( | 2007 | virtual STDMETHODIMP Initialize( |
| @@ -4140,6 +4156,18 @@ static HRESULT DAPI SetVariableStringCallback( | |||
| 4140 | return BalSetStringVariable(wzVariable, wzValue, fFormatted); | 4156 | return BalSetStringVariable(wzVariable, wzValue, fFormatted); |
| 4141 | } | 4157 | } |
| 4142 | 4158 | ||
| 4159 | static LPCSTR LoggingBoolToString( | ||
| 4160 | __in BOOL f | ||
| 4161 | ) | ||
| 4162 | { | ||
| 4163 | if (f) | ||
| 4164 | { | ||
| 4165 | return "Yes"; | ||
| 4166 | } | ||
| 4167 | |||
| 4168 | return "No"; | ||
| 4169 | } | ||
| 4170 | |||
| 4143 | static LPCSTR LoggingRequestStateToString( | 4171 | static LPCSTR LoggingRequestStateToString( |
| 4144 | __in BOOTSTRAPPER_REQUEST_STATE requestState | 4172 | __in BOOTSTRAPPER_REQUEST_STATE requestState |
| 4145 | ) | 4173 | ) |
diff --git a/src/ext/Bal/wixstdba/wixstdba.mc b/src/ext/Bal/wixstdba/wixstdba.mc index 688b1da1..659ccd01 100644 --- a/src/ext/Bal/wixstdba/wixstdba.mc +++ b/src/ext/Bal/wixstdba/wixstdba.mc | |||
| @@ -71,3 +71,10 @@ Language=English | |||
| 71 | WIXSTDBA: Planned MSI package: %1!ls!, wixstdba requested: actionMsiProperty=%2!d!;uiLevel=%3!d!;disableExternalUiHandler=%4!hs!, bafunctions requested: actionMsiProperty=%5!d!;uiLevel=%6!d!;disableExternalUiHandler=%7!hs! | 71 | WIXSTDBA: Planned MSI package: %1!ls!, wixstdba requested: actionMsiProperty=%2!d!;uiLevel=%3!d!;disableExternalUiHandler=%4!hs!, bafunctions requested: actionMsiProperty=%5!d!;uiLevel=%6!d!;disableExternalUiHandler=%7!hs! |
| 72 | . | 72 | . |
| 73 | 73 | ||
| 74 | MessageId=8 | ||
| 75 | Severity=Success | ||
| 76 | SymbolicName=MSG_WIXSTDBA_PLANNED_ROLLBACK_BOUNDARY | ||
| 77 | Language=English | ||
| 78 | WIXSTDBA: Planned rollback boundary: %1!ls!, wixstdba requested transaction: %2!hs!, bafunctions requested transaction: %3!hs! | ||
| 79 | . | ||
| 80 | |||
diff --git a/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp index 55e81d46..c3ac6a79 100644 --- a/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp +++ b/src/libs/dutil/test/DUtilUnitTest/DUtilTests.cpp | |||
| @@ -11,7 +11,7 @@ namespace DutilTests | |||
| 11 | public ref class DUtil | 11 | public ref class DUtil |
| 12 | { | 12 | { |
| 13 | public: | 13 | public: |
| 14 | [Fact] | 14 | [Fact(Skip = "Flaky")] |
| 15 | void DUtilTraceErrorSourceFiltersOnTraceLevel() | 15 | void DUtilTraceErrorSourceFiltersOnTraceLevel() |
| 16 | { | 16 | { |
| 17 | DutilInitialize(&DutilTestTraceError); | 17 | DutilInitialize(&DutilTestTraceError); |
