diff options
Diffstat (limited to 'src/burn/engine/mspengine.cpp')
| -rw-r--r-- | src/burn/engine/mspengine.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/burn/engine/mspengine.cpp b/src/burn/engine/mspengine.cpp index 3d7b5517..a88d0cb2 100644 --- a/src/burn/engine/mspengine.cpp +++ b/src/burn/engine/mspengine.cpp | |||
| @@ -629,16 +629,26 @@ extern "C" HRESULT MspEngineExecutePackage( | |||
| 629 | } | 629 | } |
| 630 | 630 | ||
| 631 | // set up properties | 631 | // set up properties |
| 632 | hr = MsiEngineConcatProperties(pExecuteAction->mspTarget.pPackage->Msp.rgProperties, pExecuteAction->mspTarget.pPackage->Msp.cProperties, pVariables, fRollback, &sczProperties, FALSE); | 632 | hr = MsiEngineConcatPackageProperties(pExecuteAction->mspTarget.pPackage->Msp.rgProperties, pExecuteAction->mspTarget.pPackage->Msp.cProperties, pVariables, fRollback, &sczProperties, FALSE); |
| 633 | ExitOnFailure(hr, "Failed to add properties to argument string."); | 633 | ExitOnFailure(hr, "Failed to add properties to argument string."); |
| 634 | 634 | ||
| 635 | hr = MsiEngineConcatProperties(pExecuteAction->mspTarget.pPackage->Msp.rgProperties, pExecuteAction->mspTarget.pPackage->Msp.cProperties, pVariables, fRollback, &sczObfuscatedProperties, TRUE); | 635 | hr = MsiEngineConcatPackageProperties(pExecuteAction->mspTarget.pPackage->Msp.rgProperties, pExecuteAction->mspTarget.pPackage->Msp.cProperties, pVariables, fRollback, &sczObfuscatedProperties, TRUE); |
| 636 | ExitOnFailure(hr, "Failed to add properties to obfuscated argument string."); | 636 | ExitOnFailure(hr, "Failed to add properties to obfuscated argument string."); |
| 637 | 637 | ||
| 638 | hr = MsiEngineConcatActionProperty(pExecuteAction->mspTarget.actionMsiProperty, &sczProperties); | 638 | if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL != pExecuteAction->mspTarget.action) |
| 639 | { | ||
| 640 | hr = StrAllocConcatFormattedSecure(&sczProperties, L" PATCH=\"%ls\"", sczPatches); | ||
| 641 | ExitOnFailure(hr, "Failed to add PATCH property to argument string."); | ||
| 642 | |||
| 643 | hr = StrAllocConcatFormatted(&sczObfuscatedProperties, L" PATCH=\"%ls\"", sczPatches); | ||
| 644 | ExitOnFailure(hr, "Failed to add PATCH property to obfuscated argument string."); | ||
| 645 | } | ||
| 646 | |||
| 647 | // Always add Burn properties last. | ||
| 648 | hr = MsiEngineConcatBurnProperties(pExecuteAction->mspTarget.action, pExecuteAction->mspTarget.actionMsiProperty, pExecuteAction->mspTarget.fileVersioning, FALSE, FALSE, &sczProperties); | ||
| 639 | ExitOnFailure(hr, "Failed to add action property to argument string."); | 649 | ExitOnFailure(hr, "Failed to add action property to argument string."); |
| 640 | 650 | ||
| 641 | hr = MsiEngineConcatActionProperty(pExecuteAction->mspTarget.actionMsiProperty, &sczObfuscatedProperties); | 651 | hr = MsiEngineConcatBurnProperties(pExecuteAction->mspTarget.action, pExecuteAction->mspTarget.actionMsiProperty, pExecuteAction->mspTarget.fileVersioning, FALSE, FALSE, &sczObfuscatedProperties); |
| 642 | ExitOnFailure(hr, "Failed to add action property to obfuscated argument string."); | 652 | ExitOnFailure(hr, "Failed to add action property to obfuscated argument string."); |
| 643 | 653 | ||
| 644 | LogId(REPORT_STANDARD, MSG_APPLYING_PATCH_PACKAGE, pExecuteAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pExecuteAction->mspTarget.action), sczPatches, sczObfuscatedProperties, pExecuteAction->mspTarget.sczTargetProductCode); | 654 | LogId(REPORT_STANDARD, MSG_APPLYING_PATCH_PACKAGE, pExecuteAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pExecuteAction->mspTarget.action), sczPatches, sczObfuscatedProperties, pExecuteAction->mspTarget.sczTargetProductCode); |
| @@ -650,27 +660,11 @@ extern "C" HRESULT MspEngineExecutePackage( | |||
| 650 | { | 660 | { |
| 651 | case BOOTSTRAPPER_ACTION_STATE_INSTALL: __fallthrough; | 661 | case BOOTSTRAPPER_ACTION_STATE_INSTALL: __fallthrough; |
| 652 | case BOOTSTRAPPER_ACTION_STATE_REPAIR: | 662 | case BOOTSTRAPPER_ACTION_STATE_REPAIR: |
| 653 | hr = StrAllocConcatSecure(&sczProperties, L" PATCH=\"", 0); | ||
| 654 | ExitOnFailure(hr, "Failed to add PATCH property on install."); | ||
| 655 | |||
| 656 | hr = StrAllocConcatSecure(&sczProperties, sczPatches, 0); | ||
| 657 | ExitOnFailure(hr, "Failed to add patches to PATCH property on install."); | ||
| 658 | |||
| 659 | hr = StrAllocConcatSecure(&sczProperties, L"\" REBOOT=ReallySuppress", 0); | ||
| 660 | ExitOnFailure(hr, "Failed to add reboot suppression property on install."); | ||
| 661 | |||
| 662 | hr = WiuConfigureProductEx(pExecuteAction->mspTarget.sczTargetProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, sczProperties, &restart); | 663 | hr = WiuConfigureProductEx(pExecuteAction->mspTarget.sczTargetProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, sczProperties, &restart); |
| 663 | ExitOnFailure(hr, "Failed to install MSP package."); | 664 | ExitOnFailure(hr, "Failed to install MSP package."); |
| 664 | break; | 665 | break; |
| 665 | 666 | ||
| 666 | case BOOTSTRAPPER_ACTION_STATE_UNINSTALL: | 667 | case BOOTSTRAPPER_ACTION_STATE_UNINSTALL: |
| 667 | hr = StrAllocConcatSecure(&sczProperties, L" REBOOT=ReallySuppress", 0); | ||
| 668 | ExitOnFailure(hr, "Failed to add reboot suppression property on uninstall."); | ||
| 669 | |||
| 670 | // Ignore all dependencies, since the Burn engine already performed the check. | ||
| 671 | hr = StrAllocFormattedSecure(&sczProperties, L"%ls %ls=ALL", sczProperties, DEPENDENCY_IGNOREDEPENDENCIES); | ||
| 672 | ExitOnFailure(hr, "Failed to add the list of dependencies to ignore to the properties."); | ||
| 673 | |||
| 674 | hr = WiuRemovePatches(sczPatches, pExecuteAction->mspTarget.sczTargetProductCode, sczProperties, &restart); | 668 | hr = WiuRemovePatches(sczPatches, pExecuteAction->mspTarget.sczTargetProductCode, sczProperties, &restart); |
| 675 | ExitOnFailure(hr, "Failed to uninstall MSP package."); | 669 | ExitOnFailure(hr, "Failed to uninstall MSP package."); |
| 676 | break; | 670 | break; |
| @@ -1128,8 +1122,8 @@ static HRESULT PlanTargetProduct( | |||
| 1128 | hr = StrAllocString(&pAction->mspTarget.sczTargetProductCode, pTargetProduct->wzTargetProductCode, 0); | 1122 | hr = StrAllocString(&pAction->mspTarget.sczTargetProductCode, pTargetProduct->wzTargetProductCode, 0); |
| 1129 | ExitOnFailure(hr, "Failed to copy target product code."); | 1123 | ExitOnFailure(hr, "Failed to copy target product code."); |
| 1130 | 1124 | ||
| 1131 | hr = MsiEngineCalculateInstallUiLevel(display, pUserExperience, pPackage->sczId, !fRollback, pAction->mspTarget.action, | 1125 | hr = MsiEnginePlanPackageOptions(display, pUserExperience, pPackage->sczId, !fRollback, pAction->mspTarget.action, |
| 1132 | &pAction->mspTarget.actionMsiProperty, &pAction->mspTarget.uiLevel, &pAction->mspTarget.fDisableExternalUiHandler); | 1126 | &pAction->mspTarget.actionMsiProperty, &pAction->mspTarget.uiLevel, &pAction->mspTarget.fDisableExternalUiHandler, &pAction->mspTarget.fileVersioning); |
| 1133 | ExitOnFailure(hr, "Failed to get msp ui options."); | 1127 | ExitOnFailure(hr, "Failed to get msp ui options."); |
| 1134 | 1128 | ||
| 1135 | // If this is a per-machine target product, then the plan needs to be per-machine as well. | 1129 | // If this is a per-machine target product, then the plan needs to be per-machine as well. |
