Fix OnExecuteMsiMessage to return chosen result.
Bob Arnson committed
Aug 14, 2022 at 17:24 UTC
6573eb709147ec52455d03fde60ad567bc79d1bd
1 file changed
+19
-5
src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp
+19
-5
@@ -832,12 +832,16 @@ public: // IBootstrapperApplication
832
__in DWORD dwCode,
833
__in_z LPCWSTR wzError,
834
__in DWORD dwUIHint,
835
- __in DWORD /*cData*/,
836
- __in_ecount_z_opt(cData) LPCWSTR* /*rgwzData*/,
837
- __in int /*nRecommendation*/,
835
+ __in DWORD cData,
836
+ __in_ecount_z_opt(cData) LPCWSTR* rgwzData,
837
+ __in int nRecommendation,
838
__inout int* pResult
839
)
840
{
841
+#ifdef DEBUG
842
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnError() - package: %ls, code: %d, ui hint: %d, message: %ls", wzPackageId, dwCode, dwUIHint, wzError);
843
+#endif
844
+
845
HRESULT hr = S_OK;
846
int nResult = *pResult;
847
LPWSTR sczError = NULL;
@@ -887,8 +891,14 @@ public: // IBootstrapperApplication
891
}
892
893
ReleaseStr(sczError);
894
+
895
*pResult = nResult;
891
- return hr;
896
+
897
+#ifdef DEBUG
898
+ BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnError() - package: %ls, hr: 0x%0x, result: %d", wzPackageId, hr, nResult);
899
+#endif
900
+
901
+ return FAILED(hr) ? hr : __super::OnError(errorType, wzPackageId, dwCode, wzError, dwUIHint, cData, rgwzData, nRecommendation, pResult);
902
}
903
904
@@ -906,12 +916,16 @@ public: // IBootstrapperApplication
916
#ifdef DEBUG
917
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "WIXSTDBA: OnExecuteMsiMessage() - package: %ls, message: %ls", wzPackageId, wzMessage);
918
#endif
919
+
920
if (BOOTSTRAPPER_DISPLAY_FULL == m_command.display && (INSTALLMESSAGE_WARNING == messageType || INSTALLMESSAGE_USER == messageType))
921
{
922
if (!m_fShowingInternalUiThisPackage)
923
{
924
int nResult = ::MessageBoxW(m_hWnd, wzMessage, m_pTheme->sczCaption, dwUIHint);
914
- return nResult;
925
+
926
+ *pResult = nResult;
927
+
928
+ return __super::OnExecuteMsiMessage(wzPackageId, messageType, dwUIHint, wzMessage, cData, rgwzData, nRecommendation, pResult);
929
}
930
}
931