diff options
Diffstat (limited to 'src/api/burn/WixToolset.Mba.Core')
4 files changed, 74 insertions, 0 deletions
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs index f277425e..b08e66c0 100644 --- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs | |||
@@ -271,6 +271,9 @@ namespace WixToolset.Mba.Core | |||
271 | /// <inheritdoc/> | 271 | /// <inheritdoc/> |
272 | public event EventHandler<SetUpdateCompleteEventArgs> SetUpdateComplete; | 272 | public event EventHandler<SetUpdateCompleteEventArgs> SetUpdateComplete; |
273 | 273 | ||
274 | /// <inheritdoc/> | ||
275 | public event EventHandler<PlanRestoreRelatedBundleEventArgs> PlanRestoreRelatedBundle; | ||
276 | |||
274 | /// <summary> | 277 | /// <summary> |
275 | /// Entry point that is called when the bootstrapper application is ready to run. | 278 | /// Entry point that is called when the bootstrapper application is ready to run. |
276 | /// </summary> | 279 | /// </summary> |
@@ -1321,6 +1324,19 @@ namespace WixToolset.Mba.Core | |||
1321 | } | 1324 | } |
1322 | } | 1325 | } |
1323 | 1326 | ||
1327 | /// <summary> | ||
1328 | /// Called by the engine, raises the <see cref="PlanRestoreRelatedBundle"/> event. | ||
1329 | /// </summary> | ||
1330 | /// <param name="args">Additional arguments for this event.</param> | ||
1331 | protected virtual void OnPlanRestoreRelatedBundle(PlanRestoreRelatedBundleEventArgs args) | ||
1332 | { | ||
1333 | EventHandler<PlanRestoreRelatedBundleEventArgs> handler = this.PlanRestoreRelatedBundle; | ||
1334 | if (null != handler) | ||
1335 | { | ||
1336 | handler(this, args); | ||
1337 | } | ||
1338 | } | ||
1339 | |||
1324 | #region IBootstrapperApplication Members | 1340 | #region IBootstrapperApplication Members |
1325 | 1341 | ||
1326 | int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults, IntPtr pvContext) | 1342 | int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults, IntPtr pvContext) |
@@ -2042,6 +2058,16 @@ namespace WixToolset.Mba.Core | |||
2042 | return args.HResult; | 2058 | return args.HResult; |
2043 | } | 2059 | } |
2044 | 2060 | ||
2061 | int IBootstrapperApplication.OnPlanRestoreRelatedBundle(string wzBundleId, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel) | ||
2062 | { | ||
2063 | PlanRestoreRelatedBundleEventArgs args = new PlanRestoreRelatedBundleEventArgs(wzBundleId, recommendedState, pRequestedState, fCancel); | ||
2064 | this.OnPlanRestoreRelatedBundle(args); | ||
2065 | |||
2066 | pRequestedState = args.State; | ||
2067 | fCancel = args.Cancel; | ||
2068 | return args.HResult; | ||
2069 | } | ||
2070 | |||
2045 | #endregion | 2071 | #endregion |
2046 | } | 2072 | } |
2047 | } | 2073 | } |
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs index d4d70651..2e1e1be3 100644 --- a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs +++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs | |||
@@ -2402,4 +2402,35 @@ namespace WixToolset.Mba.Core | |||
2402 | /// </summary> | 2402 | /// </summary> |
2403 | public string NewPackageId { get; private set; } | 2403 | public string NewPackageId { get; private set; } |
2404 | } | 2404 | } |
2405 | |||
2406 | /// <summary> | ||
2407 | /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRestoreRelatedBundle"/> | ||
2408 | /// </summary> | ||
2409 | [Serializable] | ||
2410 | public class PlanRestoreRelatedBundleEventArgs : CancellableHResultEventArgs | ||
2411 | { | ||
2412 | /// <summary /> | ||
2413 | public PlanRestoreRelatedBundleEventArgs(string bundleId, RequestState recommendedState, RequestState state, bool cancelRecommendation) | ||
2414 | : base(cancelRecommendation) | ||
2415 | { | ||
2416 | this.BundleId = bundleId; | ||
2417 | this.RecommendedState = recommendedState; | ||
2418 | this.State = state; | ||
2419 | } | ||
2420 | |||
2421 | /// <summary> | ||
2422 | /// Gets the identity of the bundle to plan for. | ||
2423 | /// </summary> | ||
2424 | public string BundleId { get; private set; } | ||
2425 | |||
2426 | /// <summary> | ||
2427 | /// Gets the recommended requested state for the bundle. | ||
2428 | /// </summary> | ||
2429 | public RequestState RecommendedState { get; private set; } | ||
2430 | |||
2431 | /// <summary> | ||
2432 | /// Gets or sets the requested state for the bundle. | ||
2433 | /// </summary> | ||
2434 | public RequestState State { get; set; } | ||
2435 | } | ||
2405 | } | 2436 | } |
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs index 05f96106..4fbe5e18 100644 --- a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs | |||
@@ -1136,6 +1136,18 @@ namespace WixToolset.Mba.Core | |||
1136 | [MarshalAs(UnmanagedType.LPWStr)] string wzPreviousPackageId, | 1136 | [MarshalAs(UnmanagedType.LPWStr)] string wzPreviousPackageId, |
1137 | [MarshalAs(UnmanagedType.LPWStr)] string wzNewPackageId | 1137 | [MarshalAs(UnmanagedType.LPWStr)] string wzNewPackageId |
1138 | ); | 1138 | ); |
1139 | |||
1140 | /// <summary> | ||
1141 | /// See <see cref="IDefaultBootstrapperApplication.PlanRestoreRelatedBundle"/>. | ||
1142 | /// </summary> | ||
1143 | [PreserveSig] | ||
1144 | [return: MarshalAs(UnmanagedType.I4)] | ||
1145 | int OnPlanRestoreRelatedBundle( | ||
1146 | [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId, | ||
1147 | [MarshalAs(UnmanagedType.U4)] RequestState recommendedState, | ||
1148 | [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState, | ||
1149 | [MarshalAs(UnmanagedType.Bool)] ref bool fCancel | ||
1150 | ); | ||
1139 | } | 1151 | } |
1140 | 1152 | ||
1141 | /// <summary> | 1153 | /// <summary> |
diff --git a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs index ce06408e..c237cb9d 100644 --- a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs | |||
@@ -334,6 +334,11 @@ namespace WixToolset.Mba.Core | |||
334 | event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle; | 334 | event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle; |
335 | 335 | ||
336 | /// <summary> | 336 | /// <summary> |
337 | /// Fired when the engine has begun planning an upgrade related bundle for restoring in case of failure. | ||
338 | /// </summary> | ||
339 | event EventHandler<PlanRestoreRelatedBundleEventArgs> PlanRestoreRelatedBundle; | ||
340 | |||
341 | /// <summary> | ||
337 | /// Fired when the engine is planning a rollback boundary. | 342 | /// Fired when the engine is planning a rollback boundary. |
338 | /// </summary> | 343 | /// </summary> |
339 | event EventHandler<PlanRollbackBoundaryEventArgs> PlanRollbackBoundary; | 344 | event EventHandler<PlanRollbackBoundaryEventArgs> PlanRollbackBoundary; |