diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | 50 | ||||
| -rw-r--r-- | src/engine/apply.cpp | 28 | ||||
| -rw-r--r-- | src/engine/core.cpp | 8 | ||||
| -rw-r--r-- | src/engine/detect.cpp | 2 | ||||
| -rw-r--r-- | src/engine/elevation.cpp | 98 | ||||
| -rw-r--r-- | src/engine/elevation.h | 4 | ||||
| -rw-r--r-- | src/engine/engine.mc | 14 | ||||
| -rw-r--r-- | src/engine/msiengine.cpp | 156 | ||||
| -rw-r--r-- | src/engine/msiengine.h | 5 | ||||
| -rw-r--r-- | src/engine/package.cpp | 36 | ||||
| -rw-r--r-- | src/engine/package.h | 9 | ||||
| -rw-r--r-- | src/engine/plan.cpp | 79 | ||||
| -rw-r--r-- | src/engine/plan.h | 7 | ||||
| -rw-r--r-- | src/engine/userexperience.cpp | 99 | ||||
| -rw-r--r-- | src/engine/userexperience.h | 23 |
15 files changed, 7 insertions, 611 deletions
diff --git a/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h index 80b23686..c0baa958 100644 --- a/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h +++ b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | |||
| @@ -92,15 +92,12 @@ enum BOOTSTRAPPER_APPLICATION_MESSAGE | |||
| 92 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE, | 92 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTUPDATECOMPLETE, |
| 93 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE, | 93 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDBUNDLE, |
| 94 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN, | 94 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGEBEGIN, |
| 95 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE, | ||
| 96 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE, | 95 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTRELATEDMSIPACKAGE, |
| 97 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTTARGETMSIPACKAGE, | 96 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTTARGETMSIPACKAGE, |
| 98 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE, | 97 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTMSIFEATURE, |
| 99 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE, | 98 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTPACKAGECOMPLETE, |
| 100 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE, | 99 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLE, |
| 101 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN, | 100 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGEBEGIN, |
| 102 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN, | ||
| 103 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE, | ||
| 104 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANTARGETMSIPACKAGE, | 101 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANTARGETMSIPACKAGE, |
| 105 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE, | 102 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIFEATURE, |
| 106 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE, | 103 | BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANPACKAGECOMPLETE, |
| @@ -469,20 +466,6 @@ struct BA_ONDETECTBEGIN_RESULTS | |||
| 469 | BOOL fCancel; | 466 | BOOL fCancel; |
| 470 | }; | 467 | }; |
| 471 | 468 | ||
| 472 | struct BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS | ||
| 473 | { | ||
| 474 | DWORD cbSize; | ||
| 475 | LPCWSTR wzPackageId; | ||
| 476 | LPCWSTR wzCompatiblePackageId; | ||
| 477 | LPCWSTR wzCompatiblePackageVersion; | ||
| 478 | }; | ||
| 479 | |||
| 480 | struct BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS | ||
| 481 | { | ||
| 482 | DWORD cbSize; | ||
| 483 | BOOL fCancel; | ||
| 484 | }; | ||
| 485 | |||
| 486 | struct BA_ONDETECTCOMPLETE_ARGS | 469 | struct BA_ONDETECTCOMPLETE_ARGS |
| 487 | { | 470 | { |
| 488 | DWORD cbSize; | 471 | DWORD cbSize; |
| @@ -855,39 +838,6 @@ struct BA_ONPLANBEGIN_RESULTS | |||
| 855 | BOOL fCancel; | 838 | BOOL fCancel; |
| 856 | }; | 839 | }; |
| 857 | 840 | ||
| 858 | struct BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS | ||
| 859 | { | ||
| 860 | DWORD cbSize; | ||
| 861 | LPCWSTR wzPackageId; | ||
| 862 | LPCWSTR wzCompatiblePackageId; | ||
| 863 | LPCWSTR wzCompatiblePackageVersion; | ||
| 864 | BOOTSTRAPPER_REQUEST_STATE recommendedState; | ||
| 865 | }; | ||
| 866 | |||
| 867 | struct BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS | ||
| 868 | { | ||
| 869 | DWORD cbSize; | ||
| 870 | BOOL fCancel; | ||
| 871 | BOOTSTRAPPER_REQUEST_STATE requestedState; | ||
| 872 | }; | ||
| 873 | |||
| 874 | struct BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS | ||
| 875 | { | ||
| 876 | DWORD cbSize; | ||
| 877 | LPCWSTR wzPackageId; | ||
| 878 | LPCWSTR wzCompatiblePackageId; | ||
| 879 | HRESULT hrStatus; | ||
| 880 | BOOTSTRAPPER_PACKAGE_STATE state; | ||
| 881 | BOOTSTRAPPER_REQUEST_STATE requested; | ||
| 882 | BOOTSTRAPPER_ACTION_STATE execute; | ||
| 883 | BOOTSTRAPPER_ACTION_STATE rollback; | ||
| 884 | }; | ||
| 885 | |||
| 886 | struct BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_RESULTS | ||
| 887 | { | ||
| 888 | DWORD cbSize; | ||
| 889 | }; | ||
| 890 | |||
| 891 | struct BA_ONPLANCOMPLETE_ARGS | 841 | struct BA_ONPLANCOMPLETE_ARGS |
| 892 | { | 842 | { |
| 893 | DWORD cbSize; | 843 | DWORD cbSize; |
diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index 8e5099d9..dd4932aa 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp | |||
| @@ -199,10 +199,6 @@ static HRESULT ExecuteDependencyAction( | |||
| 199 | __in BURN_EXECUTE_ACTION* pAction, | 199 | __in BURN_EXECUTE_ACTION* pAction, |
| 200 | __in BURN_EXECUTE_CONTEXT* pContext | 200 | __in BURN_EXECUTE_CONTEXT* pContext |
| 201 | ); | 201 | ); |
| 202 | static HRESULT ExecuteCompatiblePackageAction( | ||
| 203 | __in BURN_ENGINE_STATE* pEngineState, | ||
| 204 | __in BURN_EXECUTE_ACTION* pAction | ||
| 205 | ); | ||
| 206 | static HRESULT ExecuteMsiBeginTransaction( | 202 | static HRESULT ExecuteMsiBeginTransaction( |
| 207 | __in BURN_ENGINE_STATE* pEngineState, | 203 | __in BURN_ENGINE_STATE* pEngineState, |
| 208 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 204 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
| @@ -1727,11 +1723,6 @@ static HRESULT DoExecuteAction( | |||
| 1727 | ExitOnFailure(hr, "Failed to execute dependency action."); | 1723 | ExitOnFailure(hr, "Failed to execute dependency action."); |
| 1728 | break; | 1724 | break; |
| 1729 | 1725 | ||
| 1730 | case BURN_EXECUTE_ACTION_TYPE_COMPATIBLE_PACKAGE: | ||
| 1731 | hr = ExecuteCompatiblePackageAction(pEngineState, pExecuteAction); | ||
| 1732 | ExitOnFailure(hr, "Failed to execute compatible package action."); | ||
| 1733 | break; | ||
| 1734 | |||
| 1735 | case BURN_EXECUTE_ACTION_TYPE_REGISTRATION: | 1726 | case BURN_EXECUTE_ACTION_TYPE_REGISTRATION: |
| 1736 | *pfKeepRegistration = pExecuteAction->registration.fKeep; | 1727 | *pfKeepRegistration = pExecuteAction->registration.fKeep; |
| 1737 | break; | 1728 | break; |
| @@ -2183,25 +2174,6 @@ LExit: | |||
| 2183 | return hr; | 2174 | return hr; |
| 2184 | } | 2175 | } |
| 2185 | 2176 | ||
| 2186 | static HRESULT ExecuteCompatiblePackageAction( | ||
| 2187 | __in BURN_ENGINE_STATE* pEngineState, | ||
| 2188 | __in BURN_EXECUTE_ACTION* pAction | ||
| 2189 | ) | ||
| 2190 | { | ||
| 2191 | HRESULT hr = S_OK; | ||
| 2192 | |||
| 2193 | if (pAction->compatiblePackage.pReferencePackage->fPerMachine) | ||
| 2194 | { | ||
| 2195 | hr = ElevationLoadCompatiblePackageAction(pEngineState->companionConnection.hPipe, pAction); | ||
| 2196 | ExitOnFailure(hr, "Failed to load compatible package on per-machine package."); | ||
| 2197 | } | ||
| 2198 | |||
| 2199 | // Compatible package already loaded in this process. | ||
| 2200 | |||
| 2201 | LExit: | ||
| 2202 | return hr; | ||
| 2203 | } | ||
| 2204 | |||
| 2205 | static HRESULT ExecuteMsiBeginTransaction( | 2177 | static HRESULT ExecuteMsiBeginTransaction( |
| 2206 | __in BURN_ENGINE_STATE* pEngineState, | 2178 | __in BURN_ENGINE_STATE* pEngineState, |
| 2207 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | 2179 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, |
diff --git a/src/engine/core.cpp b/src/engine/core.cpp index 0f5ea08a..77e2dd82 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp | |||
| @@ -1692,14 +1692,6 @@ static void LogPackages( | |||
| 1692 | LogId(REPORT_STANDARD, MSG_PLANNED_PACKAGE, pPackage->sczId, LoggingPackageStateToString(pPackage->currentState), LoggingRequestStateToString(pPackage->defaultRequested), LoggingRequestStateToString(pPackage->requested), LoggingActionStateToString(pPackage->execute), LoggingActionStateToString(pPackage->rollback), LoggingBoolToString(pPackage->fAcquire), LoggingBoolToString(pPackage->fUncache), LoggingDependencyActionToString(pPackage->dependencyExecute)); | 1692 | LogId(REPORT_STANDARD, MSG_PLANNED_PACKAGE, pPackage->sczId, LoggingPackageStateToString(pPackage->currentState), LoggingRequestStateToString(pPackage->defaultRequested), LoggingRequestStateToString(pPackage->requested), LoggingActionStateToString(pPackage->execute), LoggingActionStateToString(pPackage->rollback), LoggingBoolToString(pPackage->fAcquire), LoggingBoolToString(pPackage->fUncache), LoggingDependencyActionToString(pPackage->dependencyExecute)); |
| 1693 | } | 1693 | } |
| 1694 | 1694 | ||
| 1695 | for (DWORD i = 0; i < pPackages->cCompatiblePackages; ++i) | ||
| 1696 | { | ||
| 1697 | const DWORD iPackage = (BOOTSTRAPPER_ACTION_UNINSTALL == action) ? pPackages->cCompatiblePackages - 1 - i : i; | ||
| 1698 | const BURN_PACKAGE* pPackage = &pPackages->rgCompatiblePackages[iPackage]; | ||
| 1699 | |||
| 1700 | LogId(REPORT_STANDARD, MSG_PLANNED_PACKAGE, pPackage->sczId, LoggingPackageStateToString(pPackage->currentState), LoggingRequestStateToString(pPackage->defaultRequested), LoggingRequestStateToString(pPackage->requested), LoggingActionStateToString(pPackage->execute), LoggingActionStateToString(pPackage->rollback), LoggingBoolToString(pPackage->fAcquire), LoggingBoolToString(pPackage->fUncache), LoggingDependencyActionToString(pPackage->dependencyExecute)); | ||
| 1701 | } | ||
| 1702 | |||
| 1703 | // Display related bundles last if caching, installing, modifying, or repairing. | 1695 | // Display related bundles last if caching, installing, modifying, or repairing. |
| 1704 | if (BOOTSTRAPPER_ACTION_UNINSTALL < action && 0 < pRelatedBundles->cRelatedBundles) | 1696 | if (BOOTSTRAPPER_ACTION_UNINSTALL < action && 0 < pRelatedBundles->cRelatedBundles) |
| 1705 | { | 1697 | { |
diff --git a/src/engine/detect.cpp b/src/engine/detect.cpp index 176780af..63e66539 100644 --- a/src/engine/detect.cpp +++ b/src/engine/detect.cpp | |||
| @@ -63,8 +63,6 @@ extern "C" void DetectReset( | |||
| 63 | 63 | ||
| 64 | pFeature->currentState = BOOTSTRAPPER_FEATURE_STATE_UNKNOWN; | 64 | pFeature->currentState = BOOTSTRAPPER_FEATURE_STATE_UNKNOWN; |
| 65 | } | 65 | } |
| 66 | |||
| 67 | pPackage->Msi.fCompatibleInstalled = FALSE; | ||
| 68 | } | 66 | } |
| 69 | else if (BURN_PACKAGE_TYPE_MSP == pPackage->type) | 67 | else if (BURN_PACKAGE_TYPE_MSP == pPackage->type) |
| 70 | { | 68 | { |
diff --git a/src/engine/elevation.cpp b/src/engine/elevation.cpp index fc53b1f8..cd0c9387 100644 --- a/src/engine/elevation.cpp +++ b/src/engine/elevation.cpp | |||
| @@ -24,7 +24,6 @@ typedef enum _BURN_ELEVATION_MESSAGE_TYPE | |||
| 24 | BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSU_PACKAGE, | 24 | BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_MSU_PACKAGE, |
| 25 | BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_PROVIDER, | 25 | BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_PROVIDER, |
| 26 | BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_DEPENDENCY, | 26 | BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_DEPENDENCY, |
| 27 | BURN_ELEVATION_MESSAGE_TYPE_LOAD_COMPATIBLE_PACKAGE, | ||
| 28 | BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_EMBEDDED_CHILD, | 27 | BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_EMBEDDED_CHILD, |
| 29 | BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE, | 28 | BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE, |
| 30 | BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE, | 29 | BURN_ELEVATION_MESSAGE_TYPE_LAUNCH_APPROVED_EXE, |
| @@ -95,11 +94,6 @@ static HRESULT WaitForElevatedChildCacheThread( | |||
| 95 | __in HANDLE hCacheThread, | 94 | __in HANDLE hCacheThread, |
| 96 | __in DWORD dwExpectedExitCode | 95 | __in DWORD dwExpectedExitCode |
| 97 | ); | 96 | ); |
| 98 | static HRESULT OnLoadCompatiblePackage( | ||
| 99 | __in BURN_PACKAGES* pPackages, | ||
| 100 | __in BYTE* pbData, | ||
| 101 | __in DWORD cbData | ||
| 102 | ); | ||
| 103 | static HRESULT ProcessApplyInitializeMessages( | 97 | static HRESULT ProcessApplyInitializeMessages( |
| 104 | __in BURN_PIPE_MESSAGE* pMsg, | 98 | __in BURN_PIPE_MESSAGE* pMsg, |
| 105 | __in_opt LPVOID pvContext, | 99 | __in_opt LPVOID pvContext, |
| @@ -1115,45 +1109,6 @@ LExit: | |||
| 1115 | } | 1109 | } |
| 1116 | 1110 | ||
| 1117 | /******************************************************************* | 1111 | /******************************************************************* |
| 1118 | ElevationLoadCompatiblePackageAction - Load compatible package | ||
| 1119 | information from the referenced package. | ||
| 1120 | |||
| 1121 | *******************************************************************/ | ||
| 1122 | extern "C" HRESULT ElevationLoadCompatiblePackageAction( | ||
| 1123 | __in HANDLE hPipe, | ||
| 1124 | __in BURN_EXECUTE_ACTION* pExecuteAction | ||
| 1125 | ) | ||
| 1126 | { | ||
| 1127 | HRESULT hr = S_OK; | ||
| 1128 | BYTE* pbData = NULL; | ||
| 1129 | SIZE_T cbData = 0; | ||
| 1130 | DWORD dwResult = 0; | ||
| 1131 | BOOTSTRAPPER_APPLY_RESTART restart = BOOTSTRAPPER_APPLY_RESTART_NONE; | ||
| 1132 | |||
| 1133 | // Serialize message data. | ||
| 1134 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->compatiblePackage.pReferencePackage->sczId); | ||
| 1135 | ExitOnFailure(hr, "Failed to write package id to message buffer."); | ||
| 1136 | |||
| 1137 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->compatiblePackage.sczInstalledProductCode); | ||
| 1138 | ExitOnFailure(hr, "Failed to write installed ProductCode to message buffer."); | ||
| 1139 | |||
| 1140 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->compatiblePackage.pInstalledVersion->sczVersion); | ||
| 1141 | ExitOnFailure(hr, "Failed to write installed version to message buffer."); | ||
| 1142 | |||
| 1143 | // Send the message. | ||
| 1144 | hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_LOAD_COMPATIBLE_PACKAGE, pbData, cbData, NULL, NULL, &dwResult); | ||
| 1145 | ExitOnFailure(hr, "Failed to send BURN_ELEVATION_MESSAGE_TYPE_LOAD_COMPATIBLE_PACKAGE message to per-machine process."); | ||
| 1146 | |||
| 1147 | // Ignore the restart since this action only loads data into memory. | ||
| 1148 | hr = ProcessResult(dwResult, &restart); | ||
| 1149 | |||
| 1150 | LExit: | ||
| 1151 | ReleaseBuffer(pbData); | ||
| 1152 | |||
| 1153 | return hr; | ||
| 1154 | } | ||
| 1155 | |||
| 1156 | /******************************************************************* | ||
| 1157 | ElevationCleanPackage - | 1112 | ElevationCleanPackage - |
| 1158 | 1113 | ||
| 1159 | *******************************************************************/ | 1114 | *******************************************************************/ |
| @@ -1719,10 +1674,6 @@ static HRESULT ProcessElevatedChildMessage( | |||
| 1719 | hrResult = OnExecutePackageDependencyAction(pContext->pPackages, &pContext->pRegistration->relatedBundles, (BYTE*)pMsg->pvData, pMsg->cbData); | 1674 | hrResult = OnExecutePackageDependencyAction(pContext->pPackages, &pContext->pRegistration->relatedBundles, (BYTE*)pMsg->pvData, pMsg->cbData); |
| 1720 | break; | 1675 | break; |
| 1721 | 1676 | ||
| 1722 | case BURN_ELEVATION_MESSAGE_TYPE_LOAD_COMPATIBLE_PACKAGE: | ||
| 1723 | hrResult = OnLoadCompatiblePackage(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | ||
| 1724 | break; | ||
| 1725 | |||
| 1726 | case BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE: | 1677 | case BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE: |
| 1727 | hrResult = OnCleanPackage(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); | 1678 | hrResult = OnCleanPackage(pContext->pPackages, (BYTE*)pMsg->pvData, pMsg->cbData); |
| 1728 | break; | 1679 | break; |
| @@ -2636,55 +2587,6 @@ LExit: | |||
| 2636 | return hr; | 2587 | return hr; |
| 2637 | } | 2588 | } |
| 2638 | 2589 | ||
| 2639 | static HRESULT OnLoadCompatiblePackage( | ||
| 2640 | __in BURN_PACKAGES* pPackages, | ||
| 2641 | __in BYTE* pbData, | ||
| 2642 | __in DWORD cbData | ||
| 2643 | ) | ||
| 2644 | { | ||
| 2645 | HRESULT hr = S_OK; | ||
| 2646 | SIZE_T iData = 0; | ||
| 2647 | LPWSTR sczPackage = NULL; | ||
| 2648 | LPWSTR sczVersion = NULL; | ||
| 2649 | BURN_EXECUTE_ACTION executeAction = { }; | ||
| 2650 | |||
| 2651 | executeAction.type = BURN_EXECUTE_ACTION_TYPE_COMPATIBLE_PACKAGE; | ||
| 2652 | |||
| 2653 | // Deserialize the message data. | ||
| 2654 | hr = BuffReadString(pbData, cbData, &iData, &sczPackage); | ||
| 2655 | ExitOnFailure(hr, "Failed to read package id from message buffer."); | ||
| 2656 | |||
| 2657 | // Find the reference package. | ||
| 2658 | hr = PackageFindById(pPackages, sczPackage, &executeAction.compatiblePackage.pReferencePackage); | ||
| 2659 | ExitOnFailure(hr, "Failed to find package: %ls", sczPackage); | ||
| 2660 | |||
| 2661 | hr = BuffReadString(pbData, cbData, &iData, &executeAction.compatiblePackage.sczInstalledProductCode); | ||
| 2662 | ExitOnFailure(hr, "Failed to read installed ProductCode from message buffer."); | ||
| 2663 | |||
| 2664 | hr = BuffReadString(pbData, cbData, &iData, &sczVersion); | ||
| 2665 | ExitOnFailure(hr, "Failed to read installed version from message buffer."); | ||
| 2666 | |||
| 2667 | hr = VerParseVersion(sczVersion, 0, FALSE, &executeAction.compatiblePackage.pInstalledVersion); | ||
| 2668 | ExitOnFailure(hr, "Failed to parse installed version from compatible package."); | ||
| 2669 | |||
| 2670 | // Copy the installed data to the reference package. | ||
| 2671 | hr = StrAllocString(&executeAction.compatiblePackage.pReferencePackage->Msi.sczInstalledProductCode, executeAction.compatiblePackage.sczInstalledProductCode, 0); | ||
| 2672 | ExitOnFailure(hr, "Failed to copy installed ProductCode."); | ||
| 2673 | |||
| 2674 | executeAction.compatiblePackage.pReferencePackage->Msi.pInstalledVersion = executeAction.compatiblePackage.pInstalledVersion; | ||
| 2675 | |||
| 2676 | // Load the compatible package and add it to the list. | ||
| 2677 | hr = MsiEngineAddCompatiblePackage(pPackages, executeAction.compatiblePackage.pReferencePackage, NULL); | ||
| 2678 | ExitOnFailure(hr, "Failed to load compatible package."); | ||
| 2679 | |||
| 2680 | LExit: | ||
| 2681 | ReleaseStr(sczVersion); | ||
| 2682 | ReleaseStr(sczPackage); | ||
| 2683 | PlanUninitializeExecuteAction(&executeAction); | ||
| 2684 | |||
| 2685 | return hr; | ||
| 2686 | } | ||
| 2687 | |||
| 2688 | static int GenericExecuteMessageHandler( | 2590 | static int GenericExecuteMessageHandler( |
| 2689 | __in GENERIC_EXECUTE_MESSAGE* pMessage, | 2591 | __in GENERIC_EXECUTE_MESSAGE* pMessage, |
| 2690 | __in LPVOID pvContext | 2592 | __in LPVOID pvContext |
diff --git a/src/engine/elevation.h b/src/engine/elevation.h index 05fecdf6..e254dea5 100644 --- a/src/engine/elevation.h +++ b/src/engine/elevation.h | |||
| @@ -117,10 +117,6 @@ HRESULT ElevationExecutePackageDependencyAction( | |||
| 117 | __in HANDLE hPipe, | 117 | __in HANDLE hPipe, |
| 118 | __in BURN_EXECUTE_ACTION* pExecuteAction | 118 | __in BURN_EXECUTE_ACTION* pExecuteAction |
| 119 | ); | 119 | ); |
| 120 | HRESULT ElevationLoadCompatiblePackageAction( | ||
| 121 | __in HANDLE hPipe, | ||
| 122 | __in BURN_EXECUTE_ACTION* pExecuteAction | ||
| 123 | ); | ||
| 124 | HRESULT ElevationLaunchElevatedChild( | 120 | HRESULT ElevationLaunchElevatedChild( |
| 125 | __in HANDLE hPipe, | 121 | __in HANDLE hPipe, |
| 126 | __in BURN_PACKAGE* pPackage, | 122 | __in BURN_PACKAGE* pPackage, |
diff --git a/src/engine/engine.mc b/src/engine/engine.mc index 8e36e84e..ad86308c 100644 --- a/src/engine/engine.mc +++ b/src/engine/engine.mc | |||
| @@ -226,13 +226,6 @@ Language=English | |||
| 226 | Detected forward compatible bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, enabled: %5!hs! | 226 | Detected forward compatible bundle: %1!ls!, type: %2!hs!, scope: %3!hs!, version: %4!ls!, enabled: %5!hs! |
| 227 | . | 227 | . |
| 228 | 228 | ||
| 229 | MessageId=108 | ||
| 230 | Severity=Success | ||
| 231 | SymbolicName=MSG_DETECTED_COMPATIBLE_PACKAGE_FROM_PROVIDER | ||
| 232 | Language=English | ||
| 233 | Detected compatible package: %1!ls!, provider: %2!ls!, installed: %3!ls!, version: %4!ls!, chained: %5!ls! | ||
| 234 | . | ||
| 235 | |||
| 236 | MessageId=120 | 229 | MessageId=120 |
| 237 | Severity=Warning | 230 | Severity=Warning |
| 238 | SymbolicName=MSG_DETECT_PACKAGE_NOT_FULLY_CACHED | 231 | SymbolicName=MSG_DETECT_PACKAGE_NOT_FULLY_CACHED |
| @@ -394,13 +387,6 @@ Language=English | |||
| 394 | Plan skipped related bundle: %1!ls!, type: %2!hs!, because it was previously scheduled. | 387 | Plan skipped related bundle: %1!ls!, type: %2!hs!, because it was previously scheduled. |
| 395 | . | 388 | . |
| 396 | 389 | ||
| 397 | MessageId=215 | ||
| 398 | Severity=Success | ||
| 399 | SymbolicName=MSG_PLANNED_ORPHAN_PACKAGE_FROM_PROVIDER | ||
| 400 | Language=English | ||
| 401 | Will remove orphan package: %1!ls!, installed: %2!ls!, chained: %3!ls! | ||
| 402 | . | ||
| 403 | |||
| 404 | MessageId=216 | 390 | MessageId=216 |
| 405 | Severity=Success | 391 | Severity=Success |
| 406 | SymbolicName=MSG_PLAN_SKIPPED_RELATED_BUNDLE_EMBEDDED_BUNDLE_NEWER | 392 | SymbolicName=MSG_PLAN_SKIPPED_RELATED_BUNDLE_EMBEDDED_BUNDLE_NEWER |
diff --git a/src/engine/msiengine.cpp b/src/engine/msiengine.cpp index 688be7af..5bccb375 100644 --- a/src/engine/msiengine.cpp +++ b/src/engine/msiengine.cpp | |||
| @@ -325,7 +325,6 @@ extern "C" void MsiEnginePackageUninitialize( | |||
| 325 | { | 325 | { |
| 326 | ReleaseStr(pPackage->Msi.sczProductCode); | 326 | ReleaseStr(pPackage->Msi.sczProductCode); |
| 327 | ReleaseStr(pPackage->Msi.sczUpgradeCode); | 327 | ReleaseStr(pPackage->Msi.sczUpgradeCode); |
| 328 | ReleaseStr(pPackage->Msi.sczInstalledProductCode); | ||
| 329 | 328 | ||
| 330 | // free features | 329 | // free features |
| 331 | if (pPackage->Msi.rgFeatures) | 330 | if (pPackage->Msi.rgFeatures) |
| @@ -404,8 +403,6 @@ extern "C" HRESULT MsiEngineDetectPackage( | |||
| 404 | int nCompareResult = 0; | 403 | int nCompareResult = 0; |
| 405 | LPWSTR sczInstalledVersion = NULL; | 404 | LPWSTR sczInstalledVersion = NULL; |
| 406 | LPWSTR sczInstalledLanguage = NULL; | 405 | LPWSTR sczInstalledLanguage = NULL; |
| 407 | LPWSTR sczInstalledProductCode = NULL; | ||
| 408 | LPWSTR sczInstalledProviderKey = NULL; | ||
| 409 | INSTALLSTATE installState = INSTALLSTATE_UNKNOWN; | 406 | INSTALLSTATE installState = INSTALLSTATE_UNKNOWN; |
| 410 | BOOTSTRAPPER_RELATED_OPERATION operation = BOOTSTRAPPER_RELATED_OPERATION_NONE; | 407 | BOOTSTRAPPER_RELATED_OPERATION operation = BOOTSTRAPPER_RELATED_OPERATION_NONE; |
| 411 | BOOTSTRAPPER_RELATED_OPERATION relatedMsiOperation = BOOTSTRAPPER_RELATED_OPERATION_NONE; | 408 | BOOTSTRAPPER_RELATED_OPERATION relatedMsiOperation = BOOTSTRAPPER_RELATED_OPERATION_NONE; |
| @@ -457,42 +454,6 @@ extern "C" HRESULT MsiEngineDetectPackage( | |||
| 457 | } | 454 | } |
| 458 | else if (HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT) == hr || HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY) == hr) // package not present. | 455 | else if (HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT) == hr || HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY) == hr) // package not present. |
| 459 | { | 456 | { |
| 460 | // Check for newer, compatible packages based on a fixed provider key. | ||
| 461 | hr = DependencyDetectProviderKeyPackageId(pPackage, &sczInstalledProviderKey, &sczInstalledProductCode); | ||
| 462 | if (SUCCEEDED(hr)) | ||
| 463 | { | ||
| 464 | hr = WiuGetProductInfoEx(sczInstalledProductCode, NULL, pPackage->fPerMachine ? MSIINSTALLCONTEXT_MACHINE : MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONSTRING, &sczInstalledVersion); | ||
| 465 | if (SUCCEEDED(hr)) | ||
| 466 | { | ||
| 467 | hr = VerParseVersion(sczInstalledVersion, 0, FALSE, &pVersion); | ||
| 468 | ExitOnFailure(hr, "Failed to parse dependency version: '%ls' for ProductCode: %ls", sczInstalledVersion, sczInstalledProductCode); | ||
| 469 | |||
| 470 | if (pVersion->fInvalid) | ||
| 471 | { | ||
| 472 | LogId(REPORT_WARNING, MSG_DETECTED_MSI_PACKAGE_INVALID_VERSION, sczInstalledProductCode, sczInstalledVersion); | ||
| 473 | } | ||
| 474 | |||
| 475 | // compare versions | ||
| 476 | hr = VerCompareParsedVersions(pPackage->Msi.pVersion, pVersion, &nCompareResult); | ||
| 477 | ExitOnFailure(hr, "Failed to compare version '%ls' to dependency version: '%ls'", pPackage->Msi.pVersion->sczVersion, pVersion->sczVersion); | ||
| 478 | |||
| 479 | if (nCompareResult < 0) | ||
| 480 | { | ||
| 481 | LogId(REPORT_STANDARD, MSG_DETECTED_COMPATIBLE_PACKAGE_FROM_PROVIDER, pPackage->sczId, sczInstalledProviderKey, sczInstalledProductCode, sczInstalledVersion, pPackage->Msi.sczProductCode); | ||
| 482 | |||
| 483 | hr = UserExperienceOnDetectCompatibleMsiPackage(pUserExperience, pPackage->sczId, sczInstalledProductCode, pVersion); | ||
| 484 | ExitOnRootFailure(hr, "BA aborted detect compatible MSI package."); | ||
| 485 | |||
| 486 | hr = StrAllocString(&pPackage->Msi.sczInstalledProductCode, sczInstalledProductCode, 0); | ||
| 487 | ExitOnFailure(hr, "Failed to copy the installed ProductCode to the package."); | ||
| 488 | |||
| 489 | pPackage->Msi.pInstalledVersion = pVersion; | ||
| 490 | pPackage->Msi.fCompatibleInstalled = TRUE; | ||
| 491 | pVersion = NULL; | ||
| 492 | } | ||
| 493 | } | ||
| 494 | } | ||
| 495 | |||
| 496 | pPackage->currentState = BOOTSTRAPPER_PACKAGE_STATE_ABSENT; | 457 | pPackage->currentState = BOOTSTRAPPER_PACKAGE_STATE_ABSENT; |
| 497 | hr = S_OK; | 458 | hr = S_OK; |
| 498 | } | 459 | } |
| @@ -701,8 +662,6 @@ extern "C" HRESULT MsiEngineDetectPackage( | |||
| 701 | } | 662 | } |
| 702 | 663 | ||
| 703 | LExit: | 664 | LExit: |
| 704 | ReleaseStr(sczInstalledProviderKey); | ||
| 705 | ReleaseStr(sczInstalledProductCode); | ||
| 706 | ReleaseStr(sczInstalledLanguage); | 665 | ReleaseStr(sczInstalledLanguage); |
| 707 | ReleaseStr(sczInstalledVersion); | 666 | ReleaseStr(sczInstalledVersion); |
| 708 | ReleaseVerutilVersion(pVersion); | 667 | ReleaseVerutilVersion(pVersion); |
| @@ -1023,121 +982,6 @@ LExit: | |||
| 1023 | return hr; | 982 | return hr; |
| 1024 | } | 983 | } |
| 1025 | 984 | ||
| 1026 | extern "C" HRESULT MsiEngineAddCompatiblePackage( | ||
| 1027 | __in BURN_PACKAGES* pPackages, | ||
| 1028 | __in const BURN_PACKAGE* pPackage, | ||
| 1029 | __out_opt BURN_PACKAGE** ppCompatiblePackage | ||
| 1030 | ) | ||
| 1031 | { | ||
| 1032 | Assert(BURN_PACKAGE_TYPE_MSI == pPackage->type); | ||
| 1033 | |||
| 1034 | HRESULT hr = S_OK; | ||
| 1035 | BURN_PACKAGE* pCompatiblePackage = NULL; | ||
| 1036 | LPWSTR sczInstalledVersion = NULL; | ||
| 1037 | |||
| 1038 | // Allocate enough memory all at once so pointers to packages within | ||
| 1039 | // aren't invalidated if we otherwise reallocated. | ||
| 1040 | hr = PackageEnsureCompatiblePackagesArray(pPackages); | ||
| 1041 | ExitOnFailure(hr, "Failed to allocate memory for compatible MSI package."); | ||
| 1042 | |||
| 1043 | pCompatiblePackage = pPackages->rgCompatiblePackages + pPackages->cCompatiblePackages; | ||
| 1044 | ++pPackages->cCompatiblePackages; | ||
| 1045 | |||
| 1046 | pCompatiblePackage->type = BURN_PACKAGE_TYPE_MSI; | ||
| 1047 | |||
| 1048 | // Read in the compatible ProductCode if not already available. | ||
| 1049 | if (pPackage->Msi.sczInstalledProductCode) | ||
| 1050 | { | ||
| 1051 | hr = StrAllocString(&pCompatiblePackage->Msi.sczProductCode, pPackage->Msi.sczInstalledProductCode, 0); | ||
| 1052 | ExitOnFailure(hr, "Failed to copy installed ProductCode to compatible package."); | ||
| 1053 | } | ||
| 1054 | else | ||
| 1055 | { | ||
| 1056 | hr = DependencyDetectProviderKeyPackageId(pPackage, NULL, &pCompatiblePackage->Msi.sczProductCode); | ||
| 1057 | ExitOnFailure(hr, "Failed to detect compatible package from provider key."); | ||
| 1058 | } | ||
| 1059 | |||
| 1060 | // Read in the compatible ProductVersion if not already available. | ||
| 1061 | if (pPackage->Msi.pInstalledVersion) | ||
| 1062 | { | ||
| 1063 | hr = VerCopyVersion(pPackage->Msi.pInstalledVersion, &pCompatiblePackage->Msi.pVersion); | ||
| 1064 | ExitOnFailure(hr, "Failed to copy version for compatible package."); | ||
| 1065 | } | ||
| 1066 | else | ||
| 1067 | { | ||
| 1068 | hr = WiuGetProductInfoEx(pCompatiblePackage->Msi.sczProductCode, NULL, pPackage->fPerMachine ? MSIINSTALLCONTEXT_MACHINE : MSIINSTALLCONTEXT_USERUNMANAGED, INSTALLPROPERTY_VERSIONSTRING, &sczInstalledVersion); | ||
| 1069 | ExitOnFailure(hr, "Failed to read version from compatible package."); | ||
| 1070 | |||
| 1071 | hr = VerParseVersion(sczInstalledVersion, 0, FALSE, &pCompatiblePackage->Msi.pVersion); | ||
| 1072 | ExitOnFailure(hr, "Failed to parse version: '%ls' for ProductCode: %ls", sczInstalledVersion, pCompatiblePackage->Msi.sczProductCode); | ||
| 1073 | |||
| 1074 | if (pCompatiblePackage->Msi.pVersion->fInvalid) | ||
| 1075 | { | ||
| 1076 | LogId(REPORT_WARNING, MSG_DETECTED_MSI_PACKAGE_INVALID_VERSION, pCompatiblePackage->Msi.sczProductCode, sczInstalledVersion); | ||
| 1077 | } | ||
| 1078 | } | ||
| 1079 | |||
| 1080 | // For now, copy enough information to support uninstalling the newer, compatible package. | ||
| 1081 | hr = StrAllocString(&pCompatiblePackage->sczId, pCompatiblePackage->Msi.sczProductCode, 0); | ||
| 1082 | ExitOnFailure(hr, "Failed to copy installed ProductCode as compatible package ID."); | ||
| 1083 | |||
| 1084 | pCompatiblePackage->fPerMachine = pPackage->fPerMachine; | ||
| 1085 | pCompatiblePackage->fUninstallable = pPackage->fUninstallable; | ||
| 1086 | pCompatiblePackage->cacheType = pPackage->cacheType; | ||
| 1087 | |||
| 1088 | // Removing compatible packages is best effort. | ||
| 1089 | pCompatiblePackage->fVital = FALSE; | ||
| 1090 | |||
| 1091 | // Format a suitable log path variable from the original package. | ||
| 1092 | hr = StrAllocFormatted(&pCompatiblePackage->sczLogPathVariable, L"%ls_Compatible", pPackage->sczLogPathVariable); | ||
| 1093 | ExitOnFailure(hr, "Failed to format log path variable for compatible package."); | ||
| 1094 | |||
| 1095 | // Use the default cache ID generation from the binder. | ||
| 1096 | hr = StrAllocFormatted(&pCompatiblePackage->sczCacheId, L"%lsv%ls", pCompatiblePackage->sczId, pCompatiblePackage->Msi.pVersion->sczVersion); | ||
| 1097 | ExitOnFailure(hr, "Failed to format cache ID for compatible package."); | ||
| 1098 | |||
| 1099 | pCompatiblePackage->currentState = BOOTSTRAPPER_PACKAGE_STATE_PRESENT; | ||
| 1100 | pCompatiblePackage->cache = BURN_CACHE_STATE_PARTIAL; // Cannot know if it's complete or not. | ||
| 1101 | |||
| 1102 | // Copy all the providers to ensure no dependents. | ||
| 1103 | if (pPackage->cDependencyProviders) | ||
| 1104 | { | ||
| 1105 | pCompatiblePackage->rgDependencyProviders = (BURN_DEPENDENCY_PROVIDER*)MemAlloc(sizeof(BURN_DEPENDENCY_PROVIDER) * pPackage->cDependencyProviders, TRUE); | ||
| 1106 | ExitOnNull(pCompatiblePackage->rgDependencyProviders, hr, E_OUTOFMEMORY, "Failed to allocate for compatible package providers."); | ||
| 1107 | |||
| 1108 | for (DWORD i = 0; i < pPackage->cDependencyProviders; ++i) | ||
| 1109 | { | ||
| 1110 | BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders + i; | ||
| 1111 | BURN_DEPENDENCY_PROVIDER* pCompatibleProvider = pCompatiblePackage->rgDependencyProviders + i; | ||
| 1112 | |||
| 1113 | // Only need to copy the key for uninstall. | ||
| 1114 | hr = StrAllocString(&pCompatibleProvider->sczKey, pProvider->sczKey, 0); | ||
| 1115 | ExitOnFailure(hr, "Failed to copy the compatible provider key."); | ||
| 1116 | |||
| 1117 | // Assume the package version is the same as the provider version. | ||
| 1118 | hr = StrAllocString(&pCompatibleProvider->sczVersion, pCompatiblePackage->Msi.pVersion->sczVersion, 0); | ||
| 1119 | ExitOnFailure(hr, "Failed to copy the compatible provider version."); | ||
| 1120 | |||
| 1121 | // Assume provider keys are similarly authored for this package. | ||
| 1122 | pCompatibleProvider->fImported = pProvider->fImported; | ||
| 1123 | } | ||
| 1124 | |||
| 1125 | pCompatiblePackage->cDependencyProviders = pPackage->cDependencyProviders; | ||
| 1126 | } | ||
| 1127 | |||
| 1128 | pCompatiblePackage->type = BURN_PACKAGE_TYPE_MSI; | ||
| 1129 | |||
| 1130 | if (ppCompatiblePackage) | ||
| 1131 | { | ||
| 1132 | *ppCompatiblePackage = pCompatiblePackage; | ||
| 1133 | } | ||
| 1134 | |||
| 1135 | LExit: | ||
| 1136 | ReleaseStr(sczInstalledVersion); | ||
| 1137 | |||
| 1138 | return hr; | ||
| 1139 | } | ||
| 1140 | |||
| 1141 | extern "C" HRESULT MsiEngineBeginTransaction( | 985 | extern "C" HRESULT MsiEngineBeginTransaction( |
| 1142 | __in LPCWSTR wzName | 986 | __in LPCWSTR wzName |
| 1143 | ) | 987 | ) |
diff --git a/src/engine/msiengine.h b/src/engine/msiengine.h index c7cc3bef..1f450147 100644 --- a/src/engine/msiengine.h +++ b/src/engine/msiengine.h | |||
| @@ -48,11 +48,6 @@ HRESULT MsiEnginePlanAddPackage( | |||
| 48 | __in_opt HANDLE hCacheEvent, | 48 | __in_opt HANDLE hCacheEvent, |
| 49 | __in BOOL fPlanPackageCacheRollback | 49 | __in BOOL fPlanPackageCacheRollback |
| 50 | ); | 50 | ); |
| 51 | HRESULT MsiEngineAddCompatiblePackage( | ||
| 52 | __in BURN_PACKAGES* pPackages, | ||
| 53 | __in const BURN_PACKAGE* pPackage, | ||
| 54 | __out_opt BURN_PACKAGE** ppCompatiblePackage | ||
| 55 | ); | ||
| 56 | HRESULT MsiEngineBeginTransaction( | 51 | HRESULT MsiEngineBeginTransaction( |
| 57 | __in LPCWSTR wzName | 52 | __in LPCWSTR wzName |
| 58 | ); | 53 | ); |
diff --git a/src/engine/package.cpp b/src/engine/package.cpp index 02958efd..527766eb 100644 --- a/src/engine/package.cpp +++ b/src/engine/package.cpp | |||
| @@ -369,15 +369,6 @@ extern "C" void PackagesUninitialize( | |||
| 369 | MemFree(pPackages->rgPackages); | 369 | MemFree(pPackages->rgPackages); |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | if (pPackages->rgCompatiblePackages) | ||
| 373 | { | ||
| 374 | for (DWORD i = 0; i < pPackages->cCompatiblePackages; ++i) | ||
| 375 | { | ||
| 376 | PackageUninitialize(pPackages->rgCompatiblePackages + i); | ||
| 377 | } | ||
| 378 | MemFree(pPackages->rgCompatiblePackages); | ||
| 379 | } | ||
| 380 | |||
| 381 | if (pPackages->rgPatchTargetCodes) | 372 | if (pPackages->rgPatchTargetCodes) |
| 382 | { | 373 | { |
| 383 | for (DWORD i = 0; i < pPackages->cPatchTargetCodes; ++i) | 374 | for (DWORD i = 0; i < pPackages->cPatchTargetCodes; ++i) |
| @@ -414,17 +405,6 @@ extern "C" HRESULT PackageFindById( | |||
| 414 | } | 405 | } |
| 415 | } | 406 | } |
| 416 | 407 | ||
| 417 | for (DWORD i = 0; i < pPackages->cCompatiblePackages; ++i) | ||
| 418 | { | ||
| 419 | pPackage = &pPackages->rgCompatiblePackages[i]; | ||
| 420 | |||
| 421 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, pPackage->sczId, -1, wzId, -1)) | ||
| 422 | { | ||
| 423 | *ppPackage = pPackage; | ||
| 424 | ExitFunction1(hr = S_OK); | ||
| 425 | } | ||
| 426 | } | ||
| 427 | |||
| 428 | hr = E_NOTFOUND; | 408 | hr = E_NOTFOUND; |
| 429 | 409 | ||
| 430 | LExit: | 410 | LExit: |
| @@ -510,22 +490,6 @@ LExit: | |||
| 510 | return hr; | 490 | return hr; |
| 511 | } | 491 | } |
| 512 | 492 | ||
| 513 | HRESULT PackageEnsureCompatiblePackagesArray( | ||
| 514 | __in BURN_PACKAGES* pPackages | ||
| 515 | ) | ||
| 516 | { | ||
| 517 | HRESULT hr = S_OK; | ||
| 518 | |||
| 519 | if (!pPackages->rgCompatiblePackages) | ||
| 520 | { | ||
| 521 | pPackages->rgCompatiblePackages = (BURN_PACKAGE*)MemAlloc(sizeof(BURN_PACKAGE) * pPackages->cPackages, TRUE); | ||
| 522 | ExitOnNull(pPackages->rgCompatiblePackages, hr, E_OUTOFMEMORY, "Failed to allocate memory for compatible packages."); | ||
| 523 | } | ||
| 524 | |||
| 525 | LExit: | ||
| 526 | return hr; | ||
| 527 | } | ||
| 528 | |||
| 529 | 493 | ||
| 530 | // internal function declarations | 494 | // internal function declarations |
| 531 | 495 | ||
diff --git a/src/engine/package.h b/src/engine/package.h index ec176f8c..1a4f7060 100644 --- a/src/engine/package.h +++ b/src/engine/package.h | |||
| @@ -248,7 +248,6 @@ typedef struct _BURN_PACKAGE | |||
| 248 | LPWSTR sczProductCode; | 248 | LPWSTR sczProductCode; |
| 249 | DWORD dwLanguage; | 249 | DWORD dwLanguage; |
| 250 | VERUTIL_VERSION* pVersion; | 250 | VERUTIL_VERSION* pVersion; |
| 251 | LPWSTR sczInstalledProductCode; | ||
| 252 | VERUTIL_VERSION* pInstalledVersion; | 251 | VERUTIL_VERSION* pInstalledVersion; |
| 253 | LPWSTR sczUpgradeCode; | 252 | LPWSTR sczUpgradeCode; |
| 254 | 253 | ||
| @@ -264,8 +263,6 @@ typedef struct _BURN_PACKAGE | |||
| 264 | _BURN_PACKAGE** rgpSlipstreamMspPackages; | 263 | _BURN_PACKAGE** rgpSlipstreamMspPackages; |
| 265 | LPWSTR* rgsczSlipstreamMspPackageIds; | 264 | LPWSTR* rgsczSlipstreamMspPackageIds; |
| 266 | DWORD cSlipstreamMspPackages; | 265 | DWORD cSlipstreamMspPackages; |
| 267 | |||
| 268 | BOOL fCompatibleInstalled; | ||
| 269 | } Msi; | 266 | } Msi; |
| 270 | struct | 267 | struct |
| 271 | { | 268 | { |
| @@ -294,9 +291,6 @@ typedef struct _BURN_PACKAGES | |||
| 294 | BURN_PACKAGE* rgPackages; | 291 | BURN_PACKAGE* rgPackages; |
| 295 | DWORD cPackages; | 292 | DWORD cPackages; |
| 296 | 293 | ||
| 297 | BURN_PACKAGE* rgCompatiblePackages; | ||
| 298 | DWORD cCompatiblePackages; | ||
| 299 | |||
| 300 | BURN_PATCH_TARGETCODE* rgPatchTargetCodes; | 294 | BURN_PATCH_TARGETCODE* rgPatchTargetCodes; |
| 301 | DWORD cPatchTargetCodes; | 295 | DWORD cPatchTargetCodes; |
| 302 | 296 | ||
| @@ -335,9 +329,6 @@ HRESULT PackageGetProperty( | |||
| 335 | __in_z LPCWSTR wzProperty, | 329 | __in_z LPCWSTR wzProperty, |
| 336 | __out_z_opt LPWSTR* psczValue | 330 | __out_z_opt LPWSTR* psczValue |
| 337 | ); | 331 | ); |
| 338 | HRESULT PackageEnsureCompatiblePackagesArray( | ||
| 339 | __in BURN_PACKAGES* pPackages | ||
| 340 | ); | ||
| 341 | 332 | ||
| 342 | 333 | ||
| 343 | #if defined(__cplusplus) | 334 | #if defined(__cplusplus) |
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp index ffbe495f..a45eab62 100644 --- a/src/engine/plan.cpp +++ b/src/engine/plan.cpp | |||
| @@ -30,7 +30,6 @@ static void ResetPlannedRollbackBoundaryState( | |||
| 30 | ); | 30 | ); |
| 31 | static HRESULT ProcessPackage( | 31 | static HRESULT ProcessPackage( |
| 32 | __in BOOL fBundlePerMachine, | 32 | __in BOOL fBundlePerMachine, |
| 33 | __in_opt BURN_PACKAGE* pCompatiblePackageParent, | ||
| 34 | __in BURN_USER_EXPERIENCE* pUX, | 33 | __in BURN_USER_EXPERIENCE* pUX, |
| 35 | __in BURN_PLAN* pPlan, | 34 | __in BURN_PLAN* pPlan, |
| 36 | __in BURN_PACKAGE* pPackage, | 35 | __in BURN_PACKAGE* pPackage, |
| @@ -311,10 +310,6 @@ extern "C" void PlanUninitializeExecuteAction( | |||
| 311 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: | 310 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: |
| 312 | ReleaseStr(pExecuteAction->packageDependency.sczBundleProviderKey); | 311 | ReleaseStr(pExecuteAction->packageDependency.sczBundleProviderKey); |
| 313 | break; | 312 | break; |
| 314 | |||
| 315 | case BURN_EXECUTE_ACTION_TYPE_COMPATIBLE_PACKAGE: | ||
| 316 | ReleaseStr(pExecuteAction->compatiblePackage.sczInstalledProductCode); | ||
| 317 | break; | ||
| 318 | } | 313 | } |
| 319 | } | 314 | } |
| 320 | 315 | ||
| @@ -523,39 +518,8 @@ extern "C" HRESULT PlanPackages( | |||
| 523 | } | 518 | } |
| 524 | } | 519 | } |
| 525 | 520 | ||
| 526 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, wzLayoutDirectory, phSyncpointEvent, &pRollbackBoundary, &nonpermanentPackageIndices); | 521 | hr = ProcessPackage(fBundlePerMachine, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, wzLayoutDirectory, phSyncpointEvent, &pRollbackBoundary, &nonpermanentPackageIndices); |
| 527 | ExitOnFailure(hr, "Failed to process package."); | 522 | ExitOnFailure(hr, "Failed to process package."); |
| 528 | |||
| 529 | // Attempt to remove orphaned packages during uninstall. Currently only MSI packages are supported and should not require source. | ||
| 530 | if (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action && BURN_PACKAGE_TYPE_MSI == pPackage->type && pPackage->Msi.fCompatibleInstalled) | ||
| 531 | { | ||
| 532 | BURN_PACKAGE* pCompatiblePackage = NULL; | ||
| 533 | BURN_EXECUTE_ACTION* pAction = NULL; | ||
| 534 | |||
| 535 | // Add the compatible package to the list. | ||
| 536 | hr = MsiEngineAddCompatiblePackage(pPackages, pPackage, &pCompatiblePackage); | ||
| 537 | ExitOnFailure(hr, "Failed to add compatible package for package: %ls", pPackage->sczId); | ||
| 538 | |||
| 539 | // Plan to load the compatible package into the elevated engine before its needed. | ||
| 540 | hr = PlanAppendExecuteAction(pPlan, &pAction); | ||
| 541 | ExitOnFailure(hr, "Failed to append execute action."); | ||
| 542 | |||
| 543 | pAction->type = BURN_EXECUTE_ACTION_TYPE_COMPATIBLE_PACKAGE; | ||
| 544 | pAction->compatiblePackage.pReferencePackage = pPackage; | ||
| 545 | pAction->compatiblePackage.pInstalledVersion = pCompatiblePackage->Msi.pVersion; | ||
| 546 | |||
| 547 | hr = StrAllocString(&pAction->compatiblePackage.sczInstalledProductCode, pCompatiblePackage->Msi.sczProductCode, 0); | ||
| 548 | ExitOnFailure(hr, "Failed to copy installed ProductCode"); | ||
| 549 | |||
| 550 | // Process the compatible MSI package like any other. | ||
| 551 | hr = ProcessPackage(fBundlePerMachine, pPackage, pUX, pPlan, pCompatiblePackage, pLog, pVariables, display, relationType, wzLayoutDirectory, phSyncpointEvent, &pRollbackBoundary, &nonpermanentPackageIndices); | ||
| 552 | ExitOnFailure(hr, "Failed to process compatible package."); | ||
| 553 | |||
| 554 | if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pCompatiblePackage->execute) | ||
| 555 | { | ||
| 556 | LogId(REPORT_STANDARD, MSG_PLANNED_ORPHAN_PACKAGE_FROM_PROVIDER, pPackage->sczId, pCompatiblePackage->Msi.sczProductCode, pPackage->Msi.sczProductCode); | ||
| 557 | } | ||
| 558 | } | ||
| 559 | } | 523 | } |
| 560 | 524 | ||
| 561 | // Insert the "keep registration" and "remove registration" actions in the plan when installing the first time and anytime we are uninstalling respectively. | 525 | // Insert the "keep registration" and "remove registration" actions in the plan when installing the first time and anytime we are uninstalling respectively. |
| @@ -601,15 +565,6 @@ extern "C" HRESULT PlanPackages( | |||
| 601 | ExitOnFailure(hr, "Failed to plan clean package."); | 565 | ExitOnFailure(hr, "Failed to plan clean package."); |
| 602 | } | 566 | } |
| 603 | 567 | ||
| 604 | // Plan best-effort clean up of compatible packages. | ||
| 605 | for (DWORD i = 0; i < pPackages->cCompatiblePackages; ++i) | ||
| 606 | { | ||
| 607 | DWORD iPackage = (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action) ? pPackages->cCompatiblePackages - 1 - i : i; | ||
| 608 | BURN_PACKAGE* pCompatiblePackage = pPackages->rgCompatiblePackages + iPackage; | ||
| 609 | |||
| 610 | PlanCleanPackage(pPlan, pCompatiblePackage); | ||
| 611 | } | ||
| 612 | |||
| 613 | LExit: | 568 | LExit: |
| 614 | return hr; | 569 | return hr; |
| 615 | } | 570 | } |
| @@ -809,7 +764,7 @@ extern "C" HRESULT PlanPassThroughBundle( | |||
| 809 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; | 764 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; |
| 810 | 765 | ||
| 811 | // Plan passthrough package. | 766 | // Plan passthrough package. |
| 812 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); | 767 | hr = ProcessPackage(fBundlePerMachine, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); |
| 813 | ExitOnFailure(hr, "Failed to process passthrough package."); | 768 | ExitOnFailure(hr, "Failed to process passthrough package."); |
| 814 | 769 | ||
| 815 | // If we still have an open rollback boundary, complete it. | 770 | // If we still have an open rollback boundary, complete it. |
| @@ -843,7 +798,7 @@ extern "C" HRESULT PlanUpdateBundle( | |||
| 843 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; | 798 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; |
| 844 | 799 | ||
| 845 | // Plan update package. | 800 | // Plan update package. |
| 846 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); | 801 | hr = ProcessPackage(fBundlePerMachine, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); |
| 847 | ExitOnFailure(hr, "Failed to process update package."); | 802 | ExitOnFailure(hr, "Failed to process update package."); |
| 848 | 803 | ||
| 849 | // If we still have an open rollback boundary, complete it. | 804 | // If we still have an open rollback boundary, complete it. |
| @@ -863,7 +818,6 @@ LExit: | |||
| 863 | 818 | ||
| 864 | static HRESULT ProcessPackage( | 819 | static HRESULT ProcessPackage( |
| 865 | __in BOOL fBundlePerMachine, | 820 | __in BOOL fBundlePerMachine, |
| 866 | __in_opt BURN_PACKAGE* pCompatiblePackageParent, | ||
| 867 | __in BURN_USER_EXPERIENCE* pUX, | 821 | __in BURN_USER_EXPERIENCE* pUX, |
| 868 | __in BURN_PLAN* pPlan, | 822 | __in BURN_PLAN* pPlan, |
| 869 | __in BURN_PACKAGE* pPackage, | 823 | __in BURN_PACKAGE* pPackage, |
| @@ -888,18 +842,8 @@ static HRESULT ProcessPackage( | |||
| 888 | pPackage->requested = pPackage->defaultRequested; | 842 | pPackage->requested = pPackage->defaultRequested; |
| 889 | fPlanPackageBegan = TRUE; | 843 | fPlanPackageBegan = TRUE; |
| 890 | 844 | ||
| 891 | if (pCompatiblePackageParent) | 845 | hr = UserExperienceOnPlanPackageBegin(pUX, pPackage->sczId, &pPackage->requested); |
| 892 | { | 846 | ExitOnRootFailure(hr, "BA aborted plan package begin."); |
| 893 | AssertSz(BURN_PACKAGE_TYPE_MSI == pPackage->type, "Currently only MSI packages have compatible packages."); | ||
| 894 | |||
| 895 | hr = UserExperienceOnPlanCompatibleMsiPackageBegin(pUX, pCompatiblePackageParent->sczId, pPackage->sczId, pPackage->Msi.pVersion, &pPackage->requested); | ||
| 896 | ExitOnRootFailure(hr, "BA aborted plan compatible MSI package begin."); | ||
| 897 | } | ||
| 898 | else | ||
| 899 | { | ||
| 900 | hr = UserExperienceOnPlanPackageBegin(pUX, pPackage->sczId, &pPackage->requested); | ||
| 901 | ExitOnRootFailure(hr, "BA aborted plan package begin."); | ||
| 902 | } | ||
| 903 | 847 | ||
| 904 | pEffectiveRollbackBoundary = (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action) ? pPackage->pRollbackBoundaryBackward : pPackage->pRollbackBoundaryForward; | 848 | pEffectiveRollbackBoundary = (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action) ? pPackage->pRollbackBoundaryBackward : pPackage->pRollbackBoundaryForward; |
| 905 | hr = ProcessPackageRollbackBoundary(pPlan, pEffectiveRollbackBoundary, ppRollbackBoundary); | 849 | hr = ProcessPackageRollbackBoundary(pPlan, pEffectiveRollbackBoundary, ppRollbackBoundary); |
| @@ -964,14 +908,7 @@ static HRESULT ProcessPackage( | |||
| 964 | LExit: | 908 | LExit: |
| 965 | if (fPlanPackageBegan) | 909 | if (fPlanPackageBegan) |
| 966 | { | 910 | { |
| 967 | if (pCompatiblePackageParent) | 911 | UserExperienceOnPlanPackageComplete(pUX, pPackage->sczId, hr, pPackage->currentState, pPackage->requested, pPackage->execute, pPackage->rollback); |
| 968 | { | ||
| 969 | UserExperienceOnPlanCompatibleMsiPackageComplete(pUX, pCompatiblePackageParent->sczId, pPackage->sczId, hr, pPackage->currentState, pPackage->requested, pPackage->execute, pPackage->rollback); | ||
| 970 | } | ||
| 971 | else | ||
| 972 | { | ||
| 973 | UserExperienceOnPlanPackageComplete(pUX, pPackage->sczId, hr, pPackage->currentState, pPackage->requested, pPackage->execute, pPackage->rollback); | ||
| 974 | } | ||
| 975 | } | 912 | } |
| 976 | 913 | ||
| 977 | return hr; | 914 | return hr; |
| @@ -3175,10 +3112,6 @@ static void ExecuteActionLog( | |||
| 3175 | LogStringLine(PlanDumpLevel, "%ls action[%u]: UNCACHE_PACKAGE id: %ls", wzBase, iAction, pAction->uncachePackage.pPackage->sczId); | 3112 | LogStringLine(PlanDumpLevel, "%ls action[%u]: UNCACHE_PACKAGE id: %ls", wzBase, iAction, pAction->uncachePackage.pPackage->sczId); |
| 3176 | break; | 3113 | break; |
| 3177 | 3114 | ||
| 3178 | case BURN_EXECUTE_ACTION_TYPE_COMPATIBLE_PACKAGE: | ||
| 3179 | LogStringLine(PlanDumpLevel, "%ls action[%u]: COMPATIBLE_PACKAGE reference id: %ls, installed ProductCode: %ls", wzBase, iAction, pAction->compatiblePackage.pReferencePackage->sczId, pAction->compatiblePackage.sczInstalledProductCode); | ||
| 3180 | break; | ||
| 3181 | |||
| 3182 | case BURN_EXECUTE_ACTION_TYPE_BEGIN_MSI_TRANSACTION: | 3115 | case BURN_EXECUTE_ACTION_TYPE_BEGIN_MSI_TRANSACTION: |
| 3183 | LogStringLine(PlanDumpLevel, "%ls action[%u]: BEGIN_MSI_TRANSACTION id: %ls", wzBase, iAction, pAction->msiTransaction.pRollbackBoundary->sczId); | 3116 | LogStringLine(PlanDumpLevel, "%ls action[%u]: BEGIN_MSI_TRANSACTION id: %ls", wzBase, iAction, pAction->msiTransaction.pRollbackBoundary->sczId); |
| 3184 | break; | 3117 | break; |
diff --git a/src/engine/plan.h b/src/engine/plan.h index dad436d4..cb64f891 100644 --- a/src/engine/plan.h +++ b/src/engine/plan.h | |||
| @@ -65,7 +65,6 @@ enum BURN_EXECUTE_ACTION_TYPE | |||
| 65 | BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY, | 65 | BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY, |
| 66 | BURN_EXECUTE_ACTION_TYPE_ROLLBACK_BOUNDARY, | 66 | BURN_EXECUTE_ACTION_TYPE_ROLLBACK_BOUNDARY, |
| 67 | BURN_EXECUTE_ACTION_TYPE_REGISTRATION, | 67 | BURN_EXECUTE_ACTION_TYPE_REGISTRATION, |
| 68 | BURN_EXECUTE_ACTION_TYPE_COMPATIBLE_PACKAGE, | ||
| 69 | BURN_EXECUTE_ACTION_TYPE_BEGIN_MSI_TRANSACTION, | 68 | BURN_EXECUTE_ACTION_TYPE_BEGIN_MSI_TRANSACTION, |
| 70 | BURN_EXECUTE_ACTION_TYPE_COMMIT_MSI_TRANSACTION, | 69 | BURN_EXECUTE_ACTION_TYPE_COMMIT_MSI_TRANSACTION, |
| 71 | }; | 70 | }; |
| @@ -302,12 +301,6 @@ typedef struct _BURN_EXECUTE_ACTION | |||
| 302 | } packageDependency; | 301 | } packageDependency; |
| 303 | struct | 302 | struct |
| 304 | { | 303 | { |
| 305 | BURN_PACKAGE* pReferencePackage; | ||
| 306 | LPWSTR sczInstalledProductCode; | ||
| 307 | VERUTIL_VERSION* pInstalledVersion; | ||
| 308 | } compatiblePackage; | ||
| 309 | struct | ||
| 310 | { | ||
| 311 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary; | 304 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary; |
| 312 | } msiTransaction; | 305 | } msiTransaction; |
| 313 | }; | 306 | }; |
diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index 8e782e71..ea8b8a19 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp | |||
| @@ -104,7 +104,7 @@ extern "C" HRESULT UserExperienceLoad( | |||
| 104 | args.pCommand = pCommand; | 104 | args.pCommand = pCommand; |
| 105 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; | 105 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; |
| 106 | args.pvBootstrapperEngineProcContext = pEngineContext; | 106 | args.pvBootstrapperEngineProcContext = pEngineContext; |
| 107 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2020, 11, 17, 0); | 107 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 1, 30, 0); |
| 108 | 108 | ||
| 109 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | 109 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); |
| 110 | 110 | ||
| @@ -747,36 +747,6 @@ LExit: | |||
| 747 | return hr; | 747 | return hr; |
| 748 | } | 748 | } |
| 749 | 749 | ||
| 750 | EXTERN_C BAAPI UserExperienceOnDetectCompatibleMsiPackage( | ||
| 751 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 752 | __in_z LPCWSTR wzPackageId, | ||
| 753 | __in_z LPCWSTR wzCompatiblePackageId, | ||
| 754 | __in VERUTIL_VERSION* pCompatiblePackageVersion | ||
| 755 | ) | ||
| 756 | { | ||
| 757 | HRESULT hr = S_OK; | ||
| 758 | BA_ONDETECTCOMPATIBLEMSIPACKAGE_ARGS args = { }; | ||
| 759 | BA_ONDETECTCOMPATIBLEMSIPACKAGE_RESULTS results = { }; | ||
| 760 | |||
| 761 | args.cbSize = sizeof(args); | ||
| 762 | args.wzPackageId = wzPackageId; | ||
| 763 | args.wzCompatiblePackageId = wzCompatiblePackageId; | ||
| 764 | args.wzCompatiblePackageVersion = pCompatiblePackageVersion->sczVersion; | ||
| 765 | |||
| 766 | results.cbSize = sizeof(results); | ||
| 767 | |||
| 768 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONDETECTCOMPATIBLEMSIPACKAGE, &args, &results); | ||
| 769 | ExitOnFailure(hr, "BA OnDetectCompatibleMsiPackage failed."); | ||
| 770 | |||
| 771 | if (results.fCancel) | ||
| 772 | { | ||
| 773 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | ||
| 774 | } | ||
| 775 | |||
| 776 | LExit: | ||
| 777 | return hr; | ||
| 778 | } | ||
| 779 | |||
| 780 | EXTERN_C BAAPI UserExperienceOnDetectComplete( | 750 | EXTERN_C BAAPI UserExperienceOnDetectComplete( |
| 781 | __in BURN_USER_EXPERIENCE* pUserExperience, | 751 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 782 | __in HRESULT hrStatus | 752 | __in HRESULT hrStatus |
| @@ -1555,73 +1525,6 @@ LExit: | |||
| 1555 | return hr; | 1525 | return hr; |
| 1556 | } | 1526 | } |
| 1557 | 1527 | ||
| 1558 | EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageBegin( | ||
| 1559 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 1560 | __in_z LPCWSTR wzPackageId, | ||
| 1561 | __in_z LPCWSTR wzCompatiblePackageId, | ||
| 1562 | __in VERUTIL_VERSION* pCompatiblePackageVersion, | ||
| 1563 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState | ||
| 1564 | ) | ||
| 1565 | { | ||
| 1566 | HRESULT hr = S_OK; | ||
| 1567 | BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_ARGS args = { }; | ||
| 1568 | BA_ONPLANCOMPATIBLEMSIPACKAGEBEGIN_RESULTS results = { }; | ||
| 1569 | |||
| 1570 | args.cbSize = sizeof(args); | ||
| 1571 | args.wzPackageId = wzPackageId; | ||
| 1572 | args.wzCompatiblePackageId = wzCompatiblePackageId; | ||
| 1573 | args.wzCompatiblePackageVersion = pCompatiblePackageVersion->sczVersion; | ||
| 1574 | args.recommendedState = *pRequestedState; | ||
| 1575 | |||
| 1576 | results.cbSize = sizeof(results); | ||
| 1577 | results.requestedState = *pRequestedState; | ||
| 1578 | |||
| 1579 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGEBEGIN, &args, &results); | ||
| 1580 | ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageBegin failed."); | ||
| 1581 | |||
| 1582 | if (results.fCancel) | ||
| 1583 | { | ||
| 1584 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | ||
| 1585 | } | ||
| 1586 | *pRequestedState = results.requestedState; | ||
| 1587 | |||
| 1588 | LExit: | ||
| 1589 | return hr; | ||
| 1590 | } | ||
| 1591 | |||
| 1592 | EXTERN_C BAAPI UserExperienceOnPlanCompatibleMsiPackageComplete( | ||
| 1593 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 1594 | __in_z LPCWSTR wzPackageId, | ||
| 1595 | __in_z LPCWSTR wzCompatiblePackageId, | ||
| 1596 | __in HRESULT hrStatus, | ||
| 1597 | __in BOOTSTRAPPER_PACKAGE_STATE state, | ||
| 1598 | __in BOOTSTRAPPER_REQUEST_STATE requested, | ||
| 1599 | __in BOOTSTRAPPER_ACTION_STATE execute, | ||
| 1600 | __in BOOTSTRAPPER_ACTION_STATE rollback | ||
| 1601 | ) | ||
| 1602 | { | ||
| 1603 | HRESULT hr = S_OK; | ||
| 1604 | BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_ARGS args = { }; | ||
| 1605 | BA_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE_RESULTS results = { }; | ||
| 1606 | |||
| 1607 | args.cbSize = sizeof(args); | ||
| 1608 | args.wzPackageId = wzPackageId; | ||
| 1609 | args.wzCompatiblePackageId = wzCompatiblePackageId; | ||
| 1610 | args.hrStatus = hrStatus; | ||
| 1611 | args.state = state; | ||
| 1612 | args.requested = requested; | ||
| 1613 | args.execute = execute; | ||
| 1614 | args.rollback = rollback; | ||
| 1615 | |||
| 1616 | results.cbSize = sizeof(results); | ||
| 1617 | |||
| 1618 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANCOMPATIBLEMSIPACKAGECOMPLETE, &args, &results); | ||
| 1619 | ExitOnFailure(hr, "BA OnPlanCompatibleMsiPackageComplete failed."); | ||
| 1620 | |||
| 1621 | LExit: | ||
| 1622 | return hr; | ||
| 1623 | } | ||
| 1624 | |||
| 1625 | EXTERN_C BAAPI UserExperienceOnPlanMsiFeature( | 1528 | EXTERN_C BAAPI UserExperienceOnPlanMsiFeature( |
| 1626 | __in BURN_USER_EXPERIENCE* pUserExperience, | 1529 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 1627 | __in_z LPCWSTR wzPackageId, | 1530 | __in_z LPCWSTR wzPackageId, |
diff --git a/src/engine/userexperience.h b/src/engine/userexperience.h index a02d968c..3176e762 100644 --- a/src/engine/userexperience.h +++ b/src/engine/userexperience.h | |||
| @@ -185,12 +185,6 @@ BAAPI UserExperienceOnDetectBegin( | |||
| 185 | __in BOOL fInstalled, | 185 | __in BOOL fInstalled, |
| 186 | __in DWORD cPackages | 186 | __in DWORD cPackages |
| 187 | ); | 187 | ); |
| 188 | BAAPI UserExperienceOnDetectCompatibleMsiPackage( | ||
| 189 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 190 | __in_z LPCWSTR wzPackageId, | ||
| 191 | __in_z LPCWSTR wzCompatiblePackageId, | ||
| 192 | __in VERUTIL_VERSION* pCompatiblePackageVersion | ||
| 193 | ); | ||
| 194 | BAAPI UserExperienceOnDetectComplete( | 188 | BAAPI UserExperienceOnDetectComplete( |
| 195 | __in BURN_USER_EXPERIENCE* pUserExperience, | 189 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 196 | __in HRESULT hrStatus | 190 | __in HRESULT hrStatus |
| @@ -354,23 +348,6 @@ BAAPI UserExperienceOnPlanBegin( | |||
| 354 | __in BURN_USER_EXPERIENCE* pUserExperience, | 348 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 355 | __in DWORD cPackages | 349 | __in DWORD cPackages |
| 356 | ); | 350 | ); |
| 357 | BAAPI UserExperienceOnPlanCompatibleMsiPackageBegin( | ||
| 358 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 359 | __in_z LPCWSTR wzPackageId, | ||
| 360 | __in_z LPCWSTR wzCompatiblePackageId, | ||
| 361 | __in VERUTIL_VERSION* pCompatiblePackageVersion, | ||
| 362 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState | ||
| 363 | ); | ||
| 364 | BAAPI UserExperienceOnPlanCompatibleMsiPackageComplete( | ||
| 365 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
| 366 | __in_z LPCWSTR wzPackageId, | ||
| 367 | __in_z LPCWSTR wzCompatiblePackageId, | ||
| 368 | __in HRESULT hrStatus, | ||
| 369 | __in BOOTSTRAPPER_PACKAGE_STATE state, | ||
| 370 | __in BOOTSTRAPPER_REQUEST_STATE requested, | ||
| 371 | __in BOOTSTRAPPER_ACTION_STATE execute, | ||
| 372 | __in BOOTSTRAPPER_ACTION_STATE rollback | ||
| 373 | ); | ||
| 374 | BAAPI UserExperienceOnPlanComplete( | 351 | BAAPI UserExperienceOnPlanComplete( |
| 375 | __in BURN_USER_EXPERIENCE* pUserExperience, | 352 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 376 | __in HRESULT hrStatus | 353 | __in HRESULT hrStatus |
