| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 2 | |
| 3 | #include "precomp.h" |
| 4 | |
| 5 | static void CALLBACK WixstdbaTraceError( |
| 6 | __in_z LPCSTR szFile, |
| 7 | __in int iLine, |
| 8 | __in REPORT_LEVEL rl, |
| 9 | __in UINT source, |
| 10 | __in HRESULT hrError, |
| 11 | __in_z __format_string LPCSTR szFormat, |
| 12 | __in va_list args |
| 13 | ); |
| 14 | |
| 15 | EXTERN_C int WINAPI wWinMain( |
| 16 | __in HINSTANCE hInstance, |
| 17 | __in_opt HINSTANCE /* hPrevInstance */, |
| 18 | __in_z_opt LPWSTR /*lpCmdLine*/, |
| 19 | __in int /*nCmdShow*/ |
| 20 | ) |
| 21 | { |
| 22 | HRESULT hr = S_OK; |
| 23 | IBootstrapperApplication* pApplication = NULL; |
| 24 | |
| 25 | DutilInitialize(&WixstdbaTraceError); |
| 26 | |
| 27 | hr = CreateWixStandardBootstrapperApplication(hInstance, &pApplication); |
| 28 | ExitOnFailure(hr, "Failed to create WiX standard bootstrapper application."); |
| 29 | |
| 30 | hr = BootstrapperApplicationRun(pApplication); |
| 31 | ExitOnFailure(hr, "Failed to run WiX standard bootstrapper application."); |
| 32 | |
| 33 | LExit: |
| 34 | ReleaseObject(pApplication); |
| 35 | |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | static void CALLBACK WixstdbaTraceError( |
| 40 | __in_z LPCSTR /*szFile*/, |
| 41 | __in int /*iLine*/, |
| 42 | __in REPORT_LEVEL /*rl*/, |
| 43 | __in UINT source, |
| 44 | __in HRESULT hrError, |
| 45 | __in_z __format_string LPCSTR szFormat, |
| 46 | __in va_list args |
| 47 | ) |
| 48 | { |
| 49 | // BalLogError currently uses the Exit... macros, |
| 50 | // so if expanding the scope need to ensure this doesn't get called recursively. |
| 51 | if (DUTIL_SOURCE_THMUTIL == source) |
| 52 | { |
| 53 | BalLogErrorArgs(hrError, szFormat, args); |
| 54 | } |
| 55 | } |