From 50e24e9cf2084b6cb67b5d8fc509163061408bb6 Mon Sep 17 00:00:00 2001 From: Nir Bar Date: Tue, 6 Dec 2022 13:22:41 +0200 Subject: Use MSI transaction end result to detect whether reboot is needed --- .../balutil/inc/BalBaseBootstrapperApplication.h | 32 ++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h') diff --git a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h index 58cc0673..c8b80d13 100644 --- a/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h +++ b/src/api/burn/balutil/inc/BalBaseBootstrapperApplication.h @@ -197,7 +197,7 @@ public: // IBootstrapperApplication __in LPCWSTR /*wzVersion*/, __in BOOTSTRAPPER_RELATED_OPERATION /*operation*/, __inout BOOL* pfCancel - ) + ) { *pfCancel |= CheckCanceled(); return S_OK; @@ -902,10 +902,21 @@ public: // IBootstrapperApplication virtual STDMETHODIMP OnCommitMsiTransactionComplete( __in_z LPCWSTR /*wzTransactionId*/, - __in HRESULT /*hrStatus*/ + __in HRESULT /*hrStatus*/, + __in BOOTSTRAPPER_APPLY_RESTART /*restart*/, + __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION /*recommendation*/, + __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* /*pAction*/ ) { - return S_OK; + HRESULT hr = S_OK; + + if (CheckCanceled()) + { + ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); + } + + LExit: + return hr; } virtual STDMETHODIMP OnRollbackMsiTransactionBegin( @@ -917,10 +928,21 @@ public: // IBootstrapperApplication virtual STDMETHODIMP OnRollbackMsiTransactionComplete( __in_z LPCWSTR /*wzTransactionId*/, - __in HRESULT /*hrStatus*/ + __in HRESULT /*hrStatus*/, + __in BOOTSTRAPPER_APPLY_RESTART /*restart*/, + __in BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION /*recommendation*/, + __inout BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION* /*pAction*/ ) { - return S_OK; + HRESULT hr = S_OK; + + if (CheckCanceled()) + { + ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT)); + } + + LExit: + return hr; } virtual STDMETHODIMP OnPauseAutomaticUpdatesBegin( -- cgit v1.2.3-55-g6feb