diff options
Diffstat (limited to 'src/burn/engine/plan.cpp')
| -rw-r--r-- | src/burn/engine/plan.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index 7994dd32..edc09033 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
| @@ -376,20 +376,6 @@ extern "C" HRESULT PlanDefaultPackageRequestState( | |||
| 376 | break; | 376 | break; |
| 377 | } | 377 | } |
| 378 | } | 378 | } |
| 379 | else if (BOOTSTRAPPER_RELATION_PATCH == relationType && BURN_PACKAGE_TYPE_MSP == packageType) | ||
| 380 | { | ||
| 381 | // For patch related bundles, only install a patch if currently absent during install, modify, or repair. | ||
| 382 | if (BOOTSTRAPPER_PACKAGE_STATE_ABSENT != currentState) | ||
| 383 | { | ||
| 384 | *pRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; | ||
| 385 | } | ||
| 386 | else if (BOOTSTRAPPER_ACTION_INSTALL == action || | ||
| 387 | BOOTSTRAPPER_ACTION_MODIFY == action || | ||
| 388 | BOOTSTRAPPER_ACTION_REPAIR == action) | ||
| 389 | { | ||
| 390 | *pRequestState = BOOTSTRAPPER_REQUEST_STATE_PRESENT; | ||
| 391 | } | ||
| 392 | } | ||
| 393 | else // pick the best option for the action state and install condition. | 379 | else // pick the best option for the action state and install condition. |
| 394 | { | 380 | { |
| 395 | hr = GetActionDefaultRequestState(action, currentState, &defaultRequestState); | 381 | hr = GetActionDefaultRequestState(action, currentState, &defaultRequestState); |
| @@ -397,12 +383,28 @@ extern "C" HRESULT PlanDefaultPackageRequestState( | |||
| 397 | 383 | ||
| 398 | if (BOOTSTRAPPER_ACTION_UNINSTALL != action && BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL != action) | 384 | if (BOOTSTRAPPER_ACTION_UNINSTALL != action && BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL != action) |
| 399 | { | 385 | { |
| 386 | // For patch related bundles, only install a patch if currently absent during install, modify, or repair. | ||
| 387 | if (BOOTSTRAPPER_RELATION_PATCH == relationType && BURN_PACKAGE_TYPE_MSP == packageType) | ||
| 388 | { | ||
| 389 | if (BOOTSTRAPPER_PACKAGE_STATE_ABSENT != currentState) | ||
| 390 | { | ||
| 391 | defaultRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; | ||
| 392 | } | ||
| 393 | else if (BOOTSTRAPPER_ACTION_INSTALL == action || | ||
| 394 | BOOTSTRAPPER_ACTION_MODIFY == action || | ||
| 395 | BOOTSTRAPPER_ACTION_REPAIR == action) | ||
| 396 | { | ||
| 397 | defaultRequestState = BOOTSTRAPPER_REQUEST_STATE_PRESENT; | ||
| 398 | } | ||
| 399 | } | ||
| 400 | |||
| 400 | // If we're not doing an uninstall, use the install condition | 401 | // If we're not doing an uninstall, use the install condition |
| 401 | // to determine whether to use the default request state or make the package absent. | 402 | // to determine whether to use the default request state or make the package absent. |
| 402 | if (BOOTSTRAPPER_PACKAGE_CONDITION_FALSE == installCondition) | 403 | if (BOOTSTRAPPER_PACKAGE_CONDITION_FALSE == installCondition) |
| 403 | { | 404 | { |
| 404 | defaultRequestState = BOOTSTRAPPER_REQUEST_STATE_ABSENT; | 405 | defaultRequestState = BOOTSTRAPPER_REQUEST_STATE_ABSENT; |
| 405 | } | 406 | } |
| 407 | |||
| 406 | // Obsolete means the package is not on the machine and should not be installed, | 408 | // Obsolete means the package is not on the machine and should not be installed, |
| 407 | // *except* patches can be obsolete and present. | 409 | // *except* patches can be obsolete and present. |
| 408 | // Superseded means the package is on the machine but not active, so only uninstall operations are allowed. | 410 | // Superseded means the package is on the machine but not active, so only uninstall operations are allowed. |
| @@ -1540,7 +1542,7 @@ extern "C" HRESULT PlanRelatedBundlesComplete( | |||
| 1540 | 1542 | ||
| 1541 | if (fBundle && BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) | 1543 | if (fBundle && BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) |
| 1542 | { | 1544 | { |
| 1543 | if (pPackage->cDependencyProviders) | 1545 | if (pPackage && pPackage->cDependencyProviders) |
| 1544 | { | 1546 | { |
| 1545 | // Bundles only support a single provider key. | 1547 | // Bundles only support a single provider key. |
| 1546 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; | 1548 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; |
| @@ -1554,7 +1556,7 @@ extern "C" HRESULT PlanRelatedBundlesComplete( | |||
| 1554 | 1556 | ||
| 1555 | for (DWORD i = 0; i < pRegistration->relatedBundles.cRelatedBundles; ++i) | 1557 | for (DWORD i = 0; i < pRegistration->relatedBundles.cRelatedBundles; ++i) |
| 1556 | { | 1558 | { |
| 1557 | DWORD *pdwInsertIndex = NULL; | 1559 | DWORD* pdwInsertIndex = NULL; |
| 1558 | BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgpPlanSortedRelatedBundles[i]; | 1560 | BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgpPlanSortedRelatedBundles[i]; |
| 1559 | BOOL fDependent = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_ADDON == pRelatedBundle->planRelationType || | 1561 | BOOL fDependent = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_ADDON == pRelatedBundle->planRelationType || |
| 1560 | BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_PATCH == pRelatedBundle->planRelationType; | 1562 | BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_PATCH == pRelatedBundle->planRelationType; |
| @@ -2013,6 +2015,7 @@ extern "C" HRESULT PlanRollbackBoundaryComplete( | |||
| 2013 | 2015 | ||
| 2014 | // Add checkpoints. | 2016 | // Add checkpoints. |
| 2015 | hr = PlanExecuteCheckpoint(pPlan); | 2017 | hr = PlanExecuteCheckpoint(pPlan); |
| 2018 | ExitOnFailure(hr, "Failed to append execute checkpoint for rollback boundary complete."); | ||
| 2016 | 2019 | ||
| 2017 | // Add complete rollback boundary to execute plan. | 2020 | // Add complete rollback boundary to execute plan. |
| 2018 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); | 2021 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); |
| @@ -2948,9 +2951,9 @@ static void ExecuteActionLog( | |||
| 2948 | 2951 | ||
| 2949 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: | 2952 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: |
| 2950 | LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey); | 2953 | LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey); |
| 2951 | for (DWORD j = 0; j < pAction->packageProvider.pPackage->cDependencyProviders; ++j) | 2954 | for (DWORD j = 0; j < pAction->packageDependency.pPackage->cDependencyProviders; ++j) |
| 2952 | { | 2955 | { |
| 2953 | const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageProvider.pPackage->rgDependencyProviders + j; | 2956 | const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageDependency.pPackage->rgDependencyProviders + j; |
| 2954 | LogStringLine(PlanDumpLevel, " Provider[%u]: key: %ls, action: %hs", j, pProvider->sczKey, LoggingDependencyActionToString(fRollback ? pProvider->dependentRollback : pProvider->dependentExecute)); | 2957 | LogStringLine(PlanDumpLevel, " Provider[%u]: key: %ls, action: %hs", j, pProvider->sczKey, LoggingDependencyActionToString(fRollback ? pProvider->dependentRollback : pProvider->dependentExecute)); |
| 2955 | } | 2958 | } |
| 2956 | break; | 2959 | break; |
