aboutsummaryrefslogtreecommitdiff
path: root/src/engine/core.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-03-10 15:47:59 -0600
committerSean Hall <r.sean.hall@gmail.com>2021-03-11 20:24:18 -0600
commit10ef9d5bfbf81f454113a1c2716009831a916222 (patch)
tree9e2fd8c917787ceba5e4c7f873d715eafbda6920 /src/engine/core.cpp
parent778b65643f19df94947d390a5a17023043d840b4 (diff)
downloadwix-10ef9d5bfbf81f454113a1c2716009831a916222.tar.gz
wix-10ef9d5bfbf81f454113a1c2716009831a916222.tar.bz2
wix-10ef9d5bfbf81f454113a1c2716009831a916222.zip
Determine whether to ignore forward compatible bundles during Plan.
Diffstat (limited to 'src/engine/core.cpp')
-rw-r--r--src/engine/core.cpp65
1 files changed, 32 insertions, 33 deletions
diff --git a/src/engine/core.cpp b/src/engine/core.cpp
index 2f18e4d2..eb8a84fe 100644
--- a/src/engine/core.cpp
+++ b/src/engine/core.cpp
@@ -319,15 +319,8 @@ extern "C" HRESULT CoreDetect(
319 hr = DependencyDetectProviderKeyBundleId(&pEngineState->registration); 319 hr = DependencyDetectProviderKeyBundleId(&pEngineState->registration);
320 if (SUCCEEDED(hr)) 320 if (SUCCEEDED(hr))
321 { 321 {
322 hr = DetectForwardCompatibleBundle(&pEngineState->userExperience, &pEngineState->command, &pEngineState->registration); 322 hr = DetectForwardCompatibleBundles(&pEngineState->userExperience, &pEngineState->registration);
323 ExitOnFailure(hr, "Failed to detect forward compatible bundle."); 323 ExitOnFailure(hr, "Failed to detect forward compatible bundle.");
324
325 // If a forward compatible bundle was detected, skip rest of bundle detection
326 // since we will passthrough.
327 if (pEngineState->registration.fEnabledForwardCompatibleBundle)
328 {
329 ExitFunction();
330 }
331 } 324 }
332 else if (E_NOTFOUND == hr) 325 else if (E_NOTFOUND == hr)
333 { 326 {
@@ -504,39 +497,45 @@ extern "C" HRESULT CorePlan(
504 hr = PlanUpdateBundle(&pEngineState->userExperience, pUpgradeBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent); 497 hr = PlanUpdateBundle(&pEngineState->userExperience, pUpgradeBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent);
505 ExitOnFailure(hr, "Failed to plan update."); 498 ExitOnFailure(hr, "Failed to plan update.");
506 } 499 }
507 else if (pEngineState->registration.fEnabledForwardCompatibleBundle) 500 else
508 { 501 {
509 Assert(!pEngineState->plan.fPerMachine); 502 hr = PlanForwardCompatibleBundles(&pEngineState->userExperience, &pEngineState->command, &pEngineState->plan, &pEngineState->registration, action);
503 ExitOnFailure(hr, "Failed to plan forward compatible bundles.");
510 504
511 pForwardCompatibleBundlePackage = &pEngineState->registration.forwardCompatibleBundle; 505 if (pEngineState->plan.fEnabledForwardCompatibleBundle)
512 506 {
513 hr = PlanPassThroughBundle(&pEngineState->userExperience, pForwardCompatibleBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent); 507 Assert(!pEngineState->plan.fPerMachine);
514 ExitOnFailure(hr, "Failed to plan passthrough.");
515 }
516 else // doing an action that modifies the machine state.
517 {
518 pEngineState->plan.fPerMachine = pEngineState->registration.fPerMachine; // default the scope of the plan to the per-machine state of the bundle.
519 508
520 hr = PlanRegistration(&pEngineState->plan, &pEngineState->registration, pEngineState->command.resumeType, pEngineState->command.relationType, &fContinuePlanning); 509 pForwardCompatibleBundlePackage = &pEngineState->plan.forwardCompatibleBundle;
521 ExitOnFailure(hr, "Failed to plan registration.");
522 510
523 if (fContinuePlanning) 511 hr = PlanPassThroughBundle(&pEngineState->userExperience, pForwardCompatibleBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent);
512 ExitOnFailure(hr, "Failed to plan passthrough.");
513 }
514 else // doing an action that modifies the machine state.
524 { 515 {
525 // Remember the early index, because we want to be able to insert some related bundles 516 pEngineState->plan.fPerMachine = pEngineState->registration.fPerMachine; // default the scope of the plan to the per-machine state of the bundle.
526 // into the plan before other executed packages. This particularly occurs for uninstallation
527 // of addons and patches, which should be uninstalled before the main product.
528 DWORD dwExecuteActionEarlyIndex = pEngineState->plan.cExecuteActions;
529 517
530 // Plan the related bundles first to support downgrades with ref-counting. 518 hr = PlanRegistration(&pEngineState->plan, &pEngineState->registration, pEngineState->command.resumeType, pEngineState->command.relationType, &fContinuePlanning);
531 hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan); 519 ExitOnFailure(hr, "Failed to plan registration.");
532 ExitOnFailure(hr, "Failed to plan related bundles.");
533 520
534 hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, NULL, &hSyncpointEvent); 521 if (fContinuePlanning)
535 ExitOnFailure(hr, "Failed to plan packages."); 522 {
523 // Remember the early index, because we want to be able to insert some related bundles
524 // into the plan before other executed packages. This particularly occurs for uninstallation
525 // of addons and patches, which should be uninstalled before the main product.
526 DWORD dwExecuteActionEarlyIndex = pEngineState->plan.cExecuteActions;
536 527
537 // Schedule the update of related bundles last. 528 // Plan the related bundles first to support downgrades with ref-counting.
538 hr = PlanRelatedBundlesComplete(&pEngineState->registration, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, &hSyncpointEvent, dwExecuteActionEarlyIndex); 529 hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan);
539 ExitOnFailure(hr, "Failed to schedule related bundles."); 530 ExitOnFailure(hr, "Failed to plan related bundles.");
531
532 hr = PlanPackages(&pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, NULL, &hSyncpointEvent);
533 ExitOnFailure(hr, "Failed to plan packages.");
534
535 // Schedule the update of related bundles last.
536 hr = PlanRelatedBundlesComplete(&pEngineState->registration, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, &hSyncpointEvent, dwExecuteActionEarlyIndex);
537 ExitOnFailure(hr, "Failed to schedule related bundles.");
538 }
540 } 539 }
541 } 540 }
542 541