From 5f4829e678c9c5cd5e581b0075cfa4a6b263c66e Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 2 Mar 2021 15:11:58 -0600 Subject: Integrate OnUnregisterBegin changes in Burn headers. --- src/WixToolset.Mba.Core/BootstrapperApplication.cs | 6 ++--- src/WixToolset.Mba.Core/EventArgs.cs | 28 +++++++++++++++------- .../IBootstrapperApplication.cs | 6 +++-- .../IDefaultBootstrapperApplication.cs | 4 ++-- src/balutil/balutil.vcxproj | 8 +++---- src/balutil/inc/BalBaseBAFunctions.h | 3 ++- src/balutil/inc/BalBaseBootstrapperApplication.h | 4 ++-- .../inc/BalBaseBootstrapperApplicationProc.h | 4 ++-- src/balutil/inc/IBootstrapperApplication.h | 3 ++- src/balutil/packages.config | 4 ++-- src/bextutil/bextutil.vcxproj | 8 +++---- src/bextutil/packages.config | 4 ++-- src/mbanative/mbanative.vcxproj | 8 +++---- src/mbanative/packages.config | 4 ++-- src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj | 8 +++---- src/test/BalUtilUnitTest/packages.config | 4 ++-- src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj | 8 +++---- src/test/BextUtilUnitTest/packages.config | 4 ++-- 18 files changed, 66 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/WixToolset.Mba.Core/BootstrapperApplication.cs index 43e69e81..1812c80b 100644 --- a/src/WixToolset.Mba.Core/BootstrapperApplication.cs +++ b/src/WixToolset.Mba.Core/BootstrapperApplication.cs @@ -1529,12 +1529,12 @@ namespace WixToolset.Mba.Core return args.HResult; } - int IBootstrapperApplication.OnUnregisterBegin(ref bool fCancel) + int IBootstrapperApplication.OnUnregisterBegin(bool fKeepRegistration, ref bool fForceKeepRegistration) { - UnregisterBeginEventArgs args = new UnregisterBeginEventArgs(fCancel); + UnregisterBeginEventArgs args = new UnregisterBeginEventArgs(fKeepRegistration, fForceKeepRegistration); this.OnUnregisterBegin(args); - fCancel = args.Cancel; + fForceKeepRegistration = args.ForceKeepRegistration; return args.HResult; } diff --git a/src/WixToolset.Mba.Core/EventArgs.cs b/src/WixToolset.Mba.Core/EventArgs.cs index 953e31ee..56705769 100644 --- a/src/WixToolset.Mba.Core/EventArgs.cs +++ b/src/WixToolset.Mba.Core/EventArgs.cs @@ -1187,31 +1187,41 @@ namespace WixToolset.Mba.Core } /// - /// Additional arguments used when the engine has begun removing the registration for the location and visibility of the bundle. + /// Event arguments for /// [Serializable] - public class UnregisterBeginEventArgs : CancellableHResultEventArgs + public class UnregisterBeginEventArgs : HResultEventArgs { /// - /// Creates a new instance of the class. + /// /// - /// The recommendation from the engine. - public UnregisterBeginEventArgs(bool cancelRecommendation) - : base(cancelRecommendation) + /// + /// + public UnregisterBeginEventArgs(bool keepRegistration, bool forceKeepRegistration) { } + + /// + /// Indicates whether the engine will uninstall the bundle. + /// + public bool ForceKeepRegistration { get; set; } + + /// + /// If is FALSE, then this can be set to TRUE to make the engine keep the bundle installed. + /// + public bool KeepRegistration { get; private set; } } /// - /// Additional arguments used when the engine has completed removing the registration for the location and visibility of the bundle. + /// Event arguments for /// [Serializable] public class UnregisterCompleteEventArgs : StatusEventArgs { /// - /// Creates a new instance of the class. + /// /// - /// The return code of the operation. + /// public UnregisterCompleteEventArgs(int hrStatus) : base(hrStatus) { diff --git a/src/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/WixToolset.Mba.Core/IBootstrapperApplication.cs index 7ff243d2..4812c038 100644 --- a/src/WixToolset.Mba.Core/IBootstrapperApplication.cs +++ b/src/WixToolset.Mba.Core/IBootstrapperApplication.cs @@ -822,12 +822,14 @@ namespace WixToolset.Mba.Core /// /// See . /// - /// + /// + /// /// [PreserveSig] [return: MarshalAs(UnmanagedType.I4)] int OnUnregisterBegin( - [MarshalAs(UnmanagedType.Bool)] ref bool fCancel + [MarshalAs(UnmanagedType.Bool)] bool fKeepRegistration, + [MarshalAs(UnmanagedType.Bool)] ref bool fForceKeepRegistration ); /// diff --git a/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs b/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs index d0518049..5803a26a 100644 --- a/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs +++ b/src/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs @@ -332,12 +332,12 @@ namespace WixToolset.Mba.Core event EventHandler SystemShutdown; /// - /// Fired when the engine has begun removing the registration for the location and visibility of the bundle. + /// Fired when the engine unregisters the bundle. /// event EventHandler UnregisterBegin; /// - /// Fired when the engine has completed removing the registration for the location and visibility of the bundle. + /// Fired when the engine unregistration is complete. /// event EventHandler UnregisterComplete; } diff --git a/src/balutil/balutil.vcxproj b/src/balutil/balutil.vcxproj index 578586e8..1c9a2372 100644 --- a/src/balutil/balutil.vcxproj +++ b/src/balutil/balutil.vcxproj @@ -2,8 +2,8 @@ - - + + @@ -98,8 +98,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/balutil/inc/BalBaseBAFunctions.h b/src/balutil/inc/BalBaseBAFunctions.h index 7699b8ff..55ed8cbe 100644 --- a/src/balutil/inc/BalBaseBAFunctions.h +++ b/src/balutil/inc/BalBaseBAFunctions.h @@ -548,7 +548,8 @@ public: // IBootstrapperApplication } virtual STDMETHODIMP OnUnregisterBegin( - __inout BOOL* /*pfCancel*/ + __in BOOL /*fKeepRegistration*/, + __inout BOOL* /*pfForceKeepRegistration*/ ) { return S_OK; diff --git a/src/balutil/inc/BalBaseBootstrapperApplication.h b/src/balutil/inc/BalBaseBootstrapperApplication.h index 59e57de1..ff1d07fd 100644 --- a/src/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/balutil/inc/BalBaseBootstrapperApplication.h @@ -719,10 +719,10 @@ public: // IBootstrapperApplication } virtual STDMETHODIMP OnUnregisterBegin( - __inout BOOL* pfCancel + __in BOOL /*fKeepRegistration*/, + __inout BOOL* /*pfForceKeepRegistration*/ ) { - *pfCancel |= CheckCanceled(); return S_OK; } diff --git a/src/balutil/inc/BalBaseBootstrapperApplicationProc.h b/src/balutil/inc/BalBaseBootstrapperApplicationProc.h index 6ce8710d..d971a2eb 100644 --- a/src/balutil/inc/BalBaseBootstrapperApplicationProc.h +++ b/src/balutil/inc/BalBaseBootstrapperApplicationProc.h @@ -443,11 +443,11 @@ static HRESULT BalBaseBAProcOnExecuteComplete( static HRESULT BalBaseBAProcOnUnregisterBegin( __in IBootstrapperApplication* pBA, - __in BA_ONUNREGISTERBEGIN_ARGS* /*pArgs*/, + __in BA_ONUNREGISTERBEGIN_ARGS* pArgs, __inout BA_ONUNREGISTERBEGIN_RESULTS* pResults ) { - return pBA->OnUnregisterBegin(&pResults->fCancel); + return pBA->OnUnregisterBegin(pArgs->fKeepRegistration, &pResults->fForceKeepRegistration); } static HRESULT BalBaseBAProcOnUnregisterComplete( diff --git a/src/balutil/inc/IBootstrapperApplication.h b/src/balutil/inc/IBootstrapperApplication.h index 7d710b26..01d0bb8a 100644 --- a/src/balutil/inc/IBootstrapperApplication.h +++ b/src/balutil/inc/IBootstrapperApplication.h @@ -465,7 +465,8 @@ DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-A // OnUnregisterBegin - called when the engine unregisters the bundle. // STDMETHOD(OnUnregisterBegin)( - __inout BOOL* pfCancel + __in BOOL fKeepRegistration, + __inout BOOL* pfForceKeepRegistration ) = 0; // OnUnregisterComplete - called when the engine unregistration is complete. diff --git a/src/balutil/packages.config b/src/balutil/packages.config index 68970a7e..1ac5d2ac 100644 --- a/src/balutil/packages.config +++ b/src/balutil/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/src/bextutil/bextutil.vcxproj b/src/bextutil/bextutil.vcxproj index 44393f94..99edfaae 100644 --- a/src/bextutil/bextutil.vcxproj +++ b/src/bextutil/bextutil.vcxproj @@ -2,8 +2,8 @@ - - + + @@ -87,8 +87,8 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + diff --git a/src/bextutil/packages.config b/src/bextutil/packages.config index 68970a7e..1ac5d2ac 100644 --- a/src/bextutil/packages.config +++ b/src/bextutil/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file diff --git a/src/mbanative/mbanative.vcxproj b/src/mbanative/mbanative.vcxproj index eaf95157..0c67b548 100644 --- a/src/mbanative/mbanative.vcxproj +++ b/src/mbanative/mbanative.vcxproj @@ -5,8 +5,8 @@ - - + + @@ -96,7 +96,7 @@ - - + + \ No newline at end of file diff --git a/src/mbanative/packages.config b/src/mbanative/packages.config index e9fcafcd..52a8333b 100644 --- a/src/mbanative/packages.config +++ b/src/mbanative/packages.config @@ -4,6 +4,6 @@ - - + + \ No newline at end of file diff --git a/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj b/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj index aad361c1..a901712e 100644 --- a/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj +++ b/src/test/BalUtilUnitTest/BalUtilUnitTest.vcxproj @@ -4,8 +4,8 @@ - - + + Debug @@ -69,7 +69,7 @@ - - + + diff --git a/src/test/BalUtilUnitTest/packages.config b/src/test/BalUtilUnitTest/packages.config index 9e1a6a0e..768cc4cc 100644 --- a/src/test/BalUtilUnitTest/packages.config +++ b/src/test/BalUtilUnitTest/packages.config @@ -10,6 +10,6 @@ - - + + \ No newline at end of file diff --git a/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj b/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj index 566a2abd..22e84e9a 100644 --- a/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj +++ b/src/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj @@ -4,8 +4,8 @@ - - + + Debug @@ -68,7 +68,7 @@ - - + + diff --git a/src/test/BextUtilUnitTest/packages.config b/src/test/BextUtilUnitTest/packages.config index 9e1a6a0e..768cc4cc 100644 --- a/src/test/BextUtilUnitTest/packages.config +++ b/src/test/BextUtilUnitTest/packages.config @@ -10,6 +10,6 @@ - - + + \ No newline at end of file -- cgit v1.2.3-55-g6feb