diff options
Diffstat (limited to 'src/engine/relatedbundle.cpp')
-rw-r--r-- | src/engine/relatedbundle.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/engine/relatedbundle.cpp b/src/engine/relatedbundle.cpp index bc79b954..a4948a88 100644 --- a/src/engine/relatedbundle.cpp +++ b/src/engine/relatedbundle.cpp | |||
@@ -398,6 +398,7 @@ static HRESULT LoadRelatedBundleFromKey( | |||
398 | DWORD64 qwEngineVersion = 0; | 398 | DWORD64 qwEngineVersion = 0; |
399 | LPWSTR sczBundleVersion = NULL; | 399 | LPWSTR sczBundleVersion = NULL; |
400 | LPWSTR sczCachePath = NULL; | 400 | LPWSTR sczCachePath = NULL; |
401 | BURN_CACHE_STATE cacheState = BURN_CACHE_STATE_NONE; | ||
401 | DWORD64 qwFileSize = 0; | 402 | DWORD64 qwFileSize = 0; |
402 | BURN_DEPENDENCY_PROVIDER dependencyProvider = { }; | 403 | BURN_DEPENDENCY_PROVIDER dependencyProvider = { }; |
403 | 404 | ||
@@ -423,7 +424,18 @@ static HRESULT LoadRelatedBundleFromKey( | |||
423 | ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleId); | 424 | ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleId); |
424 | 425 | ||
425 | hr = FileSize(sczCachePath, reinterpret_cast<LONGLONG *>(&qwFileSize)); | 426 | hr = FileSize(sczCachePath, reinterpret_cast<LONGLONG *>(&qwFileSize)); |
426 | ExitOnFailure(hr, "Failed to get size of pseudo bundle: %ls", sczCachePath); | 427 | if (SUCCEEDED(hr)) |
428 | { | ||
429 | cacheState = BURN_CACHE_STATE_COMPLETE; | ||
430 | } | ||
431 | else if (E_FILENOTFOUND != hr) | ||
432 | { | ||
433 | cacheState = BURN_CACHE_STATE_PARTIAL; | ||
434 | LogId(REPORT_STANDARD, MSG_DETECT_RELATED_BUNDLE_NOT_FULLY_CACHED, wzRelatedBundleId, sczCachePath, hr); | ||
435 | } | ||
436 | hr = S_OK; | ||
437 | |||
438 | pRelatedBundle->fPlannable = BURN_CACHE_STATE_COMPLETE == cacheState; | ||
427 | 439 | ||
428 | hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, &dependencyProvider.sczKey); | 440 | hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, &dependencyProvider.sczKey); |
429 | if (E_FILENOTFOUND != hr) | 441 | if (E_FILENOTFOUND != hr) |
@@ -452,7 +464,7 @@ static HRESULT LoadRelatedBundleFromKey( | |||
452 | pRelatedBundle->relationType = relationType; | 464 | pRelatedBundle->relationType = relationType; |
453 | 465 | ||
454 | hr = PseudoBundleInitialize(qwEngineVersion, &pRelatedBundle->package, fPerMachine, wzRelatedBundleId, pRelatedBundle->relationType, | 466 | hr = PseudoBundleInitialize(qwEngineVersion, &pRelatedBundle->package, fPerMachine, wzRelatedBundleId, pRelatedBundle->relationType, |
455 | BOOTSTRAPPER_PACKAGE_STATE_PRESENT, sczCachePath, sczCachePath, NULL, qwFileSize, FALSE, | 467 | BOOTSTRAPPER_PACKAGE_STATE_PRESENT, cacheState, sczCachePath, sczCachePath, NULL, qwFileSize, FALSE, |
456 | L"-quiet", L"-repair -quiet", L"-uninstall -quiet", | 468 | L"-quiet", L"-repair -quiet", L"-uninstall -quiet", |
457 | (dependencyProvider.sczKey && *dependencyProvider.sczKey) ? &dependencyProvider : NULL, | 469 | (dependencyProvider.sczKey && *dependencyProvider.sczKey) ? &dependencyProvider : NULL, |
458 | NULL, 0); | 470 | NULL, 0); |