diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-02-01 18:54:54 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-02-04 22:16:10 -0600 |
commit | cede270b2bd3da6bd8d5205b8834e786c8d6c1ce (patch) | |
tree | fc37ad41e0a03f67fc2a8946231e519551cdcc95 /src/engine/elevation.cpp | |
parent | f1f1a124df59e8639c2bcbfa7d3a4b37fb348bb7 (diff) | |
download | wix-cede270b2bd3da6bd8d5205b8834e786c8d6c1ce.tar.gz wix-cede270b2bd3da6bd8d5205b8834e786c8d6c1ce.tar.bz2 wix-cede270b2bd3da6bd8d5205b8834e786c8d6c1ce.zip |
Remove feature to uninstall compatible orphaned MSI packages.
Diffstat (limited to 'src/engine/elevation.cpp')
-rw-r--r-- | src/engine/elevation.cpp | 98 |
1 files changed, 0 insertions, 98 deletions
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 |