diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-02-21 11:54:54 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-02-22 20:25:06 -0600 |
| commit | d0d93beac0b79fa9c3d43398813954988afda18f (patch) | |
| tree | 5009bb6df65fb5c89ed12a6fbb26b36eafc1f1da /src | |
| parent | 837f2e309c8ef0476668c342f612dfe1bb26cb87 (diff) | |
| download | wix-d0d93beac0b79fa9c3d43398813954988afda18f.tar.gz wix-d0d93beac0b79fa9c3d43398813954988afda18f.tar.bz2 wix-d0d93beac0b79fa9c3d43398813954988afda18f.zip | |
Add logging for patch target products.
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/core.cpp | 11 | ||||
| -rw-r--r-- | src/engine/elevation.cpp | 7 | ||||
| -rw-r--r-- | src/engine/engine.mc | 14 | ||||
| -rw-r--r-- | src/engine/logging.cpp | 18 | ||||
| -rw-r--r-- | src/engine/logging.h | 5 | ||||
| -rw-r--r-- | src/engine/mspengine.cpp | 6 | ||||
| -rw-r--r-- | src/engine/package.h | 10 | ||||
| -rw-r--r-- | src/engine/plan.cpp | 52 | ||||
| -rw-r--r-- | src/engine/plan.h | 6 |
9 files changed, 98 insertions, 31 deletions
diff --git a/src/engine/core.cpp b/src/engine/core.cpp index b68681fb..1a079973 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp | |||
| @@ -1822,6 +1822,17 @@ static void LogPackages( | |||
| 1822 | LogId(REPORT_STANDARD, MSG_PLANNED_MSI_FEATURE, pFeature->sczId, LoggingMsiFeatureStateToString(pFeature->currentState), LoggingMsiFeatureStateToString(pFeature->defaultRequested), LoggingMsiFeatureStateToString(pFeature->requested), LoggingMsiFeatureActionToString(pFeature->execute), LoggingMsiFeatureActionToString(pFeature->rollback)); | 1822 | LogId(REPORT_STANDARD, MSG_PLANNED_MSI_FEATURE, pFeature->sczId, LoggingMsiFeatureStateToString(pFeature->currentState), LoggingMsiFeatureStateToString(pFeature->defaultRequested), LoggingMsiFeatureStateToString(pFeature->requested), LoggingMsiFeatureActionToString(pFeature->execute), LoggingMsiFeatureActionToString(pFeature->rollback)); |
| 1823 | } | 1823 | } |
| 1824 | } | 1824 | } |
| 1825 | else if (BURN_PACKAGE_TYPE_MSP == pPackage->type && pPackage->Msp.cTargetProductCodes) | ||
| 1826 | { | ||
| 1827 | LogId(REPORT_STANDARD, MSG_PLANNED_MSP_TARGETS, pPackage->Msp.cTargetProductCodes, pPackage->sczId); | ||
| 1828 | |||
| 1829 | for (DWORD j = 0; j < pPackage->Msp.cTargetProductCodes; ++j) | ||
| 1830 | { | ||
| 1831 | const BURN_MSPTARGETPRODUCT* pTargetProduct = &pPackage->Msp.rgTargetProducts[j]; | ||
| 1832 | |||
| 1833 | LogId(REPORT_STANDARD, MSG_PLANNED_MSP_TARGET, pTargetProduct->wzTargetProductCode, LoggingPackageStateToString(pTargetProduct->patchPackageState), LoggingRequestStateToString(pTargetProduct->defaultRequested), LoggingRequestStateToString(pTargetProduct->requested), LoggingMspTargetActionToString(pTargetProduct->execute, pTargetProduct->executeSkip), LoggingMspTargetActionToString(pTargetProduct->rollback, pTargetProduct->rollbackSkip)); | ||
| 1834 | } | ||
| 1835 | } | ||
| 1825 | } | 1836 | } |
| 1826 | 1837 | ||
| 1827 | // Display related bundles last if caching, installing, modifying, or repairing. | 1838 | // Display related bundles last if caching, installing, modifying, or repairing. |
diff --git a/src/engine/elevation.cpp b/src/engine/elevation.cpp index cd0c9387..e4af1840 100644 --- a/src/engine/elevation.cpp +++ b/src/engine/elevation.cpp | |||
| @@ -855,7 +855,6 @@ extern "C" HRESULT ElevationExecuteMsiPackage( | |||
| 855 | DWORD dwResult = 0; | 855 | DWORD dwResult = 0; |
| 856 | 856 | ||
| 857 | // serialize message data | 857 | // serialize message data |
| 858 | // TODO: for patching we might not have a package | ||
| 859 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->msiPackage.pPackage->sczId); | 858 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->msiPackage.pPackage->sczId); |
| 860 | ExitOnFailure(hr, "Failed to write package id to message buffer."); | 859 | ExitOnFailure(hr, "Failed to write package id to message buffer."); |
| 861 | 860 | ||
| @@ -964,9 +963,6 @@ extern "C" HRESULT ElevationExecuteMspPackage( | |||
| 964 | 963 | ||
| 965 | for (DWORD i = 0; i < pExecuteAction->mspTarget.cOrderedPatches; ++i) | 964 | for (DWORD i = 0; i < pExecuteAction->mspTarget.cOrderedPatches; ++i) |
| 966 | { | 965 | { |
| 967 | hr = BuffWriteNumber(&pbData, &cbData, pExecuteAction->mspTarget.rgOrderedPatches[i].dwOrder); | ||
| 968 | ExitOnFailure(hr, "Failed to write ordered patch order to message buffer."); | ||
| 969 | |||
| 970 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->mspTarget.rgOrderedPatches[i].pPackage->sczId); | 966 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->mspTarget.rgOrderedPatches[i].pPackage->sczId); |
| 971 | ExitOnFailure(hr, "Failed to write ordered patch id to message buffer."); | 967 | ExitOnFailure(hr, "Failed to write ordered patch id to message buffer."); |
| 972 | } | 968 | } |
| @@ -2404,9 +2400,6 @@ static HRESULT OnExecuteMspPackage( | |||
| 2404 | 2400 | ||
| 2405 | for (DWORD i = 0; i < executeAction.mspTarget.cOrderedPatches; ++i) | 2401 | for (DWORD i = 0; i < executeAction.mspTarget.cOrderedPatches; ++i) |
| 2406 | { | 2402 | { |
| 2407 | hr = BuffReadNumber(pbData, cbData, &iData, &executeAction.mspTarget.rgOrderedPatches[i].dwOrder); | ||
| 2408 | ExitOnFailure(hr, "Failed to read ordered patch order number."); | ||
| 2409 | |||
| 2410 | hr = BuffReadString(pbData, cbData, &iData, &sczPackage); | 2403 | hr = BuffReadString(pbData, cbData, &iData, &sczPackage); |
| 2411 | ExitOnFailure(hr, "Failed to read ordered patch package id."); | 2404 | ExitOnFailure(hr, "Failed to read ordered patch package id."); |
| 2412 | 2405 | ||
diff --git a/src/engine/engine.mc b/src/engine/engine.mc index fb11430b..1cdde207 100644 --- a/src/engine/engine.mc +++ b/src/engine/engine.mc | |||
| @@ -415,6 +415,20 @@ Language=English | |||
| 415 | Plan skipped dependent bundle repair: %1!ls!, type: %2!hs!, because no packages are being executed during this uninstall operation. | 415 | Plan skipped dependent bundle repair: %1!ls!, type: %2!hs!, because no packages are being executed during this uninstall operation. |
| 416 | . | 416 | . |
| 417 | 417 | ||
| 418 | MessageId=218 | ||
| 419 | Severity=Success | ||
| 420 | SymbolicName=MSG_PLANNED_MSP_TARGETS | ||
| 421 | Language=English | ||
| 422 | Plan %1!u! patch targets for package: %2!ls! | ||
| 423 | . | ||
| 424 | |||
| 425 | MessageId=219 | ||
| 426 | Severity=Success | ||
| 427 | SymbolicName=MSG_PLANNED_MSP_TARGET | ||
| 428 | Language=English | ||
| 429 | Planned patch target: %1!ls!, state: %2!hs!, default requested: %3!hs!, ba requested: %4!hs!, execute: %5!hs!, rollback: %6!hs! | ||
| 430 | . | ||
| 431 | |||
| 418 | MessageId=299 | 432 | MessageId=299 |
| 419 | Severity=Success | 433 | Severity=Success |
| 420 | SymbolicName=MSG_PLAN_COMPLETE | 434 | SymbolicName=MSG_PLAN_COMPLETE |
diff --git a/src/engine/logging.cpp b/src/engine/logging.cpp index a9646218..d66f7cf5 100644 --- a/src/engine/logging.cpp +++ b/src/engine/logging.cpp | |||
| @@ -531,6 +531,24 @@ extern "C" LPCWSTR LoggingBurnMsiPropertyToString( | |||
| 531 | } | 531 | } |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | extern "C" LPCSTR LoggingMspTargetActionToString( | ||
| 535 | __in BOOTSTRAPPER_ACTION_STATE action, | ||
| 536 | __in BURN_PATCH_SKIP_STATE skipState | ||
| 537 | ) | ||
| 538 | { | ||
| 539 | switch (skipState) | ||
| 540 | { | ||
| 541 | case BURN_PATCH_SKIP_STATE_NONE: | ||
| 542 | return LoggingActionStateToString(action); | ||
| 543 | case BURN_PATCH_SKIP_STATE_TARGET_UNINSTALL: | ||
| 544 | return "Skipped (target uninstall)"; | ||
| 545 | case BURN_PATCH_SKIP_STATE_SLIPSTREAM: | ||
| 546 | return "Skipped (slipstream)"; | ||
| 547 | default: | ||
| 548 | return "Invalid"; | ||
| 549 | } | ||
| 550 | } | ||
| 551 | |||
| 534 | extern "C" LPCSTR LoggingPerMachineToString( | 552 | extern "C" LPCSTR LoggingPerMachineToString( |
| 535 | __in BOOL fPerMachine | 553 | __in BOOL fPerMachine |
| 536 | ) | 554 | ) |
diff --git a/src/engine/logging.h b/src/engine/logging.h index 49a8ef5d..a69e34c5 100644 --- a/src/engine/logging.h +++ b/src/engine/logging.h | |||
| @@ -114,6 +114,11 @@ LPCWSTR LoggingBurnMsiPropertyToString( | |||
| 114 | __in BURN_MSI_PROPERTY burnMsiProperty | 114 | __in BURN_MSI_PROPERTY burnMsiProperty |
| 115 | ); | 115 | ); |
| 116 | 116 | ||
| 117 | LPCSTR LoggingMspTargetActionToString( | ||
| 118 | __in BOOTSTRAPPER_ACTION_STATE action, | ||
| 119 | __in BURN_PATCH_SKIP_STATE skipState | ||
| 120 | ); | ||
| 121 | |||
| 117 | LPCSTR LoggingPerMachineToString( | 122 | LPCSTR LoggingPerMachineToString( |
| 118 | __in BOOL fPerMachine | 123 | __in BOOL fPerMachine |
| 119 | ); | 124 | ); |
diff --git a/src/engine/mspengine.cpp b/src/engine/mspengine.cpp index 81e85e4c..14db27a6 100644 --- a/src/engine/mspengine.cpp +++ b/src/engine/mspengine.cpp | |||
| @@ -290,7 +290,7 @@ extern "C" HRESULT MspEnginePlanInitializePackage( | |||
| 290 | { | 290 | { |
| 291 | BURN_MSPTARGETPRODUCT* pTargetProduct = pPackage->Msp.rgTargetProducts + i; | 291 | BURN_MSPTARGETPRODUCT* pTargetProduct = pPackage->Msp.rgTargetProducts + i; |
| 292 | 292 | ||
| 293 | pTargetProduct->requested = pPackage->requested; | 293 | pTargetProduct->defaultRequested = pTargetProduct->requested = pPackage->requested; |
| 294 | 294 | ||
| 295 | hr = UserExperienceOnPlanPatchTarget(pUserExperience, pPackage->sczId, pTargetProduct->wzTargetProductCode, &pTargetProduct->requested); | 295 | hr = UserExperienceOnPlanPatchTarget(pUserExperience, pPackage->sczId, pTargetProduct->wzTargetProductCode, &pTargetProduct->requested); |
| 296 | ExitOnRootFailure(hr, "BA aborted plan patch target."); | 296 | ExitOnRootFailure(hr, "BA aborted plan patch target."); |
| @@ -1086,14 +1086,14 @@ static HRESULT PlanTargetProduct( | |||
| 1086 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&pAction->mspTarget.rgOrderedPatches), pAction->mspTarget.cOrderedPatches + 1, sizeof(BURN_ORDERED_PATCHES), 2); | 1086 | hr = MemEnsureArraySize(reinterpret_cast<LPVOID*>(&pAction->mspTarget.rgOrderedPatches), pAction->mspTarget.cOrderedPatches + 1, sizeof(BURN_ORDERED_PATCHES), 2); |
| 1087 | ExitOnFailure(hr, "Failed grow array of ordered patches."); | 1087 | ExitOnFailure(hr, "Failed grow array of ordered patches."); |
| 1088 | 1088 | ||
| 1089 | pAction->mspTarget.rgOrderedPatches[pAction->mspTarget.cOrderedPatches].dwOrder = pTargetProduct->dwOrder; | 1089 | pAction->mspTarget.rgOrderedPatches[pAction->mspTarget.cOrderedPatches].pTargetProduct = pTargetProduct; |
| 1090 | pAction->mspTarget.rgOrderedPatches[pAction->mspTarget.cOrderedPatches].pPackage = pPackage; | 1090 | pAction->mspTarget.rgOrderedPatches[pAction->mspTarget.cOrderedPatches].pPackage = pPackage; |
| 1091 | ++pAction->mspTarget.cOrderedPatches; | 1091 | ++pAction->mspTarget.cOrderedPatches; |
| 1092 | 1092 | ||
| 1093 | // Insertion sort to keep the patches ordered. | 1093 | // Insertion sort to keep the patches ordered. |
| 1094 | for (DWORD i = pAction->mspTarget.cOrderedPatches - 1; i > 0; --i) | 1094 | for (DWORD i = pAction->mspTarget.cOrderedPatches - 1; i > 0; --i) |
| 1095 | { | 1095 | { |
| 1096 | if (pAction->mspTarget.rgOrderedPatches[i].dwOrder < pAction->mspTarget.rgOrderedPatches[i - 1].dwOrder) | 1096 | if (pAction->mspTarget.rgOrderedPatches[i].pTargetProduct->dwOrder < pAction->mspTarget.rgOrderedPatches[i - 1].pTargetProduct->dwOrder) |
| 1097 | { | 1097 | { |
| 1098 | BURN_ORDERED_PATCHES temp = pAction->mspTarget.rgOrderedPatches[i - 1]; | 1098 | BURN_ORDERED_PATCHES temp = pAction->mspTarget.rgOrderedPatches[i - 1]; |
| 1099 | pAction->mspTarget.rgOrderedPatches[i - 1] = pAction->mspTarget.rgOrderedPatches[i]; | 1099 | pAction->mspTarget.rgOrderedPatches[i - 1] = pAction->mspTarget.rgOrderedPatches[i]; |
diff --git a/src/engine/package.h b/src/engine/package.h index 5feb3f46..3a243c7d 100644 --- a/src/engine/package.h +++ b/src/engine/package.h | |||
| @@ -86,6 +86,13 @@ enum BURN_PACKAGE_REGISTRATION_STATE | |||
| 86 | BURN_PACKAGE_REGISTRATION_STATE_PRESENT, | 86 | BURN_PACKAGE_REGISTRATION_STATE_PRESENT, |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | enum BURN_PATCH_SKIP_STATE | ||
| 90 | { | ||
| 91 | BURN_PATCH_SKIP_STATE_NONE, | ||
| 92 | BURN_PATCH_SKIP_STATE_TARGET_UNINSTALL, | ||
| 93 | BURN_PATCH_SKIP_STATE_SLIPSTREAM, | ||
| 94 | }; | ||
| 95 | |||
| 89 | // structs | 96 | // structs |
| 90 | 97 | ||
| 91 | typedef struct _BURN_EXE_EXIT_CODE | 98 | typedef struct _BURN_EXE_EXIT_CODE |
| @@ -112,9 +119,12 @@ typedef struct _BURN_MSPTARGETPRODUCT | |||
| 112 | BOOL fSlipstream; | 119 | BOOL fSlipstream; |
| 113 | 120 | ||
| 114 | BOOTSTRAPPER_PACKAGE_STATE patchPackageState; // only valid after Detect. | 121 | BOOTSTRAPPER_PACKAGE_STATE patchPackageState; // only valid after Detect. |
| 122 | BOOTSTRAPPER_REQUEST_STATE defaultRequested; // only valid during Plan. | ||
| 115 | BOOTSTRAPPER_REQUEST_STATE requested; // only valid during Plan. | 123 | BOOTSTRAPPER_REQUEST_STATE requested; // only valid during Plan. |
| 116 | BOOTSTRAPPER_ACTION_STATE execute; // only valid during Plan. | 124 | BOOTSTRAPPER_ACTION_STATE execute; // only valid during Plan. |
| 117 | BOOTSTRAPPER_ACTION_STATE rollback; // only valid during Plan. | 125 | BOOTSTRAPPER_ACTION_STATE rollback; // only valid during Plan. |
| 126 | BURN_PATCH_SKIP_STATE executeSkip; // only valid during Plan. | ||
| 127 | BURN_PATCH_SKIP_STATE rollbackSkip; // only valid during Plan. | ||
| 118 | 128 | ||
| 119 | BURN_PACKAGE_REGISTRATION_STATE registrationState; // initialized during Detect, updated during Apply. | 129 | BURN_PACKAGE_REGISTRATION_STATE registrationState; // initialized during Detect, updated during Apply. |
| 120 | BURN_PACKAGE_REGISTRATION_STATE transactionRegistrationState;// only valid during Apply inside an MSI transaction. | 130 | BURN_PACKAGE_REGISTRATION_STATE transactionRegistrationState;// only valid during Apply inside an MSI transaction. |
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 | ); |
| 152 | static HRESULT RemoveUnnecessaryActions( | 152 | static 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 | ||
| 2707 | static HRESULT RemoveUnnecessaryActions( | 2707 | static 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 | ||
| 2750 | static HRESULT FinalizeSlipstreamPatchActions( | 2767 | static 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 | ||
| 3094 | extern "C" void PlanDump( | 3112 | extern "C" void PlanDump( |
diff --git a/src/engine/plan.h b/src/engine/plan.h index 23e4e312..5e981561 100644 --- a/src/engine/plan.h +++ b/src/engine/plan.h | |||
| @@ -208,8 +208,9 @@ typedef struct _BURN_CACHE_ACTION | |||
| 208 | 208 | ||
| 209 | typedef struct _BURN_ORDERED_PATCHES | 209 | typedef struct _BURN_ORDERED_PATCHES |
| 210 | { | 210 | { |
| 211 | DWORD dwOrder; | ||
| 212 | BURN_PACKAGE* pPackage; | 211 | BURN_PACKAGE* pPackage; |
| 212 | |||
| 213 | BURN_MSPTARGETPRODUCT* pTargetProduct; // only valid in the unelevated engine. | ||
| 213 | } BURN_ORDERED_PATCHES; | 214 | } BURN_ORDERED_PATCHES; |
| 214 | 215 | ||
| 215 | typedef struct _BURN_EXECUTE_ACTION_CHECKPOINT | 216 | typedef struct _BURN_EXECUTE_ACTION_CHECKPOINT |
| @@ -253,9 +254,6 @@ typedef struct _BURN_EXECUTE_ACTION | |||
| 253 | 254 | ||
| 254 | BOOTSTRAPPER_FEATURE_ACTION* rgFeatures; | 255 | BOOTSTRAPPER_FEATURE_ACTION* rgFeatures; |
| 255 | BOOTSTRAPPER_ACTION_STATE* rgSlipstreamPatches; | 256 | BOOTSTRAPPER_ACTION_STATE* rgSlipstreamPatches; |
| 256 | |||
| 257 | BURN_ORDERED_PATCHES* rgOrderedPatches; | ||
| 258 | DWORD cPatches; | ||
| 259 | } msiPackage; | 257 | } msiPackage; |
| 260 | struct | 258 | struct |
| 261 | { | 259 | { |
