diff options
Diffstat (limited to 'src/engine/core.cpp')
| -rw-r--r-- | src/engine/core.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/engine/core.cpp b/src/engine/core.cpp index 42759d3f..98aa943e 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp | |||
| @@ -287,7 +287,7 @@ extern "C" HRESULT CoreDetect( | |||
| 287 | pEngineState->fDetected = FALSE; | 287 | pEngineState->fDetected = FALSE; |
| 288 | pEngineState->fPlanned = FALSE; | 288 | pEngineState->fPlanned = FALSE; |
| 289 | DetectReset(&pEngineState->registration, &pEngineState->packages); | 289 | DetectReset(&pEngineState->registration, &pEngineState->packages); |
| 290 | PlanReset(&pEngineState->plan, &pEngineState->packages); | 290 | PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads); |
| 291 | 291 | ||
| 292 | // Detect if bundle installed state has changed since start up. This | 292 | // Detect if bundle installed state has changed since start up. This |
| 293 | // only happens if Apply() changed the state of bundle (installed or | 293 | // only happens if Apply() changed the state of bundle (installed or |
| @@ -438,7 +438,6 @@ extern "C" HRESULT CorePlan( | |||
| 438 | { | 438 | { |
| 439 | HRESULT hr = S_OK; | 439 | HRESULT hr = S_OK; |
| 440 | BOOL fPlanBegan = FALSE; | 440 | BOOL fPlanBegan = FALSE; |
| 441 | LPWSTR sczLayoutDirectory = NULL; | ||
| 442 | BURN_PACKAGE* pUpgradeBundlePackage = NULL; | 441 | BURN_PACKAGE* pUpgradeBundlePackage = NULL; |
| 443 | BURN_PACKAGE* pForwardCompatibleBundlePackage = NULL; | 442 | BURN_PACKAGE* pForwardCompatibleBundlePackage = NULL; |
| 444 | BOOL fContinuePlanning = TRUE; // assume we won't skip planning due to dependencies. | 443 | BOOL fContinuePlanning = TRUE; // assume we won't skip planning due to dependencies. |
| @@ -460,11 +459,12 @@ extern "C" HRESULT CorePlan( | |||
| 460 | 459 | ||
| 461 | // Always reset the plan. | 460 | // Always reset the plan. |
| 462 | pEngineState->fPlanned = FALSE; | 461 | pEngineState->fPlanned = FALSE; |
| 463 | PlanReset(&pEngineState->plan, &pEngineState->packages); | 462 | PlanReset(&pEngineState->plan, &pEngineState->containers, &pEngineState->packages, &pEngineState->layoutPayloads); |
| 464 | 463 | ||
| 465 | // Remember the overall action state in the plan since it shapes the changes | 464 | // Remember the overall action state in the plan since it shapes the changes |
| 466 | // we make everywhere. | 465 | // we make everywhere. |
| 467 | pEngineState->plan.action = action; | 466 | pEngineState->plan.action = action; |
| 467 | pEngineState->plan.pPayloads = &pEngineState->payloads; | ||
| 468 | pEngineState->plan.wzBundleId = pEngineState->registration.sczId; | 468 | pEngineState->plan.wzBundleId = pEngineState->registration.sczId; |
| 469 | pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; | 469 | pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; |
| 470 | pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback; | 470 | pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback; |
| @@ -484,11 +484,11 @@ extern "C" HRESULT CorePlan( | |||
| 484 | Assert(!pEngineState->plan.fPerMachine); | 484 | Assert(!pEngineState->plan.fPerMachine); |
| 485 | 485 | ||
| 486 | // Plan the bundle's layout. | 486 | // Plan the bundle's layout. |
| 487 | hr = PlanLayoutBundle(&pEngineState->plan, pEngineState->registration.sczExecutableName, pEngineState->section.qwBundleSize, &pEngineState->variables, &pEngineState->payloads, &sczLayoutDirectory); | 487 | hr = PlanLayoutBundle(&pEngineState->plan, pEngineState->registration.sczExecutableName, pEngineState->section.qwBundleSize, &pEngineState->variables, &pEngineState->layoutPayloads); |
| 488 | ExitOnFailure(hr, "Failed to plan the layout of the bundle."); | 488 | ExitOnFailure(hr, "Failed to plan the layout of the bundle."); |
| 489 | 489 | ||
| 490 | // Plan the packages' layout. | 490 | // Plan the packages' layout. |
| 491 | hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, sczLayoutDirectory); | 491 | hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType); |
| 492 | ExitOnFailure(hr, "Failed to plan packages."); | 492 | ExitOnFailure(hr, "Failed to plan packages."); |
| 493 | } | 493 | } |
| 494 | else if (BOOTSTRAPPER_ACTION_UPDATE_REPLACE == action || BOOTSTRAPPER_ACTION_UPDATE_REPLACE_EMBEDDED == action) | 494 | else if (BOOTSTRAPPER_ACTION_UPDATE_REPLACE == action || BOOTSTRAPPER_ACTION_UPDATE_REPLACE_EMBEDDED == action) |
| @@ -532,7 +532,7 @@ extern "C" HRESULT CorePlan( | |||
| 532 | hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan); | 532 | hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan); |
| 533 | ExitOnFailure(hr, "Failed to plan related bundles."); | 533 | ExitOnFailure(hr, "Failed to plan related bundles."); |
| 534 | 534 | ||
| 535 | hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, NULL); | 535 | hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType); |
| 536 | ExitOnFailure(hr, "Failed to plan packages."); | 536 | ExitOnFailure(hr, "Failed to plan packages."); |
| 537 | 537 | ||
| 538 | // Schedule the update of related bundles last. | 538 | // Schedule the update of related bundles last. |
| @@ -562,7 +562,6 @@ LExit: | |||
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | LogId(REPORT_STANDARD, MSG_PLAN_COMPLETE, hr); | 564 | LogId(REPORT_STANDARD, MSG_PLAN_COMPLETE, hr); |
| 565 | ReleaseStr(sczLayoutDirectory); | ||
| 566 | 565 | ||
| 567 | return hr; | 566 | return hr; |
| 568 | } | 567 | } |
| @@ -1679,23 +1678,22 @@ static HRESULT DetectPackagePayloadsCached( | |||
| 1679 | // If the cached directory exists, we have something. | 1678 | // If the cached directory exists, we have something. |
| 1680 | if (DirExists(sczCachePath, NULL)) | 1679 | if (DirExists(sczCachePath, NULL)) |
| 1681 | { | 1680 | { |
| 1682 | // Check all payloads to see if they exist. | 1681 | // Check all payloads to see if any exist. |
| 1683 | for (DWORD i = 0; i < pPackage->cPayloads; ++i) | 1682 | for (DWORD i = 0; i < pPackage->payloads.cPayloads; ++i) |
| 1684 | { | 1683 | { |
| 1685 | BURN_PACKAGE_PAYLOAD* pPackagePayload = pPackage->rgPayloads + i; | 1684 | BURN_PAYLOAD* pPayload = pPackage->payloads.rgpPayloads[i]; |
| 1686 | 1685 | ||
| 1687 | hr = PathConcat(sczCachePath, pPackagePayload->pPayload->sczFilePath, &sczPayloadCachePath); | 1686 | hr = PathConcat(sczCachePath, pPayload->sczFilePath, &sczPayloadCachePath); |
| 1688 | ExitOnFailure(hr, "Failed to concat payload cache path."); | 1687 | ExitOnFailure(hr, "Failed to concat payload cache path."); |
| 1689 | 1688 | ||
| 1690 | if (FileExistsEx(sczPayloadCachePath, NULL)) | 1689 | if (FileExistsEx(sczPayloadCachePath, NULL)) |
| 1691 | { | 1690 | { |
| 1692 | // TODO: We shouldn't track whether the payload was cached since all we did was check whether the file exists. | ||
| 1693 | pPackagePayload->fCached = TRUE; | ||
| 1694 | fCached = TRUE; | 1691 | fCached = TRUE; |
| 1692 | break; | ||
| 1695 | } | 1693 | } |
| 1696 | else | 1694 | else |
| 1697 | { | 1695 | { |
| 1698 | LogId(REPORT_STANDARD, MSG_DETECT_PACKAGE_NOT_FULLY_CACHED, pPackage->sczId, pPackagePayload->pPayload->sczKey); | 1696 | LogId(REPORT_STANDARD, MSG_DETECT_PACKAGE_NOT_FULLY_CACHED, pPackage->sczId, pPayload->sczKey); |
| 1699 | } | 1697 | } |
| 1700 | } | 1698 | } |
| 1701 | } | 1699 | } |
