From 90cdf39e6e6b7d676ca33bee031fa2b865bb5fbd Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 16 Apr 2021 10:09:26 -0500 Subject: Don't plan payloads. Contributes to #3640 and #5253 --- src/engine/cache.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/engine/cache.cpp') diff --git a/src/engine/cache.cpp b/src/engine/cache.cpp index 46c2650a..6ddbfb50 100644 --- a/src/engine/cache.cpp +++ b/src/engine/cache.cpp @@ -391,6 +391,7 @@ LExit: extern "C" HRESULT CacheFindLocalSource( __in_z LPCWSTR wzSourcePath, + __in_z LPCWSTR wzDestinationPath, __in BURN_VARIABLES* pVariables, __out BOOL* pfFound, __out_z LPWSTR* psczSourceFullPath @@ -403,7 +404,7 @@ extern "C" HRESULT CacheFindLocalSource( LPWSTR sczLastSourceFolder = NULL; LPWSTR sczLayoutPath = NULL; LPWSTR sczLayoutFolder = NULL; - LPCWSTR rgwzSearchPaths[3] = { }; + LPCWSTR rgwzSearchPaths[4] = { }; DWORD cSearchPaths = 0; // If the source path provided is a full path, obviously that is where we should be looking. @@ -414,8 +415,12 @@ extern "C" HRESULT CacheFindLocalSource( } else { + // Use the destination path first. + rgwzSearchPaths[0] = wzDestinationPath; + cSearchPaths = 1; + // If we're not running from cache or we couldn't get the last source, use - // the source path location first. In the case where we are in the bundle's + // the source path location. In the case where we are in the bundle's // package cache and couldn't find a last used source we unfortunately will // be picking the package cache path which isn't likely to have what we are // looking for. @@ -428,8 +433,8 @@ extern "C" HRESULT CacheFindLocalSource( hr = PathConcat(sczSourceProcessFolder, wzSourcePath, &sczCurrentPath); ExitOnFailure(hr, "Failed to combine last source with source."); - rgwzSearchPaths[0] = sczCurrentPath; - cSearchPaths = 1; + rgwzSearchPaths[cSearchPaths] = sczCurrentPath; + ++cSearchPaths; } // If we have a last used source and it does not duplicate the existing search path, @@ -439,7 +444,7 @@ extern "C" HRESULT CacheFindLocalSource( hr = PathConcat(sczLastSourceFolder, wzSourcePath, &sczLastSourcePath); ExitOnFailure(hr, "Failed to combine last source with source."); - if (0 == cSearchPaths || CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, rgwzSearchPaths[0], -1, sczLastSourcePath, -1)) + if (1 == cSearchPaths || CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, rgwzSearchPaths[1], -1, sczLastSourcePath, -1)) { rgwzSearchPaths[cSearchPaths] = sczLastSourcePath; ++cSearchPaths; -- cgit v1.2.3-55-g6feb