diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-06-08 11:21:53 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-06-09 13:47:53 -0500 |
| commit | d47c73dbcd0a314cf3346b9b1294063ed4a124c4 (patch) | |
| tree | 8ad3f401edd856ed7aaebba0306ee6d8972f2d13 /src/burn/engine/core.cpp | |
| parent | 881a6c9bd0c3b3134277605824dd5a9ceaaf176d (diff) | |
| download | wix-d47c73dbcd0a314cf3346b9b1294063ed4a124c4.tar.gz wix-d47c73dbcd0a314cf3346b9b1294063ed4a124c4.tar.bz2 wix-d47c73dbcd0a314cf3346b9b1294063ed4a124c4.zip | |
Show Burn splash screen earlier.
Make the initial Burn process show the splash screen, and show it before parsing the manifest.
Fixes half of #5300
Diffstat (limited to 'src/burn/engine/core.cpp')
| -rw-r--r-- | src/burn/engine/core.cpp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index dc976eb4..e7e8e48d 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
| @@ -1060,7 +1060,7 @@ extern "C" HRESULT CoreAppendFileHandleAttachedToCommandLine( | |||
| 1060 | ExitWithLastError(hr, "Failed to duplicate file handle for attached container."); | 1060 | ExitWithLastError(hr, "Failed to duplicate file handle for attached container."); |
| 1061 | } | 1061 | } |
| 1062 | 1062 | ||
| 1063 | hr = StrAllocFormattedSecure(psczCommandLine, L"%ls -%ls=%Iu", *psczCommandLine, BURN_COMMANDLINE_SWITCH_FILEHANDLE_ATTACHED, reinterpret_cast<size_t>(hExecutableFile)); | 1063 | hr = StrAllocConcatFormattedSecure(psczCommandLine, L" -%ls=%Iu", BURN_COMMANDLINE_SWITCH_FILEHANDLE_ATTACHED, reinterpret_cast<size_t>(hExecutableFile)); |
| 1064 | ExitOnFailure(hr, "Failed to append the file handle to the command line."); | 1064 | ExitOnFailure(hr, "Failed to append the file handle to the command line."); |
| 1065 | 1065 | ||
| 1066 | *phExecutableFile = hExecutableFile; | 1066 | *phExecutableFile = hExecutableFile; |
| @@ -1088,12 +1088,12 @@ extern "C" HRESULT CoreAppendFileHandleSelfToCommandLine( | |||
| 1088 | hExecutableFile = ::CreateFileW(wzExecutablePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, &securityAttributes, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); | 1088 | hExecutableFile = ::CreateFileW(wzExecutablePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, &securityAttributes, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); |
| 1089 | if (INVALID_HANDLE_VALUE != hExecutableFile) | 1089 | if (INVALID_HANDLE_VALUE != hExecutableFile) |
| 1090 | { | 1090 | { |
| 1091 | hr = StrAllocFormattedSecure(psczCommandLine, L"%ls -%ls=%Iu", *psczCommandLine, BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF, reinterpret_cast<size_t>(hExecutableFile)); | 1091 | hr = StrAllocConcatFormattedSecure(psczCommandLine, L" -%ls=%Iu", BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF, reinterpret_cast<size_t>(hExecutableFile)); |
| 1092 | ExitOnFailure(hr, "Failed to append the file handle to the command line."); | 1092 | ExitOnFailure(hr, "Failed to append the file handle to the command line."); |
| 1093 | 1093 | ||
| 1094 | if (psczObfuscatedCommandLine) | 1094 | if (psczObfuscatedCommandLine) |
| 1095 | { | 1095 | { |
| 1096 | hr = StrAllocFormatted(psczObfuscatedCommandLine, L"%ls -%ls=%Iu", *psczObfuscatedCommandLine, BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF, reinterpret_cast<size_t>(hExecutableFile)); | 1096 | hr = StrAllocConcatFormatted(psczObfuscatedCommandLine, L" -%ls=%Iu", BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF, reinterpret_cast<size_t>(hExecutableFile)); |
| 1097 | ExitOnFailure(hr, "Failed to append the file handle to the obfuscated command line."); | 1097 | ExitOnFailure(hr, "Failed to append the file handle to the obfuscated command line."); |
| 1098 | } | 1098 | } |
| 1099 | 1099 | ||
| @@ -1107,6 +1107,23 @@ LExit: | |||
| 1107 | return hr; | 1107 | return hr; |
| 1108 | } | 1108 | } |
| 1109 | 1109 | ||
| 1110 | extern "C" HRESULT CoreAppendSplashScreenWindowToCommandLine( | ||
| 1111 | __in_opt HWND hwndSplashScreen, | ||
| 1112 | __deref_inout_z LPWSTR* psczCommandLine | ||
| 1113 | ) | ||
| 1114 | { | ||
| 1115 | HRESULT hr = S_OK; | ||
| 1116 | |||
| 1117 | if (hwndSplashScreen) | ||
| 1118 | { | ||
| 1119 | hr = StrAllocConcatFormattedSecure(psczCommandLine, L" -%ls=%Iu", BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN, reinterpret_cast<size_t>(hwndSplashScreen)); | ||
| 1120 | ExitOnFailure(hr, "Failed to append the splash screen window to the command line."); | ||
| 1121 | } | ||
| 1122 | |||
| 1123 | LExit: | ||
| 1124 | return hr; | ||
| 1125 | } | ||
| 1126 | |||
| 1110 | extern "C" void CoreCleanup( | 1127 | extern "C" void CoreCleanup( |
| 1111 | __in BURN_ENGINE_STATE* pEngineState | 1128 | __in BURN_ENGINE_STATE* pEngineState |
| 1112 | ) | 1129 | ) |
| @@ -1571,6 +1588,28 @@ extern "C" HRESULT CoreParseCommandLine( | |||
| 1571 | } | 1588 | } |
| 1572 | } | 1589 | } |
| 1573 | } | 1590 | } |
| 1591 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], lstrlenW(BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN), BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN, lstrlenW(BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN))) | ||
| 1592 | { | ||
| 1593 | LPCWSTR wzParam = &argv[i][2 + lstrlenW(BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN)]; | ||
| 1594 | if (L'=' != wzParam[-1] || L'\0' == wzParam[0]) | ||
| 1595 | { | ||
| 1596 | fInvalidCommandLine = TRUE; | ||
| 1597 | TraceLog(E_INVALIDARG, "Missing required parameter for switch: %ls", BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN); | ||
| 1598 | } | ||
| 1599 | else | ||
| 1600 | { | ||
| 1601 | hr = StrStringToUInt64(wzParam, 0, &qw); | ||
| 1602 | if (FAILED(hr)) | ||
| 1603 | { | ||
| 1604 | TraceLog(hr, "Failed to parse splash screen window: '%ls'", wzParam); | ||
| 1605 | hr = S_OK; | ||
| 1606 | } | ||
| 1607 | else | ||
| 1608 | { | ||
| 1609 | pCommand->hwndSplashScreen = (HWND)qw; | ||
| 1610 | } | ||
| 1611 | } | ||
| 1612 | } | ||
| 1574 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], lstrlenW(BURN_COMMANDLINE_SWITCH_PREFIX), BURN_COMMANDLINE_SWITCH_PREFIX, lstrlenW(BURN_COMMANDLINE_SWITCH_PREFIX))) | 1613 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], lstrlenW(BURN_COMMANDLINE_SWITCH_PREFIX), BURN_COMMANDLINE_SWITCH_PREFIX, lstrlenW(BURN_COMMANDLINE_SWITCH_PREFIX))) |
| 1575 | { | 1614 | { |
| 1576 | // Skip (but log) any other private burn switches we don't recognize, so that | 1615 | // Skip (but log) any other private burn switches we don't recognize, so that |
