From 0042e3d4554a0d92e1da6141854b0f1aafa07d5b Mon Sep 17 00:00:00 2001 From: Nir Bar Date: Wed, 11 Aug 2021 15:37:34 -0500 Subject: Allow BA to opt out of MSI transaction. --- .../WixStandardBootstrapperApplication.cpp | 28 ++++++++++++++++++++++ src/ext/Bal/wixstdba/wixstdba.mc | 7 ++++++ 2 files changed, 35 insertions(+) (limited to 'src/ext/Bal') diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index bbe926f1..be2dde1f 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp @@ -186,6 +186,9 @@ static HRESULT DAPI SetVariableStringCallback( __in BOOL fFormatted, __in_opt LPVOID pvContext ); +static LPCSTR LoggingBoolToString( + __in BOOL f + ); static LPCSTR LoggingRequestStateToString( __in BOOTSTRAPPER_REQUEST_STATE requestState ); @@ -1393,6 +1396,9 @@ public: // IBootstrapperApplication case BOOTSTRAPPER_APPLICATION_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS: OnCachePayloadExtractProgressFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); break; + case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANROLLBACKBOUNDARY: + OnPlanRollbackBoundaryFallback(reinterpret_cast(pvArgs), reinterpret_cast(pvResults)); + break; default: #ifdef DEBUG BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: Forwarding unknown BA message: %d", message); @@ -1986,6 +1992,16 @@ private: // privates m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONCACHEPAYLOADEXTRACTPROGRESS, pArgs, pResults, m_pvBAFunctionsProcContext); } + void OnPlanRollbackBoundaryFallback( + __in BA_ONPLANROLLBACKBOUNDARY_ARGS* pArgs, + __inout BA_ONPLANROLLBACKBOUNDARY_RESULTS* pResults + ) + { + BOOL fTransaction = pResults->fTransaction; + m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONPLANROLLBACKBOUNDARY, pArgs, pResults, m_pvBAFunctionsProcContext); + BalLogId(BOOTSTRAPPER_LOG_LEVEL_STANDARD, MSG_WIXSTDBA_PLANNED_ROLLBACK_BOUNDARY, m_hModule, pArgs->wzRollbackBoundaryId, LoggingBoolToString(fTransaction), LoggingBoolToString(pResults->fTransaction)); + } + public: //CBalBaseBootstrapperApplication virtual STDMETHODIMP Initialize( @@ -4140,6 +4156,18 @@ static HRESULT DAPI SetVariableStringCallback( return BalSetStringVariable(wzVariable, wzValue, fFormatted); } +static LPCSTR LoggingBoolToString( + __in BOOL f + ) +{ + if (f) + { + return "Yes"; + } + + return "No"; +} + static LPCSTR LoggingRequestStateToString( __in BOOTSTRAPPER_REQUEST_STATE requestState ) diff --git a/src/ext/Bal/wixstdba/wixstdba.mc b/src/ext/Bal/wixstdba/wixstdba.mc index 688b1da1..659ccd01 100644 --- a/src/ext/Bal/wixstdba/wixstdba.mc +++ b/src/ext/Bal/wixstdba/wixstdba.mc @@ -71,3 +71,10 @@ Language=English WIXSTDBA: Planned MSI package: %1!ls!, wixstdba requested: actionMsiProperty=%2!d!;uiLevel=%3!d!;disableExternalUiHandler=%4!hs!, bafunctions requested: actionMsiProperty=%5!d!;uiLevel=%6!d!;disableExternalUiHandler=%7!hs! . +MessageId=8 +Severity=Success +SymbolicName=MSG_WIXSTDBA_PLANNED_ROLLBACK_BOUNDARY +Language=English +WIXSTDBA: Planned rollback boundary: %1!ls!, wixstdba requested transaction: %2!hs!, bafunctions requested transaction: %3!hs! +. + -- cgit v1.2.3-55-g6feb