aboutsummaryrefslogtreecommitdiff
path: root/src/engine/plan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/plan.cpp')
-rw-r--r--src/engine/plan.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp
index 4f29209f..87607382 100644
--- a/src/engine/plan.cpp
+++ b/src/engine/plan.cpp
@@ -194,6 +194,8 @@ extern "C" void PlanReset(
194 __in BURN_PACKAGES* pPackages 194 __in BURN_PACKAGES* pPackages
195 ) 195 )
196{ 196{
197 PackageUninitialize(&pPlan->forwardCompatibleBundle);
198
197 if (pPlan->rgRegistrationActions) 199 if (pPlan->rgRegistrationActions)
198 { 200 {
199 for (DWORD i = 0; i < pPlan->cRegistrationActions; ++i) 201 for (DWORD i = 0; i < pPlan->cRegistrationActions; ++i)
@@ -488,6 +490,72 @@ LExit:
488 return hr; 490 return hr;
489} 491}
490 492
493extern "C" HRESULT PlanForwardCompatibleBundles(
494 __in BURN_USER_EXPERIENCE* pUX,
495 __in BOOTSTRAPPER_COMMAND* pCommand,
496 __in BURN_PLAN* pPlan,
497 __in BURN_REGISTRATION* pRegistration,
498 __in BOOTSTRAPPER_ACTION action
499 )
500{
501 HRESULT hr = S_OK;
502 BOOL fRecommendIgnore = TRUE;
503 BOOL fIgnoreBundle = FALSE;
504
505 if (!pRegistration->fForwardCompatibleBundleExists)
506 {
507 ExitFunction();
508 }
509
510 // Only change the recommendation if an active parent was provided.
511 if (pRegistration->sczActiveParent && *pRegistration->sczActiveParent)
512 {
513 // On install, recommend running the forward compatible bundle because there is an active parent. This
514 // will essentially register the parent with the forward compatible bundle.
515 if (BOOTSTRAPPER_ACTION_INSTALL == action)
516 {
517 fRecommendIgnore = FALSE;
518 }
519 else if (BOOTSTRAPPER_ACTION_UNINSTALL == action ||
520 BOOTSTRAPPER_ACTION_MODIFY == action ||
521 BOOTSTRAPPER_ACTION_REPAIR == action)
522 {
523 // When modifying the bundle, only recommend running the forward compatible bundle if the parent
524 // is already registered as a dependent of the provider key.
525 if (pRegistration->fParentRegisteredAsDependent)
526 {
527 fRecommendIgnore = FALSE;
528 }
529 }
530 }
531
532 for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle)
533 {
534 BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle;
535 if (!pRelatedBundle->fForwardCompatible)
536 {
537 continue;
538 }
539
540 fIgnoreBundle = fRecommendIgnore;
541
542 hr = UserExperienceOnPlanForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, &fIgnoreBundle);
543 ExitOnRootFailure(hr, "BA aborted plan forward compatible bundle.");
544
545 if (!fIgnoreBundle)
546 {
547 hr = PseudoBundleInitializePassthrough(&pPlan->forwardCompatibleBundle, pCommand, NULL, pRegistration->sczActiveParent, pRegistration->sczAncestors, &pRelatedBundle->package);
548 ExitOnFailure(hr, "Failed to initialize pass through bundle.");
549
550 pPlan->fEnabledForwardCompatibleBundle = TRUE;
551 break;
552 }
553 }
554
555LExit:
556 return hr;
557}
558
491extern "C" HRESULT PlanPackages( 559extern "C" HRESULT PlanPackages(
492 __in BURN_USER_EXPERIENCE* pUX, 560 __in BURN_USER_EXPERIENCE* pUX,
493 __in BURN_PACKAGES* pPackages, 561 __in BURN_PACKAGES* pPackages,