From 0d3d54992104288e9ee0c834d0b96e8502fd2d42 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 11 Jan 2024 18:26:20 -0800 Subject: Move the BootstrapperApplication out of proc --- src/burn/engine/cache.cpp | 46 +++++----------------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) (limited to 'src/burn/engine/cache.cpp') diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index 251cd24b..c0ac3ecd 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp @@ -2,7 +2,6 @@ #include "precomp.h" -static const LPCWSTR BUNDLE_CLEAN_ROOM_WORKING_FOLDER_NAME = L".cr"; static const LPCWSTR BUNDLE_WORKING_FOLDER_NAME = L".be"; static const LPCWSTR UNVERIFIED_CACHE_FOLDER_NAME = L".unverified"; static const LPCWSTR PACKAGE_CACHE_FOLDER_NAME = L"Package Cache"; @@ -242,8 +241,7 @@ LExit: extern "C" HRESULT CacheInitializeSources( __in BURN_CACHE* pCache, __in BURN_REGISTRATION* pRegistration, - __in BURN_VARIABLES* pVariables, - __in BURN_ENGINE_COMMAND* pInternalCommand + __in BURN_VARIABLES* pVariables ) { Assert(!pCache->fInitializedCacheSources); @@ -255,7 +253,6 @@ extern "C" HRESULT CacheInitializeSources( LPWSTR sczOriginalSource = NULL; LPWSTR sczOriginalSourceFolder = NULL; BOOL fPathEqual = FALSE; - LPCWSTR wzSourceProcessPath = pInternalCommand->sczSourceProcessPath; hr = PathForCurrentProcess(&sczCurrentPath, NULL); ExitOnFailure(hr, "Failed to get current process path."); @@ -272,15 +269,7 @@ extern "C" HRESULT CacheInitializeSources( pCache->fRunningFromCache = fPathEqual; - // If a source process path was not provided (e.g. we are not being - // run in a clean room) then use the current process path as the - // source process path. - if (!wzSourceProcessPath) - { - wzSourceProcessPath = sczCurrentPath; - } - - hr = PathGetDirectory(wzSourceProcessPath, &pCache->sczSourceProcessFolder); + hr = PathGetDirectory(sczCurrentPath, &pCache->sczSourceProcessFolder); ExitOnFailure(hr, "Failed to initialize cache source folder."); // If we're not running from the cache, ensure the original source is set. @@ -288,15 +277,14 @@ extern "C" HRESULT CacheInitializeSources( { // If the original source has not been set already then set it where the bundle is // running from right now. This value will be persisted and we'll use it when launched - // from the clean room or package cache since none of our packages will be relative to - // those locations. + // from the package cache since none of our packages will be relative to those locations. hr = VariableGetString(pVariables, BURN_BUNDLE_ORIGINAL_SOURCE, &sczOriginalSource); if (E_NOTFOUND == hr) { - hr = VariableSetString(pVariables, BURN_BUNDLE_ORIGINAL_SOURCE, wzSourceProcessPath, FALSE, FALSE); + hr = VariableSetString(pVariables, BURN_BUNDLE_ORIGINAL_SOURCE, sczCurrentPath, FALSE, FALSE); ExitOnFailure(hr, "Failed to set original source variable."); - hr = StrAllocString(&sczOriginalSource, wzSourceProcessPath, 0); + hr = StrAllocString(&sczOriginalSource, sczCurrentPath, 0); ExitOnFailure(hr, "Failed to copy current path to original source."); } @@ -899,30 +887,6 @@ extern "C" HRESULT CachePreparePackage( return hr; } -extern "C" HRESULT CacheBundleToCleanRoom( - __in BURN_CACHE* pCache, - __in BURN_SECTION* pSection, - __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath - ) -{ - HRESULT hr = S_OK; - LPWSTR sczSourcePath = NULL; - LPWSTR wzExecutableName = NULL; - - hr = PathForCurrentProcess(&sczSourcePath, NULL); - ExitOnFailure(hr, "Failed to get current path for process to cache to clean room."); - - wzExecutableName = PathFile(sczSourcePath); - - hr = CopyEngineToWorkingFolder(pCache, sczSourcePath, BUNDLE_CLEAN_ROOM_WORKING_FOLDER_NAME, wzExecutableName, pSection, psczCleanRoomBundlePath); - ExitOnFailure(hr, "Failed to cache bundle to clean room."); - -LExit: - ReleaseStr(sczSourcePath); - - return hr; -} - extern "C" HRESULT CacheBundleToWorkingDirectory( __in BURN_CACHE* pCache, __in_z LPCWSTR wzExecutableName, -- cgit v1.2.3-55-g6feb