From fc30db9fa3aa1d25a6ef078452864673caa67ec5 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 10 Dec 2021 11:42:44 -0600 Subject: Add BA events for setting the update bundle. Fixes #6410 --- .../WixToolset.Mba.Core/BootstrapperApplication.cs | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs') diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs index 0520463f..a78bf43f 100644 --- a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs @@ -253,6 +253,12 @@ namespace WixToolset.Mba.Core /// public event EventHandler CachePayloadExtractComplete; + /// + public event EventHandler SetUpdateBegin; + + /// + public event EventHandler SetUpdateComplete; + /// /// Entry point that is called when the bootstrapper application is ready to run. /// @@ -1225,6 +1231,32 @@ namespace WixToolset.Mba.Core } } + /// + /// Called by the engine, raises the event. + /// + /// + protected virtual void OnSetUpdateBegin(SetUpdateBeginEventArgs args) + { + EventHandler handler = this.SetUpdateBegin; + if (null != handler) + { + handler(this, args); + } + } + + /// + /// Called by the engine, raises the event. + /// + /// + protected virtual void OnSetUpdateComplete(SetUpdateCompleteEventArgs args) + { + EventHandler handler = this.SetUpdateComplete; + if (null != handler) + { + handler(this, args); + } + } + #region IBootstrapperApplication Members int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults, IntPtr pvContext) @@ -1895,6 +1927,22 @@ namespace WixToolset.Mba.Core return args.HResult; } + int IBootstrapperApplication.OnSetUpdateBegin() + { + SetUpdateBeginEventArgs args = new SetUpdateBeginEventArgs(); + this.OnSetUpdateBegin(args); + + return args.HResult; + } + + int IBootstrapperApplication.OnSetUpdateComplete(int hrStatus, string wzPreviousPackageId, string wzNewPackageId) + { + SetUpdateCompleteEventArgs args = new SetUpdateCompleteEventArgs(hrStatus, wzPreviousPackageId, wzNewPackageId); + this.OnSetUpdateComplete(args); + + return args.HResult; + } + #endregion } } -- cgit v1.2.3-55-g6feb