diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-03-09 14:05:08 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-03-09 14:34:45 -0600 |
commit | 778b65643f19df94947d390a5a17023043d840b4 (patch) | |
tree | 78bea5c924e6286d958fe3f9b540c3afec2eb3dd | |
parent | 8b25ff41809c63c92d5acb06a3f8792cb58170e6 (diff) | |
download | wix-778b65643f19df94947d390a5a17023043d840b4.tar.gz wix-778b65643f19df94947d390a5a17023043d840b4.tar.bz2 wix-778b65643f19df94947d390a5a17023043d840b4.zip |
Ensure bundle is registered and cached when modifying machine state.
#5702
-rw-r--r-- | src/engine/plan.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp index d6cc63ad..4f29209f 100644 --- a/src/engine/plan.cpp +++ b/src/engine/plan.cpp | |||
@@ -523,6 +523,19 @@ extern "C" HRESULT PlanRegistration( | |||
523 | 523 | ||
524 | pPlan->fDisallowRemoval = FALSE; // by default the bundle can be planned to be removed | 524 | pPlan->fDisallowRemoval = FALSE; // by default the bundle can be planned to be removed |
525 | 525 | ||
526 | // Ensure the bundle is cached if not running from the cache. | ||
527 | if (!CacheBundleRunningFromCache()) | ||
528 | { | ||
529 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; | ||
530 | } | ||
531 | |||
532 | // Always write registration since things may have changed or it just needs to be "fixed up". | ||
533 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION; | ||
534 | |||
535 | // Always update our estimated size registration when installing/modify/repair since things | ||
536 | // may have been added or removed or it just needs to be "fixed up". | ||
537 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_UPDATE_SIZE; | ||
538 | |||
526 | if (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action) | 539 | if (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action) |
527 | { | 540 | { |
528 | // If our provider key was detected and it points to our current bundle then we can | 541 | // If our provider key was detected and it points to our current bundle then we can |
@@ -621,26 +634,6 @@ extern "C" HRESULT PlanRegistration( | |||
621 | { | 634 | { |
622 | BOOL fAddonOrPatchBundle = (pRegistration->cAddonCodes || pRegistration->cPatchCodes); | 635 | BOOL fAddonOrPatchBundle = (pRegistration->cAddonCodes || pRegistration->cPatchCodes); |
623 | 636 | ||
624 | // If the bundle is not cached or will not be cached after restart, ensure the bundle is cached. | ||
625 | if (!FileExistsAfterRestart(pRegistration->sczCacheExecutablePath, NULL)) | ||
626 | { | ||
627 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; | ||
628 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION; | ||
629 | } | ||
630 | else if (BOOTSTRAPPER_ACTION_REPAIR == pPlan->action && !CacheBundleRunningFromCache()) // repairing but not running from the cache. | ||
631 | { | ||
632 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; | ||
633 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION; | ||
634 | } | ||
635 | else if (BOOTSTRAPPER_ACTION_REPAIR == pPlan->action) // just repair, make sure the registration is "fixed up". | ||
636 | { | ||
637 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION; | ||
638 | } | ||
639 | |||
640 | // Always update our estimated size registration when installing/modify/repair since things | ||
641 | // may have been added or removed or it just needs to be "fixed up". | ||
642 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_UPDATE_SIZE; | ||
643 | |||
644 | // Always plan to write our provider key registration when installing/modify/repair to "fix it" | 637 | // Always plan to write our provider key registration when installing/modify/repair to "fix it" |
645 | // if broken. | 638 | // if broken. |
646 | pPlan->dependencyRegistrationAction = BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER; | 639 | pPlan->dependencyRegistrationAction = BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER; |