@@ -376,33 +376,35 @@ extern "C" HRESULT PlanDefaultPackageRequestState(
376376 break ;
377377 }
378378 }
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- }
393379 else // pick the best option for the action state and install condition.
394380 {
395381 hr = GetActionDefaultRequestState (action, currentState, &defaultRequestState);
396382 ExitOnFailure (hr, " Failed to get default request state for action." );
397383
398384 if (BOOTSTRAPPER_ACTION_UNINSTALL != action && BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL != action)
399385 {
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+
400401 // If we're not doing an uninstall, use the install condition
401402 // to determine whether to use the default request state or make the package absent.
402403 if (BOOTSTRAPPER_PACKAGE_CONDITION_FALSE == installCondition)
403404 {
404405 defaultRequestState = BOOTSTRAPPER_REQUEST_STATE_ABSENT;
405406 }
407+
406408 // Obsolete means the package is not on the machine and should not be installed,
407409 // *except* patches can be obsolete and present.
408410 // 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(
15541556
15551557 for (DWORD i = 0 ; i < pRegistration->relatedBundles .cRelatedBundles ; ++i)
15561558 {
1557- DWORD * pdwInsertIndex = NULL ;
1559+ DWORD* pdwInsertIndex = NULL ;
15581560 BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles .rgpPlanSortedRelatedBundles [i];
15591561 BOOL fDependent = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_ADDON == pRelatedBundle->planRelationType ||
15601562 BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_PATCH == pRelatedBundle->planRelationType ;
0 commit comments