diff options
Diffstat (limited to 'src/engine/cache.cpp')
-rw-r--r-- | src/engine/cache.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
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: | |||
391 | 391 | ||
392 | extern "C" HRESULT CacheFindLocalSource( | 392 | extern "C" HRESULT CacheFindLocalSource( |
393 | __in_z LPCWSTR wzSourcePath, | 393 | __in_z LPCWSTR wzSourcePath, |
394 | __in_z LPCWSTR wzDestinationPath, | ||
394 | __in BURN_VARIABLES* pVariables, | 395 | __in BURN_VARIABLES* pVariables, |
395 | __out BOOL* pfFound, | 396 | __out BOOL* pfFound, |
396 | __out_z LPWSTR* psczSourceFullPath | 397 | __out_z LPWSTR* psczSourceFullPath |
@@ -403,7 +404,7 @@ extern "C" HRESULT CacheFindLocalSource( | |||
403 | LPWSTR sczLastSourceFolder = NULL; | 404 | LPWSTR sczLastSourceFolder = NULL; |
404 | LPWSTR sczLayoutPath = NULL; | 405 | LPWSTR sczLayoutPath = NULL; |
405 | LPWSTR sczLayoutFolder = NULL; | 406 | LPWSTR sczLayoutFolder = NULL; |
406 | LPCWSTR rgwzSearchPaths[3] = { }; | 407 | LPCWSTR rgwzSearchPaths[4] = { }; |
407 | DWORD cSearchPaths = 0; | 408 | DWORD cSearchPaths = 0; |
408 | 409 | ||
409 | // If the source path provided is a full path, obviously that is where we should be looking. | 410 | // 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( | |||
414 | } | 415 | } |
415 | else | 416 | else |
416 | { | 417 | { |
418 | // Use the destination path first. | ||
419 | rgwzSearchPaths[0] = wzDestinationPath; | ||
420 | cSearchPaths = 1; | ||
421 | |||
417 | // If we're not running from cache or we couldn't get the last source, use | 422 | // If we're not running from cache or we couldn't get the last source, use |
418 | // the source path location first. In the case where we are in the bundle's | 423 | // the source path location. In the case where we are in the bundle's |
419 | // package cache and couldn't find a last used source we unfortunately will | 424 | // package cache and couldn't find a last used source we unfortunately will |
420 | // be picking the package cache path which isn't likely to have what we are | 425 | // be picking the package cache path which isn't likely to have what we are |
421 | // looking for. | 426 | // looking for. |
@@ -428,8 +433,8 @@ extern "C" HRESULT CacheFindLocalSource( | |||
428 | hr = PathConcat(sczSourceProcessFolder, wzSourcePath, &sczCurrentPath); | 433 | hr = PathConcat(sczSourceProcessFolder, wzSourcePath, &sczCurrentPath); |
429 | ExitOnFailure(hr, "Failed to combine last source with source."); | 434 | ExitOnFailure(hr, "Failed to combine last source with source."); |
430 | 435 | ||
431 | rgwzSearchPaths[0] = sczCurrentPath; | 436 | rgwzSearchPaths[cSearchPaths] = sczCurrentPath; |
432 | cSearchPaths = 1; | 437 | ++cSearchPaths; |
433 | } | 438 | } |
434 | 439 | ||
435 | // If we have a last used source and it does not duplicate the existing search path, | 440 | // If we have a last used source and it does not duplicate the existing search path, |
@@ -439,7 +444,7 @@ extern "C" HRESULT CacheFindLocalSource( | |||
439 | hr = PathConcat(sczLastSourceFolder, wzSourcePath, &sczLastSourcePath); | 444 | hr = PathConcat(sczLastSourceFolder, wzSourcePath, &sczLastSourcePath); |
440 | ExitOnFailure(hr, "Failed to combine last source with source."); | 445 | ExitOnFailure(hr, "Failed to combine last source with source."); |
441 | 446 | ||
442 | if (0 == cSearchPaths || CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, rgwzSearchPaths[0], -1, sczLastSourcePath, -1)) | 447 | if (1 == cSearchPaths || CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, rgwzSearchPaths[1], -1, sczLastSourcePath, -1)) |
443 | { | 448 | { |
444 | rgwzSearchPaths[cSearchPaths] = sczLastSourcePath; | 449 | rgwzSearchPaths[cSearchPaths] = sczLastSourcePath; |
445 | ++cSearchPaths; | 450 | ++cSearchPaths; |