From 992ca1b24e981fa42eab8cbd8e170819deb34ea7 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 1 Jul 2020 21:38:54 +1000 Subject: Update wixstdba to show theme load errors. --- src/wixstdba/wixstdba.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src') diff --git a/src/wixstdba/wixstdba.cpp b/src/wixstdba/wixstdba.cpp index 727c8cb0..a96f1738 100644 --- a/src/wixstdba/wixstdba.cpp +++ b/src/wixstdba/wixstdba.cpp @@ -5,6 +5,16 @@ static HINSTANCE vhInstance = NULL; static IBootstrapperApplication* vpApplication = NULL; +static void CALLBACK WixstdbaTraceError( + __in_z LPCSTR szFile, + __in int iLine, + __in REPORT_LEVEL rl, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ); + extern "C" BOOL WINAPI DllMain( IN HINSTANCE hInstance, IN DWORD dwReason, @@ -35,6 +45,8 @@ extern "C" HRESULT WINAPI BootstrapperApplicationCreate( HRESULT hr = S_OK; IBootstrapperEngine* pEngine = NULL; + DutilInitialize(&WixstdbaTraceError); + hr = BalInitializeFromCreateArgs(pArgs, &pEngine); ExitOnFailure(hr, "Failed to initialize Bal."); @@ -52,6 +64,7 @@ extern "C" void WINAPI BootstrapperApplicationDestroy() { ReleaseNullObject(vpApplication); BalUninitialize(); + DutilUninitialize(); } @@ -64,6 +77,8 @@ extern "C" HRESULT WINAPI DncPrereqBootstrapperApplicationCreate( { HRESULT hr = S_OK; + DutilInitialize(&WixstdbaTraceError); + BalInitialize(pEngine); hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); @@ -78,6 +93,7 @@ extern "C" void WINAPI DncPrereqBootstrapperApplicationDestroy() { ReleaseNullObject(vpApplication); BalUninitialize(); + DutilUninitialize(); } @@ -90,6 +106,8 @@ extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate( { HRESULT hr = S_OK; + DutilInitialize(&WixstdbaTraceError); + BalInitialize(pEngine); hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); @@ -104,4 +122,23 @@ extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy() { ReleaseNullObject(vpApplication); BalUninitialize(); + DutilUninitialize(); +} + +static void CALLBACK WixstdbaTraceError( + __in_z LPCSTR /*szFile*/, + __in int /*iLine*/, + __in REPORT_LEVEL /*rl*/, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ) +{ + // BalLogError currently uses the Exit... macros, + // so if expanding the scope need to ensure this doesn't get called recursively. + if (DUTIL_SOURCE_THMUTIL == source) + { + BalLogErrorArgs(hrError, szFormat, args); + } } -- cgit v1.2.3-55-g6feb