summaryrefslogtreecommitdiff
path: root/src/burn/engine/core.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2025-02-11 05:21:34 -0800
committerRob Mensching <rob@firegiant.com>2025-02-11 15:49:33 -0800
commitf2e9af96142439ebfdbc1e884335bb8874f8a427 (patch)
treef3ffd15660a7041d1f70d793e2b2200ccbe42af5 /src/burn/engine/core.cpp
parent81fb512834c65b0a8f99c3a266879c476e382875 (diff)
downloadwix-f2e9af96142439ebfdbc1e884335bb8874f8a427.tar.gz
wix-f2e9af96142439ebfdbc1e884335bb8874f8a427.tar.bz2
wix-f2e9af96142439ebfdbc1e884335bb8874f8a427.zip
Harden Burn's BootstrapperApplication and elevated engine extraction
Fixes 8914
Diffstat (limited to 'src/burn/engine/core.cpp')
-rw-r--r--src/burn/engine/core.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp
index 3fe9b586..b20f7f0c 100644
--- a/src/burn/engine/core.cpp
+++ b/src/burn/engine/core.cpp
@@ -586,11 +586,8 @@ extern "C" HRESULT CoreElevate(
586 while (INVALID_HANDLE_VALUE == pEngineState->companionConnection.hPipe) 586 while (INVALID_HANDLE_VALUE == pEngineState->companionConnection.hPipe)
587 { 587 {
588 // If the elevated companion pipe isn't created yet, let's make that happen. 588 // If the elevated companion pipe isn't created yet, let's make that happen.
589 if (!pEngineState->sczBundleEngineWorkingPath) 589 hr = CacheBundleToWorkingDirectory(pEngineState->internalCommand.fInitiallyElevated, &pEngineState->cache, pEngineState->registration.sczExecutableName, &pEngineState->section);
590 { 590 ExitOnFailure(hr, "Failed to cache engine to working directory.");
591 hr = CacheBundleToWorkingDirectory(pEngineState->internalCommand.fInitiallyElevated, &pEngineState->cache, pEngineState->registration.sczExecutableName, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath);
592 ExitOnFailure(hr, "Failed to cache engine to working directory.");
593 }
594 591
595 hr = ElevationElevate(pEngineState, reason, hwndParent); 592 hr = ElevationElevate(pEngineState, reason, hwndParent);
596 if (E_SUSPECTED_AV_INTERFERENCE == hr && 1 > cAVRetryAttempts) 593 if (E_SUSPECTED_AV_INTERFERENCE == hr && 1 > cAVRetryAttempts)
@@ -695,11 +692,8 @@ extern "C" HRESULT CoreApply(
695 ::InitializeCriticalSection(&applyContext.csApply); 692 ::InitializeCriticalSection(&applyContext.csApply);
696 693
697 // Ensure the engine is cached to the working path. 694 // Ensure the engine is cached to the working path.
698 if (!pEngineState->sczBundleEngineWorkingPath) 695 hr = CacheBundleToWorkingDirectory(pEngineState->internalCommand.fInitiallyElevated, &pEngineState->cache, pEngineState->registration.sczExecutableName, &pEngineState->section);
699 { 696 ExitOnFailure(hr, "Failed to cache engine to working directory.");
700 hr = CacheBundleToWorkingDirectory(pEngineState->internalCommand.fInitiallyElevated, &pEngineState->cache, pEngineState->registration.sczExecutableName, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath);
701 ExitOnFailure(hr, "Failed to cache engine to working directory.");
702 }
703 697
704 // Elevate. 698 // Elevate.
705 if (pEngineState->plan.fPerMachine) 699 if (pEngineState->plan.fPerMachine)