diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-08-03 15:42:40 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-08-04 10:03:57 -0500 |
| commit | c50e82c27b7f33b9024a04ec7ad7d4301bc7f7ca (patch) | |
| tree | 1340ef3bf598ec362bf4dcf135e65343db3e7d14 /src/burn/engine/engine.cpp | |
| parent | 94b8260fc5c1abc199f8d6145f3db4e2de490463 (diff) | |
| download | wix-c50e82c27b7f33b9024a04ec7ad7d4301bc7f7ca.tar.gz wix-c50e82c27b7f33b9024a04ec7ad7d4301bc7f7ca.tar.bz2 wix-c50e82c27b7f33b9024a04ec7ad7d4301bc7f7ca.zip | |
Create separate log file for clean room.
Diffstat (limited to 'src/burn/engine/engine.cpp')
| -rw-r--r-- | src/burn/engine/engine.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index 99471e0d..8b4a296b 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp | |||
| @@ -95,6 +95,7 @@ extern "C" HRESULT EngineRun( | |||
| 95 | SYSTEM_INFO si = { }; | 95 | SYSTEM_INFO si = { }; |
| 96 | RTL_OSVERSIONINFOEXW ovix = { }; | 96 | RTL_OSVERSIONINFOEXW ovix = { }; |
| 97 | LPWSTR sczExePath = NULL; | 97 | LPWSTR sczExePath = NULL; |
| 98 | BOOL fRunUntrusted = FALSE; | ||
| 98 | BOOL fRunNormal = FALSE; | 99 | BOOL fRunNormal = FALSE; |
| 99 | BOOL fRestart = FALSE; | 100 | BOOL fRestart = FALSE; |
| 100 | 101 | ||
| @@ -194,6 +195,8 @@ extern "C" HRESULT EngineRun( | |||
| 194 | switch (engineState.internalCommand.mode) | 195 | switch (engineState.internalCommand.mode) |
| 195 | { | 196 | { |
| 196 | case BURN_MODE_UNTRUSTED: | 197 | case BURN_MODE_UNTRUSTED: |
| 198 | fRunUntrusted = TRUE; | ||
| 199 | |||
| 197 | hr = RunUntrusted(&engineState); | 200 | hr = RunUntrusted(&engineState); |
| 198 | ExitOnFailure(hr, "Failed to run untrusted mode."); | 201 | ExitOnFailure(hr, "Failed to run untrusted mode."); |
| 199 | break; | 202 | break; |
| @@ -296,6 +299,10 @@ LExit: | |||
| 296 | LogId(REPORT_STANDARD, MSG_RESTARTING); | 299 | LogId(REPORT_STANDARD, MSG_RESTARTING); |
| 297 | } | 300 | } |
| 298 | } | 301 | } |
| 302 | else if (fRunUntrusted) | ||
| 303 | { | ||
| 304 | LogId(REPORT_STANDARD, MSG_EXITING_CLEAN_ROOM, FAILED(hr) ? (int)hr : *pdwExitCode); | ||
| 305 | } | ||
| 299 | 306 | ||
| 300 | if (fLogInitialized) | 307 | if (fLogInitialized) |
| 301 | { | 308 | { |
| @@ -425,6 +432,10 @@ static HRESULT RunUntrusted( | |||
| 425 | HANDLE hFileSelf = NULL; | 432 | HANDLE hFileSelf = NULL; |
| 426 | HANDLE hProcess = NULL; | 433 | HANDLE hProcess = NULL; |
| 427 | 434 | ||
| 435 | // Initialize logging. | ||
| 436 | hr = LoggingOpen(&pEngineState->log, &pEngineState->internalCommand, &pEngineState->command, &pEngineState->variables, pEngineState->registration.sczDisplayName); | ||
| 437 | ExitOnFailure(hr, "Failed to open clean room log."); | ||
| 438 | |||
| 428 | hr = PathForCurrentProcess(&sczCurrentProcessPath, NULL); | 439 | hr = PathForCurrentProcess(&sczCurrentProcessPath, NULL); |
| 429 | ExitOnFailure(hr, "Failed to get path for current process."); | 440 | ExitOnFailure(hr, "Failed to get path for current process."); |
| 430 | 441 | ||
| @@ -480,6 +491,12 @@ static HRESULT RunUntrusted( | |||
| 480 | ExitOnFailure(hr, "Failed to wait for clean room process: %ls", wzCleanRoomBundlePath); | 491 | ExitOnFailure(hr, "Failed to wait for clean room process: %ls", wzCleanRoomBundlePath); |
| 481 | 492 | ||
| 482 | LExit: | 493 | LExit: |
| 494 | // If the splash screen is still around, close it. | ||
| 495 | if (::IsWindow(pEngineState->command.hwndSplashScreen)) | ||
| 496 | { | ||
| 497 | ::PostMessageW(pEngineState->command.hwndSplashScreen, WM_CLOSE, 0, 0); | ||
| 498 | } | ||
| 499 | |||
| 483 | ReleaseHandle(pi.hThread); | 500 | ReleaseHandle(pi.hThread); |
| 484 | ReleaseFileHandle(hFileSelf); | 501 | ReleaseFileHandle(hFileSelf); |
| 485 | ReleaseFileHandle(hFileAttached); | 502 | ReleaseFileHandle(hFileAttached); |
