From a2f2036c8598efcb434eebeeacd7ede84ab60dfe Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 3 May 2021 21:14:52 -0500 Subject: 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 --- src/burn/engine/plan.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/burn/engine/plan.cpp') 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( ) { HRESULT hr = S_OK; - BOOL fRequestedCache = BOOTSTRAPPER_REQUEST_STATE_CACHE == pPackage->requested || ForceCache(pPlan, pPackage); + BOOL fRequestedCache = BOOTSTRAPPER_CACHE_TYPE_REMOVE < pPackage->cacheType && (BOOTSTRAPPER_REQUEST_STATE_CACHE == pPackage->requested || ForceCache(pPlan, pPackage)); hr = CalculateExecuteActions(pPackage, pPlan->pActiveRollbackBoundary); ExitOnFailure(hr, "Failed to calculate plan actions for package: %ls", pPackage->sczId); @@ -2531,8 +2531,19 @@ static BOOL ForceCache( __in BURN_PACKAGE* pPackage ) { - // All packages that have cacheType set to force should be cached if the bundle is going to be present. - return BOOTSTRAPPER_CACHE_TYPE_FORCE == pPackage->cacheType && BOOTSTRAPPER_ACTION_UNINSTALL < pPlan->action; + switch (pPackage->cacheType) + { + case BOOTSTRAPPER_CACHE_TYPE_KEEP: + // 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. + return (BOOTSTRAPPER_ACTION_CACHE == pPlan->action || BOOTSTRAPPER_ACTION_INSTALL == pPlan->action) && + BOOTSTRAPPER_REQUEST_STATE_CACHE < pPackage->requested; + case BOOTSTRAPPER_CACHE_TYPE_FORCE: + // All packages that have cacheType set to force should be cached if the bundle is going to be present. + return BOOTSTRAPPER_ACTION_UNINSTALL < pPlan->action; + default: + return FALSE; + } } static void CacheActionLog( -- cgit v1.2.3-55-g6feb