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 --- src/libs/dutil/WixToolset.DUtil/inc/wiutil.h | 3 ++- src/libs/dutil/WixToolset.DUtil/wiutil.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/libs') diff --git a/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h index 0ddcd893..71f40e8a 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/wiutil.h @@ -392,7 +392,8 @@ HRESULT DAPI WiuBeginTransaction( HRESULT DAPI WiuEndTransaction( __in DWORD dwTransactionState, __in DWORD dwLogMode, - __in_z LPCWSTR szLogPath + __in_z LPCWSTR szLogPath, + __out WIU_RESTART *pRestart ); BOOL DAPI WiuIsMsiTransactionSupported( ); diff --git a/src/libs/dutil/WixToolset.DUtil/wiutil.cpp b/src/libs/dutil/WixToolset.DUtil/wiutil.cpp index 4ed0e2c5..dac57a3d 100644 --- a/src/libs/dutil/WixToolset.DUtil/wiutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/wiutil.cpp @@ -317,7 +317,7 @@ extern "C" HRESULT DAPI WiuGetComponentPath( } // If the actual path length is greater than or equal to the original buffer - // allocate a larger buffer and get the path again, just in case we are + // allocate a larger buffer and get the path again, just in case we are // missing any part of the path. if (cchCompare <= cch) { @@ -369,7 +369,7 @@ extern "C" HRESULT DAPI WiuLocateComponent( } // If the actual path length is greater than or equal to the original buffer - // allocate a larger buffer and get the path again, just in case we are + // allocate a larger buffer and get the path again, just in case we are // missing any part of the path. if (cchCompare <= cch) { @@ -993,7 +993,8 @@ LExit: extern "C" HRESULT DAPI WiuEndTransaction( __in DWORD dwTransactionState, __in DWORD dwLogMode, - __in_z LPCWSTR szLogPath + __in_z LPCWSTR szLogPath, + __out WIU_RESTART *pRestart ) { HRESULT hr = S_OK; @@ -1008,6 +1009,7 @@ extern "C" HRESULT DAPI WiuEndTransaction( WiuExitOnFailure(hr, "Failed to enable logging for MSI transaction"); er = vpfnMsiEndTransaction(dwTransactionState); + er = CheckForRestartErrorCode(er, pRestart); WiuExitOnWin32Error(er, hr, "Failed to end transaction."); LExit: -- cgit v1.2.3-55-g6feb