aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/engine.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-08-03 15:43:30 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-08-04 10:03:57 -0500
commit75d645c6aec0df0e02bd3aaf2fe2571d83316d4c (patch)
tree6ff150562e5c2a208de8fa38aadac4e72b8ab6a7 /src/burn/engine/engine.cpp
parent25ae58ec05bec0b97038e98eec9582209c1f9583 (diff)
downloadwix-75d645c6aec0df0e02bd3aaf2fe2571d83316d4c.tar.gz
wix-75d645c6aec0df0e02bd3aaf2fe2571d83316d4c.tar.bz2
wix-75d645c6aec0df0e02bd3aaf2fe2571d83316d4c.zip
Remove unelevation code since clean room changes made it unreachable.
Diffstat (limited to 'src/burn/engine/engine.cpp')
-rw-r--r--src/burn/engine/engine.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp
index 8b4a296b..0ce2de6d 100644
--- a/src/burn/engine/engine.cpp
+++ b/src/burn/engine/engine.cpp
@@ -462,31 +462,19 @@ static HRESULT RunUntrusted(
462 hr = CoreCreateCleanRoomCommandLine(&sczParameters, pEngineState, wzCleanRoomBundlePath, sczCurrentProcessPath, &hFileAttached, &hFileSelf); 462 hr = CoreCreateCleanRoomCommandLine(&sczParameters, pEngineState, wzCleanRoomBundlePath, sczCurrentProcessPath, &hFileAttached, &hFileSelf);
463 ExitOnFailure(hr, "Failed to create clean room command-line."); 463 ExitOnFailure(hr, "Failed to create clean room command-line.");
464 464
465#ifdef ENABLE_UNELEVATE 465 hr = StrAllocFormattedSecure(&sczFullCommandLine, L"\"%ls\" %ls", wzCleanRoomBundlePath, sczParameters);
466 // TODO: Pass file handle to unelevated process if this ever gets reenabled. 466 ExitOnFailure(hr, "Failed to allocate full command-line.");
467 if (!pEngineState->internalCommand.fDisableUnelevate)
468 {
469 // Try to launch unelevated and if that fails for any reason, we'll launch our process normally (even though that may make it elevated).
470 hr = ProcExecuteAsInteractiveUser(wzCleanRoomBundlePath, sczParameters, &hProcess);
471 }
472#endif
473 467
474 if (!hProcess) 468 si.cb = sizeof(si);
469 si.wShowWindow = static_cast<WORD>(pEngineState->command.nCmdShow);
470 if (!::CreateProcessW(wzCleanRoomBundlePath, sczFullCommandLine, NULL, NULL, TRUE, 0, 0, NULL, &si, &pi))
475 { 471 {
476 hr = StrAllocFormattedSecure(&sczFullCommandLine, L"\"%ls\" %ls", wzCleanRoomBundlePath, sczParameters); 472 ExitWithLastError(hr, "Failed to launch clean room process: %ls", sczFullCommandLine);
477 ExitOnFailure(hr, "Failed to allocate full command-line.");
478
479 si.cb = sizeof(si);
480 si.wShowWindow = static_cast<WORD>(pEngineState->command.nCmdShow);
481 if (!::CreateProcessW(wzCleanRoomBundlePath, sczFullCommandLine, NULL, NULL, TRUE, 0, 0, NULL, &si, &pi))
482 {
483 ExitWithLastError(hr, "Failed to launch clean room process: %ls", sczFullCommandLine);
484 }
485
486 hProcess = pi.hProcess;
487 pi.hProcess = NULL;
488 } 473 }
489 474
475 hProcess = pi.hProcess;
476 pi.hProcess = NULL;
477
490 hr = ProcWaitForCompletion(hProcess, INFINITE, &pEngineState->userExperience.dwExitCode); 478 hr = ProcWaitForCompletion(hProcess, INFINITE, &pEngineState->userExperience.dwExitCode);
491 ExitOnFailure(hr, "Failed to wait for clean room process: %ls", wzCleanRoomBundlePath); 479 ExitOnFailure(hr, "Failed to wait for clean room process: %ls", wzCleanRoomBundlePath);
492 480