diff options
| author | Bob Arnson <bob@firegiant.com> | 2026-01-22 20:34:41 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2026-01-23 14:52:50 -0500 |
| commit | 2979e2a6e26f3736c3fa7a49f6bbb52d4cd69f92 (patch) | |
| tree | b0cd8949bc8cef62739cc0e34fe5d226cce87869 /src/burn/engine/plan.cpp | |
| parent | 6e5d4330049dce6a91327d2ad36790a1ea34db3f (diff) | |
| download | wix-2979e2a6e26f3736c3fa7a49f6bbb52d4cd69f92.tar.gz wix-2979e2a6e26f3736c3fa7a49f6bbb52d4cd69f92.tar.bz2 wix-2979e2a6e26f3736c3fa7a49f6bbb52d4cd69f92.zip | |
Correctly plan related patch bundle uninstall.
Based on https://github.com/wixtoolset/wix/pull/654/.
Diffstat (limited to 'src/burn/engine/plan.cpp')
| -rw-r--r-- | src/burn/engine/plan.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index 7994dd32..a6196e3c 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. |
| @@ -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; |
