From a470bbc209dff298dbf86a29393d6a2a8b768dc8 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 15 Sep 2022 12:17:47 -0500 Subject: Ignore cache bundle failure if it already exists in the package cache. Fixes 6848 --- src/burn/engine/cache.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/burn/engine/cache.cpp') diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index 01237162..251cd24b 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp @@ -1000,8 +1000,6 @@ extern "C" HRESULT CacheCompleteBundle( BOOL fPathEqual = FALSE; LPWSTR sczTargetDirectory = NULL; LPWSTR sczTargetPath = NULL; - LPWSTR sczSourceDirectory = NULL; - LPWSTR sczPayloadSourcePath = NULL; hr = CreateCompletedPath(pCache, fPerMachine, wzBundleId, NULL, &sczTargetDirectory); ExitOnFailure(hr, "Failed to create completed cache path for bundle."); @@ -1028,18 +1026,18 @@ extern "C" HRESULT CacheCompleteBundle( FileRemoveFromPendingRename(sczTargetPath); // best effort to ensure bundle is not deleted from cache post restart. hr = FileEnsureCopyWithRetry(wzSourceBundlePath, sczTargetPath, TRUE, FILE_OPERATION_RETRY_COUNT, FILE_OPERATION_RETRY_WAIT); + if (FAILED(hr) && FileExistsEx(sczTargetPath, NULL)) + { + LogId(REPORT_WARNING, MSG_IGNORING_CACHE_BUNDLE_FAILURE, hr); + ExitFunction1(hr = S_OK); + } ExitOnFailure(hr, "Failed to cache bundle from: '%ls' to '%ls'", wzSourceBundlePath, sczTargetPath); // Reset the path permissions in the cache. hr = ResetPathPermissions(fPerMachine, sczTargetPath); ExitOnFailure(hr, "Failed to reset permissions on cached bundle: '%ls'", sczTargetPath); - hr = PathGetDirectory(wzSourceBundlePath, &sczSourceDirectory); - ExitOnFailure(hr, "Failed to get directory from engine working path: %ls", wzSourceBundlePath); - LExit: - ReleaseStr(sczPayloadSourcePath); - ReleaseStr(sczSourceDirectory); ReleaseStr(sczTargetPath); ReleaseStr(sczTargetDirectory); -- cgit v1.2.3-55-g6feb