aboutsummaryrefslogtreecommitdiff
path: root/src/engine/plan.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/engine/plan.cpp52
1 files changed, 35 insertions, 17 deletions
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp
index d99fdde2..95ea0b05 100644
--- a/src/engine/plan.cpp
+++ b/src/engine/plan.cpp
@@ -149,7 +149,7 @@ static BURN_CACHE_ACTION* ProcessSharedPayload(
149 __in BURN_PLAN* pPlan, 149 __in BURN_PLAN* pPlan,
150 __in BURN_PAYLOAD* pPayload 150 __in BURN_PAYLOAD* pPayload
151 ); 151 );
152static HRESULT RemoveUnnecessaryActions( 152static void RemoveUnnecessaryActions(
153 __in BOOL fExecute, 153 __in BOOL fExecute,
154 __in BURN_EXECUTE_ACTION* rgActions, 154 __in BURN_EXECUTE_ACTION* rgActions,
155 __in DWORD cActions 155 __in DWORD cActions
@@ -302,7 +302,6 @@ extern "C" void PlanUninitializeExecuteAction(
302 ReleaseStr(pExecuteAction->msiPackage.sczLogPath); 302 ReleaseStr(pExecuteAction->msiPackage.sczLogPath);
303 ReleaseMem(pExecuteAction->msiPackage.rgFeatures); 303 ReleaseMem(pExecuteAction->msiPackage.rgFeatures);
304 ReleaseMem(pExecuteAction->msiPackage.rgSlipstreamPatches); 304 ReleaseMem(pExecuteAction->msiPackage.rgSlipstreamPatches);
305 ReleaseMem(pExecuteAction->msiPackage.rgOrderedPatches);
306 break; 305 break;
307 306
308 case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: 307 case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET:
@@ -1499,11 +1498,9 @@ extern "C" HRESULT PlanFinalizeActions(
1499{ 1498{
1500 HRESULT hr = S_OK; 1499 HRESULT hr = S_OK;
1501 1500
1502 hr = RemoveUnnecessaryActions(TRUE, pPlan->rgExecuteActions, pPlan->cExecuteActions); 1501 RemoveUnnecessaryActions(TRUE, pPlan->rgExecuteActions, pPlan->cExecuteActions);
1503 ExitOnFailure(hr, "Failed to remove unnecessary execute actions.");
1504 1502
1505 hr = RemoveUnnecessaryActions(FALSE, pPlan->rgRollbackActions, pPlan->cRollbackActions); 1503 RemoveUnnecessaryActions(FALSE, pPlan->rgRollbackActions, pPlan->cRollbackActions);
1506 ExitOnFailure(hr, "Failed to remove unnecessary execute actions.");
1507 1504
1508 hr = FinalizeSlipstreamPatchActions(TRUE, pPlan->rgExecuteActions, pPlan->cExecuteActions); 1505 hr = FinalizeSlipstreamPatchActions(TRUE, pPlan->rgExecuteActions, pPlan->cExecuteActions);
1509 ExitOnFailure(hr, "Failed to finalize slipstream execute actions."); 1506 ExitOnFailure(hr, "Failed to finalize slipstream execute actions.");
@@ -1890,9 +1887,12 @@ static void ResetPlannedPackageState(
1890 { 1887 {
1891 BURN_MSPTARGETPRODUCT* pTargetProduct = &pPackage->Msp.rgTargetProducts[i]; 1888 BURN_MSPTARGETPRODUCT* pTargetProduct = &pPackage->Msp.rgTargetProducts[i];
1892 1889
1890 pTargetProduct->defaultRequested = BOOTSTRAPPER_REQUEST_STATE_NONE;
1893 pTargetProduct->requested = BOOTSTRAPPER_REQUEST_STATE_NONE; 1891 pTargetProduct->requested = BOOTSTRAPPER_REQUEST_STATE_NONE;
1894 pTargetProduct->execute = BOOTSTRAPPER_ACTION_STATE_NONE; 1892 pTargetProduct->execute = BOOTSTRAPPER_ACTION_STATE_NONE;
1895 pTargetProduct->rollback = BOOTSTRAPPER_ACTION_STATE_NONE; 1893 pTargetProduct->rollback = BOOTSTRAPPER_ACTION_STATE_NONE;
1894 pTargetProduct->executeSkip = BURN_PATCH_SKIP_STATE_NONE;
1895 pTargetProduct->rollbackSkip = BURN_PATCH_SKIP_STATE_NONE;
1896 } 1896 }
1897 } 1897 }
1898} 1898}
@@ -2704,13 +2704,12 @@ static BURN_CACHE_ACTION* ProcessSharedPayload(
2704 return pAcquireAction; 2704 return pAcquireAction;
2705} 2705}
2706 2706
2707static HRESULT RemoveUnnecessaryActions( 2707static void RemoveUnnecessaryActions(
2708 __in BOOL fExecute, 2708 __in BOOL fExecute,
2709 __in BURN_EXECUTE_ACTION* rgActions, 2709 __in BURN_EXECUTE_ACTION* rgActions,
2710 __in DWORD cActions 2710 __in DWORD cActions
2711 ) 2711 )
2712{ 2712{
2713 HRESULT hr = S_OK;
2714 LPCSTR szExecuteOrRollback = fExecute ? "execute" : "rollback"; 2713 LPCSTR szExecuteOrRollback = fExecute ? "execute" : "rollback";
2715 2714
2716 for (DWORD i = 0; i < cActions; ++i) 2715 for (DWORD i = 0; i < cActions; ++i)
@@ -2722,10 +2721,11 @@ static HRESULT RemoveUnnecessaryActions(
2722 if (BURN_EXECUTE_ACTION_TYPE_MSP_TARGET == pAction->type && pAction->mspTarget.pChainedTargetPackage) 2721 if (BURN_EXECUTE_ACTION_TYPE_MSP_TARGET == pAction->type && pAction->mspTarget.pChainedTargetPackage)
2723 { 2722 {
2724 BOOTSTRAPPER_ACTION_STATE chainedTargetPackageAction = fExecute ? pAction->mspTarget.pChainedTargetPackage->execute : pAction->mspTarget.pChainedTargetPackage->rollback; 2723 BOOTSTRAPPER_ACTION_STATE chainedTargetPackageAction = fExecute ? pAction->mspTarget.pChainedTargetPackage->execute : pAction->mspTarget.pChainedTargetPackage->rollback;
2724 BURN_PATCH_SKIP_STATE skipState = BURN_PATCH_SKIP_STATE_NONE;
2725 if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == chainedTargetPackageAction) 2725 if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == chainedTargetPackageAction)
2726 { 2726 {
2727 skipState = BURN_PATCH_SKIP_STATE_TARGET_UNINSTALL;
2727 LogId(REPORT_STANDARD, MSG_PLAN_SKIP_PATCH_ACTION, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.pChainedTargetPackage->sczId, LoggingActionStateToString(chainedTargetPackageAction), szExecuteOrRollback); 2728 LogId(REPORT_STANDARD, MSG_PLAN_SKIP_PATCH_ACTION, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.pChainedTargetPackage->sczId, LoggingActionStateToString(chainedTargetPackageAction), szExecuteOrRollback);
2728 pAction->fDeleted = TRUE;
2729 } 2729 }
2730 else if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL < chainedTargetPackageAction && pAction->mspTarget.fSlipstream && BOOTSTRAPPER_ACTION_STATE_UNINSTALL < pAction->mspTarget.action) 2730 else if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL < chainedTargetPackageAction && pAction->mspTarget.fSlipstream && BOOTSTRAPPER_ACTION_STATE_UNINSTALL < pAction->mspTarget.action)
2731 { 2731 {
@@ -2737,14 +2737,31 @@ static HRESULT RemoveUnnecessaryActions(
2737 // is already on the machine. The slipstream must be installed standalone if the MSI is being repaired. 2737 // is already on the machine. The slipstream must be installed standalone if the MSI is being repaired.
2738 if (BOOTSTRAPPER_ACTION_STATE_REPAIR != chainedTargetPackageAction || BOOTSTRAPPER_ACTION_STATE_REPAIR == pAction->mspTarget.action) 2738 if (BOOTSTRAPPER_ACTION_STATE_REPAIR != chainedTargetPackageAction || BOOTSTRAPPER_ACTION_STATE_REPAIR == pAction->mspTarget.action)
2739 { 2739 {
2740 skipState = BURN_PATCH_SKIP_STATE_SLIPSTREAM;
2740 LogId(REPORT_STANDARD, MSG_PLAN_SKIP_SLIPSTREAM_ACTION, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.pChainedTargetPackage->sczId, LoggingActionStateToString(chainedTargetPackageAction), szExecuteOrRollback); 2741 LogId(REPORT_STANDARD, MSG_PLAN_SKIP_SLIPSTREAM_ACTION, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.pChainedTargetPackage->sczId, LoggingActionStateToString(chainedTargetPackageAction), szExecuteOrRollback);
2741 pAction->fDeleted = TRUE; 2742 }
2743 }
2744
2745 if (BURN_PATCH_SKIP_STATE_NONE != skipState)
2746 {
2747 pAction->fDeleted = TRUE;
2748
2749 for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j)
2750 {
2751 BURN_MSPTARGETPRODUCT* pTargetProduct = pAction->mspTarget.rgOrderedPatches[j].pTargetProduct;
2752
2753 if (fExecute)
2754 {
2755 pTargetProduct->executeSkip = skipState;
2756 }
2757 else
2758 {
2759 pTargetProduct->rollbackSkip = skipState;
2760 }
2742 } 2761 }
2743 } 2762 }
2744 } 2763 }
2745 } 2764 }
2746
2747 return hr;
2748} 2765}
2749 2766
2750static HRESULT FinalizeSlipstreamPatchActions( 2767static HRESULT FinalizeSlipstreamPatchActions(
@@ -3047,17 +3064,13 @@ static void ExecuteActionLog(
3047 3064
3048 case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: 3065 case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE:
3049 LogStringLine(PlanDumpLevel, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, action msi property: %ls, ui level: %u, disable externaluihandler: %ls, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), LoggingBurnMsiPropertyToString(pAction->msiPackage.actionMsiProperty), pAction->msiPackage.uiLevel, pAction->msiPackage.fDisableExternalUiHandler ? L"yes" : L"no", pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); 3066 LogStringLine(PlanDumpLevel, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, action msi property: %ls, ui level: %u, disable externaluihandler: %ls, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), LoggingBurnMsiPropertyToString(pAction->msiPackage.actionMsiProperty), pAction->msiPackage.uiLevel, pAction->msiPackage.fDisableExternalUiHandler ? L"yes" : L"no", pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes);
3050 for (DWORD j = 0; j < pAction->msiPackage.cPatches; ++j)
3051 {
3052 LogStringLine(PlanDumpLevel, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->msiPackage.rgOrderedPatches[j].dwOrder, pAction->msiPackage.rgOrderedPatches[j].pPackage->sczId);
3053 }
3054 break; 3067 break;
3055 3068
3056 case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: 3069 case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET:
3057 LogStringLine(PlanDumpLevel, "%ls action[%u]: MSP_TARGET package id: %ls, action: %hs, target product code: %ls, target per-machine: %ls, action msi property: %ls, ui level: %u, disable externaluihandler: %ls, log path: %ls", wzBase, iAction, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.sczTargetProductCode, pAction->mspTarget.fPerMachineTarget ? L"yes" : L"no", LoggingBurnMsiPropertyToString(pAction->mspTarget.actionMsiProperty), pAction->mspTarget.uiLevel, pAction->mspTarget.fDisableExternalUiHandler ? L"yes" : L"no", pAction->mspTarget.sczLogPath); 3070 LogStringLine(PlanDumpLevel, "%ls action[%u]: MSP_TARGET package id: %ls, action: %hs, target product code: %ls, target per-machine: %ls, action msi property: %ls, ui level: %u, disable externaluihandler: %ls, log path: %ls", wzBase, iAction, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.sczTargetProductCode, pAction->mspTarget.fPerMachineTarget ? L"yes" : L"no", LoggingBurnMsiPropertyToString(pAction->mspTarget.actionMsiProperty), pAction->mspTarget.uiLevel, pAction->mspTarget.fDisableExternalUiHandler ? L"yes" : L"no", pAction->mspTarget.sczLogPath);
3058 for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j) 3071 for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j)
3059 { 3072 {
3060 LogStringLine(PlanDumpLevel, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId); 3073 LogStringLine(PlanDumpLevel, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].pTargetProduct->dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId);
3061 } 3074 }
3062 break; 3075 break;
3063 3076
@@ -3089,6 +3102,11 @@ static void ExecuteActionLog(
3089 AssertSz(FALSE, "Unknown execute action type."); 3102 AssertSz(FALSE, "Unknown execute action type.");
3090 break; 3103 break;
3091 } 3104 }
3105
3106 if (pAction->fDeleted)
3107 {
3108 LogStringLine(PlanDumpLevel, " (deleted action)");
3109 }
3092} 3110}
3093 3111
3094extern "C" void PlanDump( 3112extern "C" void PlanDump(