diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-05-03 21:14:52 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-05-11 19:11:19 -0500 |
commit | a2f2036c8598efcb434eebeeacd7ede84ab60dfe (patch) | |
tree | 271e07336a3eb394f5f9fe4c2da0973d2b3193dc /src/burn | |
parent | 2f4287fdcee83b30e0f7f3ce548bcdff2ee85e1f (diff) | |
download | wix-a2f2036c8598efcb434eebeeacd7ede84ab60dfe.tar.gz wix-a2f2036c8598efcb434eebeeacd7ede84ab60dfe.tar.bz2 wix-a2f2036c8598efcb434eebeeacd7ede84ab60dfe.zip |
Cache packages that will be present for CACHE/INSTALL overall actions.
During actions that are expected to have source media available, all packages that have cacheType set to keep should be cached if the package is going to be present.
Set NetFx ExePackage Cache="no" and remove uninstall and repair arguments.
#5125
Diffstat (limited to 'src/burn')
-rw-r--r-- | src/burn/engine/core.cpp | 2 | ||||
-rw-r--r-- | src/burn/engine/engine.mc | 2 | ||||
-rw-r--r-- | src/burn/engine/logging.cpp | 17 | ||||
-rw-r--r-- | src/burn/engine/logging.h | 4 | ||||
-rw-r--r-- | src/burn/engine/plan.cpp | 17 | ||||
-rw-r--r-- | src/burn/engine/userexperience.cpp | 6 | ||||
-rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 25 |
7 files changed, 59 insertions, 14 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index 02cab7e6..601f29a0 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
@@ -1788,7 +1788,7 @@ static void LogPackages( | |||
1788 | const DWORD iPackage = (BOOTSTRAPPER_ACTION_UNINSTALL == action) ? pPackages->cPackages - 1 - i : i; | 1788 | const DWORD iPackage = (BOOTSTRAPPER_ACTION_UNINSTALL == action) ? pPackages->cPackages - 1 - i : i; |
1789 | const BURN_PACKAGE* pPackage = &pPackages->rgPackages[iPackage]; | 1789 | const BURN_PACKAGE* pPackage = &pPackages->rgPackages[iPackage]; |
1790 | 1790 | ||
1791 | LogId(REPORT_STANDARD, MSG_PLANNED_PACKAGE, pPackage->sczId, LoggingPackageStateToString(pPackage->currentState), LoggingRequestStateToString(pPackage->defaultRequested), LoggingRequestStateToString(pPackage->requested), LoggingActionStateToString(pPackage->execute), LoggingActionStateToString(pPackage->rollback), LoggingBoolToString(pPackage->fPlannedCache), LoggingBoolToString(pPackage->fPlannedUncache), LoggingDependencyActionToString(pPackage->dependencyExecute), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedInstallRegistrationState), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedCacheRegistrationState)); | 1791 | LogId(REPORT_STANDARD, MSG_PLANNED_PACKAGE, pPackage->sczId, LoggingPackageStateToString(pPackage->currentState), LoggingRequestStateToString(pPackage->defaultRequested), LoggingRequestStateToString(pPackage->requested), LoggingActionStateToString(pPackage->execute), LoggingActionStateToString(pPackage->rollback), LoggingCacheTypeToString(pPackage->authoredCacheType), LoggingCacheTypeToString(pPackage->cacheType), LoggingBoolToString(pPackage->fPlannedCache), LoggingBoolToString(pPackage->fPlannedUncache), LoggingDependencyActionToString(pPackage->dependencyExecute), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedInstallRegistrationState), LoggingPackageRegistrationStateToString(pPackage->fCanAffectRegistration, pPackage->expectedCacheRegistrationState)); |
1792 | 1792 | ||
1793 | if (BURN_PACKAGE_TYPE_MSI == pPackage->type) | 1793 | if (BURN_PACKAGE_TYPE_MSI == pPackage->type) |
1794 | { | 1794 | { |
diff --git a/src/burn/engine/engine.mc b/src/burn/engine/engine.mc index 84046314..929bf67a 100644 --- a/src/burn/engine/engine.mc +++ b/src/burn/engine/engine.mc | |||
@@ -314,7 +314,7 @@ MessageId=201 | |||
314 | Severity=Success | 314 | Severity=Success |
315 | SymbolicName=MSG_PLANNED_PACKAGE | 315 | SymbolicName=MSG_PLANNED_PACKAGE |
316 | Language=English | 316 | Language=English |
317 | Planned package: %1!ls!, state: %2!hs!, default requested: %3!hs!, ba requested: %4!hs!, execute: %5!hs!, rollback: %6!hs!, cache: %7!hs!, uncache: %8!hs!, dependency: %9!hs!, expected install registration state: %10!hs!, expected cache registration state: %11!hs! | 317 | Planned package: %1!ls!, state: %2!hs!, default requested: %3!hs!, ba requested: %4!hs!, execute: %5!hs!, rollback: %6!hs!, default cache strategy: %7!hs!, ba requested strategy: %8!hs!, cache: %9!hs!, uncache: %10!hs!, dependency: %11!hs!, expected install registration state: %12!hs!, expected cache registration state: %13!hs! |
318 | . | 318 | . |
319 | 319 | ||
320 | MessageId=202 | 320 | MessageId=202 |
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index 065ef907..7ee1ec85 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp | |||
@@ -337,6 +337,23 @@ extern "C" LPCSTR LoggingActionStateToString( | |||
337 | } | 337 | } |
338 | } | 338 | } |
339 | 339 | ||
340 | extern "C" LPCSTR LoggingCacheTypeToString( | ||
341 | BOOTSTRAPPER_CACHE_TYPE cacheType | ||
342 | ) | ||
343 | { | ||
344 | switch (cacheType) | ||
345 | { | ||
346 | case BOOTSTRAPPER_CACHE_TYPE_FORCE: | ||
347 | return "Force"; | ||
348 | case BOOTSTRAPPER_CACHE_TYPE_KEEP: | ||
349 | return "Keep"; | ||
350 | case BOOTSTRAPPER_CACHE_TYPE_REMOVE: | ||
351 | return "Remove"; | ||
352 | default: | ||
353 | return "Invalid"; | ||
354 | } | ||
355 | } | ||
356 | |||
340 | extern "C" LPCSTR LoggingDependencyActionToString( | 357 | extern "C" LPCSTR LoggingDependencyActionToString( |
341 | BURN_DEPENDENCY_ACTION action | 358 | BURN_DEPENDENCY_ACTION action |
342 | ) | 359 | ) |
diff --git a/src/burn/engine/logging.h b/src/burn/engine/logging.h index 601039f9..909ce591 100644 --- a/src/burn/engine/logging.h +++ b/src/burn/engine/logging.h | |||
@@ -73,6 +73,10 @@ LPCSTR LoggingActionStateToString( | |||
73 | __in BOOTSTRAPPER_ACTION_STATE actionState | 73 | __in BOOTSTRAPPER_ACTION_STATE actionState |
74 | ); | 74 | ); |
75 | 75 | ||
76 | LPCSTR LoggingCacheTypeToString( | ||
77 | BOOTSTRAPPER_CACHE_TYPE cacheType | ||
78 | ); | ||
79 | |||
76 | LPCSTR LoggingDependencyActionToString( | 80 | LPCSTR LoggingDependencyActionToString( |
77 | BURN_DEPENDENCY_ACTION action | 81 | BURN_DEPENDENCY_ACTION action |
78 | ); | 82 | ); |
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index 327078b9..f0ae2a44 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
@@ -1077,7 +1077,7 @@ extern "C" HRESULT PlanExecutePackage( | |||
1077 | ) | 1077 | ) |
1078 | { | 1078 | { |
1079 | HRESULT hr = S_OK; | 1079 | HRESULT hr = S_OK; |
1080 | BOOL fRequestedCache = BOOTSTRAPPER_REQUEST_STATE_CACHE == pPackage->requested || ForceCache(pPlan, pPackage); | 1080 | BOOL fRequestedCache = BOOTSTRAPPER_CACHE_TYPE_REMOVE < pPackage->cacheType && (BOOTSTRAPPER_REQUEST_STATE_CACHE == pPackage->requested || ForceCache(pPlan, pPackage)); |
1081 | 1081 | ||
1082 | hr = CalculateExecuteActions(pPackage, pPlan->pActiveRollbackBoundary); | 1082 | hr = CalculateExecuteActions(pPackage, pPlan->pActiveRollbackBoundary); |
1083 | ExitOnFailure(hr, "Failed to calculate plan actions for package: %ls", pPackage->sczId); | 1083 | ExitOnFailure(hr, "Failed to calculate plan actions for package: %ls", pPackage->sczId); |
@@ -2531,8 +2531,19 @@ static BOOL ForceCache( | |||
2531 | __in BURN_PACKAGE* pPackage | 2531 | __in BURN_PACKAGE* pPackage |
2532 | ) | 2532 | ) |
2533 | { | 2533 | { |
2534 | // All packages that have cacheType set to force should be cached if the bundle is going to be present. | 2534 | switch (pPackage->cacheType) |
2535 | return BOOTSTRAPPER_CACHE_TYPE_FORCE == pPackage->cacheType && BOOTSTRAPPER_ACTION_UNINSTALL < pPlan->action; | 2535 | { |
2536 | case BOOTSTRAPPER_CACHE_TYPE_KEEP: | ||
2537 | // During actions that are expected to have source media available, | ||
2538 | // all packages that have cacheType set to keep should be cached if the package is going to be present. | ||
2539 | return (BOOTSTRAPPER_ACTION_CACHE == pPlan->action || BOOTSTRAPPER_ACTION_INSTALL == pPlan->action) && | ||
2540 | BOOTSTRAPPER_REQUEST_STATE_CACHE < pPackage->requested; | ||
2541 | case BOOTSTRAPPER_CACHE_TYPE_FORCE: | ||
2542 | // All packages that have cacheType set to force should be cached if the bundle is going to be present. | ||
2543 | return BOOTSTRAPPER_ACTION_UNINSTALL < pPlan->action; | ||
2544 | default: | ||
2545 | return FALSE; | ||
2546 | } | ||
2536 | } | 2547 | } |
2537 | 2548 | ||
2538 | static void CacheActionLog( | 2549 | static void CacheActionLog( |
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp index 2215a070..5a54f26e 100644 --- a/src/burn/engine/userexperience.cpp +++ b/src/burn/engine/userexperience.cpp | |||
@@ -1998,7 +1998,11 @@ EXTERN_C BAAPI UserExperienceOnPlanPackageBegin( | |||
1998 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | 1998 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); |
1999 | } | 1999 | } |
2000 | *pRequestedState = results.requestedState; | 2000 | *pRequestedState = results.requestedState; |
2001 | *pRequestedCacheType = results.requestedCacheType; | 2001 | |
2002 | if (BOOTSTRAPPER_CACHE_TYPE_REMOVE <= results.requestedCacheType && BOOTSTRAPPER_CACHE_TYPE_FORCE >= results.requestedCacheType) | ||
2003 | { | ||
2004 | *pRequestedCacheType = results.requestedCacheType; | ||
2005 | } | ||
2002 | 2006 | ||
2003 | LExit: | 2007 | LExit: |
2004 | return hr; | 2008 | return hr; |
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index 045c510e..23192349 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
@@ -726,27 +726,33 @@ namespace Bootstrapper | |||
726 | BOOL fRollback = FALSE; | 726 | BOOL fRollback = FALSE; |
727 | DWORD dwIndex = 0; | 727 | DWORD dwIndex = 0; |
728 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 728 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
729 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); | ||
730 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | ||
731 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 3); | ||
729 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PatchA"); | 732 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PatchA"); |
730 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 733 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
731 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 2); | 734 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 4); |
732 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 735 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
733 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | 736 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); |
734 | Assert::Equal(dwIndex, pPlan->cCacheActions); | 737 | Assert::Equal(dwIndex, pPlan->cCacheActions); |
735 | 738 | ||
736 | fRollback = TRUE; | 739 | fRollback = TRUE; |
737 | dwIndex = 0; | 740 | dwIndex = 0; |
738 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 2); | 741 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 4); |
739 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 742 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
740 | 743 | ||
741 | Assert::Equal(3055111ull, pPlan->qwEstimatedSize); | 744 | Assert::Equal(3055111ull, pPlan->qwEstimatedSize); |
742 | Assert::Equal(212992ull, pPlan->qwCacheSizeTotal); | 745 | Assert::Equal(6130592ull, pPlan->qwCacheSizeTotal); |
743 | 746 | ||
744 | fRollback = FALSE; | 747 | fRollback = FALSE; |
745 | dwIndex = 0; | 748 | dwIndex = 0; |
746 | DWORD dwExecuteCheckpointId = 3; | 749 | DWORD dwExecuteCheckpointId = 2; |
747 | BURN_EXECUTE_ACTION* pExecuteAction = NULL; | 750 | BURN_EXECUTE_ACTION* pExecuteAction = NULL; |
748 | ValidateExecuteRollbackBoundary(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | 751 | ValidateExecuteRollbackBoundary(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); |
749 | ValidateExecuteWaitSyncpoint(pPlan, fRollback, dwIndex++, pPlan->rgCacheActions[5].syncpoint.hEvent); | 752 | ValidateExecuteWaitSyncpoint(pPlan, fRollback, dwIndex++, pPlan->rgCacheActions[2].syncpoint.hEvent); |
753 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
754 | ValidateExecuteWaitSyncpoint(pPlan, fRollback, dwIndex++, pPlan->rgCacheActions[8].syncpoint.hEvent); | ||
755 | dwExecuteCheckpointId += 2; // cache checkpoints | ||
750 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 756 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
751 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 757 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
752 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", BURN_DEPENDENCY_ACTION_REGISTER); | 758 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", BURN_DEPENDENCY_ACTION_REGISTER); |
@@ -755,7 +761,7 @@ namespace Bootstrapper | |||
755 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 761 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
756 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_REGISTER); | 762 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_REGISTER); |
757 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 763 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
758 | ValidateExecuteWaitSyncpoint(pPlan, fRollback, dwIndex++, pPlan->rgCacheActions[2].syncpoint.hEvent); | 764 | ValidateExecuteWaitSyncpoint(pPlan, fRollback, dwIndex++, pPlan->rgCacheActions[5].syncpoint.hEvent); |
759 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 765 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
760 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 766 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
761 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", BURN_DEPENDENCY_ACTION_REGISTER); | 767 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", BURN_DEPENDENCY_ACTION_REGISTER); |
@@ -769,8 +775,11 @@ namespace Bootstrapper | |||
769 | 775 | ||
770 | fRollback = TRUE; | 776 | fRollback = TRUE; |
771 | dwIndex = 0; | 777 | dwIndex = 0; |
772 | dwExecuteCheckpointId = 3; | 778 | dwExecuteCheckpointId = 2; |
773 | ValidateExecuteRollbackBoundary(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | 779 | ValidateExecuteRollbackBoundary(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); |
780 | ValidateExecuteUncachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); | ||
781 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
782 | dwExecuteCheckpointId += 2; // cache checkpoints | ||
774 | ValidateExecuteUncachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | 783 | ValidateExecuteUncachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); |
775 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 784 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
776 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", BURN_DEPENDENCY_ACTION_UNREGISTER); | 785 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", BURN_DEPENDENCY_ACTION_UNREGISTER); |
@@ -793,7 +802,7 @@ namespace Bootstrapper | |||
793 | Assert::Equal(dwIndex, pPlan->cRollbackActions); | 802 | Assert::Equal(dwIndex, pPlan->cRollbackActions); |
794 | 803 | ||
795 | Assert::Equal(2ul, pPlan->cExecutePackagesTotal); | 804 | Assert::Equal(2ul, pPlan->cExecutePackagesTotal); |
796 | Assert::Equal(4ul, pPlan->cOverallProgressTicksTotal); | 805 | Assert::Equal(5ul, pPlan->cOverallProgressTicksTotal); |
797 | 806 | ||
798 | dwIndex = 0; | 807 | dwIndex = 0; |
799 | Assert::Equal(dwIndex, pPlan->cCleanActions); | 808 | Assert::Equal(dwIndex, pPlan->cCleanActions); |