diff options
Diffstat (limited to 'src/engine/plan.cpp')
| -rw-r--r-- | src/engine/plan.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp index 3c0e1c50..e2a3437d 100644 --- a/src/engine/plan.cpp +++ b/src/engine/plan.cpp | |||
| @@ -74,7 +74,9 @@ static BOOL AlreadyPlannedCachePackage( | |||
| 74 | __in_z LPCWSTR wzPackageId, | 74 | __in_z LPCWSTR wzPackageId, |
| 75 | __out HANDLE* phSyncpointEvent | 75 | __out HANDLE* phSyncpointEvent |
| 76 | ); | 76 | ); |
| 77 | static DWORD GetNextCheckpointId(); | 77 | static DWORD GetNextCheckpointId( |
| 78 | __in BURN_PLAN* pPlan | ||
| 79 | ); | ||
| 78 | static HRESULT AppendCacheAction( | 80 | static HRESULT AppendCacheAction( |
| 79 | __in BURN_PLAN* pPlan, | 81 | __in BURN_PLAN* pPlan, |
| 80 | __out BURN_CACHE_ACTION** ppCacheAction | 82 | __out BURN_CACHE_ACTION** ppCacheAction |
| @@ -1621,7 +1623,7 @@ extern "C" HRESULT PlanExecuteCheckpoint( | |||
| 1621 | { | 1623 | { |
| 1622 | HRESULT hr = S_OK; | 1624 | HRESULT hr = S_OK; |
| 1623 | BURN_EXECUTE_ACTION* pAction = NULL; | 1625 | BURN_EXECUTE_ACTION* pAction = NULL; |
| 1624 | DWORD dwCheckpointId = GetNextCheckpointId(); | 1626 | DWORD dwCheckpointId = GetNextCheckpointId(pPlan); |
| 1625 | 1627 | ||
| 1626 | // execute checkpoint | 1628 | // execute checkpoint |
| 1627 | hr = PlanAppendExecuteAction(pPlan, &pAction); | 1629 | hr = PlanAppendExecuteAction(pPlan, &pAction); |
| @@ -1808,7 +1810,7 @@ extern "C" HRESULT PlanRollbackBoundaryComplete( | |||
| 1808 | DWORD dwCheckpointId = 0; | 1810 | DWORD dwCheckpointId = 0; |
| 1809 | 1811 | ||
| 1810 | // Add checkpoints. | 1812 | // Add checkpoints. |
| 1811 | dwCheckpointId = GetNextCheckpointId(); | 1813 | dwCheckpointId = GetNextCheckpointId(pPlan); |
| 1812 | 1814 | ||
| 1813 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); | 1815 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); |
| 1814 | ExitOnFailure(hr, "Failed to append execute action."); | 1816 | ExitOnFailure(hr, "Failed to append execute action."); |
| @@ -2095,7 +2097,7 @@ static HRESULT AddCachePackageHelper( | |||
| 2095 | // Cache checkpoints happen before the package is cached because downloading packages' | 2097 | // Cache checkpoints happen before the package is cached because downloading packages' |
| 2096 | // payloads will not roll themselves back the way installation packages rollback on | 2098 | // payloads will not roll themselves back the way installation packages rollback on |
| 2097 | // failure automatically. | 2099 | // failure automatically. |
| 2098 | dwCheckpoint = GetNextCheckpointId(); | 2100 | dwCheckpoint = GetNextCheckpointId(pPlan); |
| 2099 | 2101 | ||
| 2100 | hr = AppendCacheAction(pPlan, &pCacheAction); | 2102 | hr = AppendCacheAction(pPlan, &pCacheAction); |
| 2101 | ExitOnFailure(hr, "Failed to append package start action."); | 2103 | ExitOnFailure(hr, "Failed to append package start action."); |
| @@ -2234,10 +2236,11 @@ static BOOL AlreadyPlannedCachePackage( | |||
| 2234 | return fPlanned; | 2236 | return fPlanned; |
| 2235 | } | 2237 | } |
| 2236 | 2238 | ||
| 2237 | static DWORD GetNextCheckpointId() | 2239 | static DWORD GetNextCheckpointId( |
| 2240 | __in BURN_PLAN* pPlan | ||
| 2241 | ) | ||
| 2238 | { | 2242 | { |
| 2239 | static DWORD dwCounter = 0; | 2243 | return ++pPlan->dwNextCheckpointId; |
| 2240 | return ++dwCounter; | ||
| 2241 | } | 2244 | } |
| 2242 | 2245 | ||
| 2243 | static HRESULT AppendCacheAction( | 2246 | static HRESULT AppendCacheAction( |
| @@ -3039,11 +3042,11 @@ static void CacheActionLog( | |||
| 3039 | break; | 3042 | break; |
| 3040 | 3043 | ||
| 3041 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: | 3044 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: |
| 3042 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: SIGNAL_SYNCPOINT event handle: 0x%x, skip until retried: %hs", wzBase, iAction, pAction->syncpoint.hEvent, LoggingBoolToString(pAction->fSkipUntilRetried)); | 3045 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: SIGNAL_SYNCPOINT event handle: 0x%p, skip until retried: %hs", wzBase, iAction, pAction->syncpoint.hEvent, LoggingBoolToString(pAction->fSkipUntilRetried)); |
| 3043 | break; | 3046 | break; |
| 3044 | 3047 | ||
| 3045 | case BURN_CACHE_ACTION_TYPE_TRANSACTION_BOUNDARY: | 3048 | case BURN_CACHE_ACTION_TYPE_TRANSACTION_BOUNDARY: |
| 3046 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: TRANSACTION_BOUNDARY id: %ls, event handle: 0x%x, vital: %ls, transaction: %ls", wzBase, iAction, pAction->rollbackBoundary.pRollbackBoundary->sczId, pAction->rollbackBoundary.hEvent, pAction->rollbackBoundary.pRollbackBoundary->fVital ? L"yes" : L"no", pAction->rollbackBoundary.pRollbackBoundary->fTransaction ? L"yes" : L"no"); | 3049 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: TRANSACTION_BOUNDARY id: %ls, event handle: 0x%p, vital: %ls, transaction: %ls", wzBase, iAction, pAction->rollbackBoundary.pRollbackBoundary->sczId, pAction->rollbackBoundary.hEvent, pAction->rollbackBoundary.pRollbackBoundary->fVital ? L"yes" : L"no", pAction->rollbackBoundary.pRollbackBoundary->fTransaction ? L"yes" : L"no"); |
| 3047 | break; | 3050 | break; |
| 3048 | 3051 | ||
| 3049 | default: | 3052 | default: |
| @@ -3066,11 +3069,11 @@ static void ExecuteActionLog( | |||
| 3066 | break; | 3069 | break; |
| 3067 | 3070 | ||
| 3068 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_PROVIDER: | 3071 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_PROVIDER: |
| 3069 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_PROVIDER package id: %ls, action: %u", wzBase, iAction, pAction->packageProvider.pPackage->sczId, pAction->packageProvider.action); | 3072 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_PROVIDER package id: %ls, action: %hs", wzBase, iAction, pAction->packageProvider.pPackage->sczId, LoggingDependencyActionToString(pAction->packageProvider.action)); |
| 3070 | break; | 3073 | break; |
| 3071 | 3074 | ||
| 3072 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: | 3075 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: |
| 3073 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls, action: %u", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey, pAction->packageDependency.action); | 3076 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls, action: %hs", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey, LoggingDependencyActionToString(pAction->packageDependency.action)); |
| 3074 | break; | 3077 | break; |
| 3075 | 3078 | ||
| 3076 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: | 3079 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: |
| @@ -3078,15 +3081,15 @@ static void ExecuteActionLog( | |||
| 3078 | break; | 3081 | break; |
| 3079 | 3082 | ||
| 3080 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: | 3083 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: |
| 3081 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, action msi property: %u, ui level: %u, disable externaluihandler: %ls, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), pAction->msiPackage.actionMsiProperty, pAction->msiPackage.uiLevel, pAction->msiPackage.fDisableExternalUiHandler ? L"yes" : L"no", pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); | 3084 | LogStringLine(REPORT_STANDARD, "%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); |
| 3082 | for (DWORD j = 0; j < pAction->msiPackage.cPatches; ++j) | 3085 | for (DWORD j = 0; j < pAction->msiPackage.cPatches; ++j) |
| 3083 | { | 3086 | { |
| 3084 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->msiPackage.rgOrderedPatches->dwOrder, pAction->msiPackage.rgOrderedPatches[j].dwOrder, pAction->msiPackage.rgOrderedPatches[j].pPackage->sczId); | 3087 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->msiPackage.rgOrderedPatches[j].dwOrder, pAction->msiPackage.rgOrderedPatches[j].pPackage->sczId); |
| 3085 | } | 3088 | } |
| 3086 | break; | 3089 | break; |
| 3087 | 3090 | ||
| 3088 | case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: | 3091 | case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: |
| 3089 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSP_TARGET package id: %ls, action: %hs, target product code: %ls, target per-machine: %ls, action msi property: %u, 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", pAction->mspTarget.actionMsiProperty, pAction->mspTarget.uiLevel, pAction->mspTarget.fDisableExternalUiHandler ? L"yes" : L"no", pAction->mspTarget.sczLogPath); | 3092 | LogStringLine(REPORT_STANDARD, "%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); |
| 3090 | for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j) | 3093 | for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j) |
| 3091 | { | 3094 | { |
| 3092 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId); | 3095 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId); |
| @@ -3106,7 +3109,7 @@ static void ExecuteActionLog( | |||
| 3106 | break; | 3109 | break; |
| 3107 | 3110 | ||
| 3108 | case BURN_EXECUTE_ACTION_TYPE_WAIT_SYNCPOINT: | 3111 | case BURN_EXECUTE_ACTION_TYPE_WAIT_SYNCPOINT: |
| 3109 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: WAIT_SYNCPOINT event handle: 0x%x", wzBase, iAction, pAction->syncpoint.hEvent); | 3112 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: WAIT_SYNCPOINT event handle: 0x%p", wzBase, iAction, pAction->syncpoint.hEvent); |
| 3110 | break; | 3113 | break; |
| 3111 | 3114 | ||
| 3112 | case BURN_EXECUTE_ACTION_TYPE_UNCACHE_PACKAGE: | 3115 | case BURN_EXECUTE_ACTION_TYPE_UNCACHE_PACKAGE: |
| @@ -3131,6 +3134,7 @@ extern "C" void PlanDump( | |||
| 3131 | 3134 | ||
| 3132 | LogStringLine(REPORT_STANDARD, "Plan action: %hs", LoggingBurnActionToString(pPlan->action)); | 3135 | LogStringLine(REPORT_STANDARD, "Plan action: %hs", LoggingBurnActionToString(pPlan->action)); |
| 3133 | LogStringLine(REPORT_STANDARD, " per-machine: %hs", LoggingTrueFalseToString(pPlan->fPerMachine)); | 3136 | LogStringLine(REPORT_STANDARD, " per-machine: %hs", LoggingTrueFalseToString(pPlan->fPerMachine)); |
| 3137 | LogStringLine(REPORT_STANDARD, " disable-rollback: %hs", LoggingTrueFalseToString(pPlan->fDisableRollback)); | ||
| 3134 | LogStringLine(REPORT_STANDARD, " keep registration by default: %hs", LoggingTrueFalseToString(pPlan->fKeepRegistrationDefault)); | 3138 | LogStringLine(REPORT_STANDARD, " keep registration by default: %hs", LoggingTrueFalseToString(pPlan->fKeepRegistrationDefault)); |
| 3135 | LogStringLine(REPORT_STANDARD, " estimated size: %llu", pPlan->qwEstimatedSize); | 3139 | LogStringLine(REPORT_STANDARD, " estimated size: %llu", pPlan->qwEstimatedSize); |
| 3136 | 3140 | ||
