diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-02-22 20:23:43 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-02-22 23:37:57 -0600 |
| commit | 8e8f724d90c6835febb8b5865009746aea73a334 (patch) | |
| tree | b255c0a7232af8d24bcf44fd476b95bdfdcfe777 /src/burn/engine/core.cpp | |
| parent | 0740d93ca8be06ec0e5da5b51ceff52f67ab5bf5 (diff) | |
| download | wix-8e8f724d90c6835febb8b5865009746aea73a334.tar.gz wix-8e8f724d90c6835febb8b5865009746aea73a334.tar.bz2 wix-8e8f724d90c6835febb8b5865009746aea73a334.zip | |
Add UnsafeUninstall action.
Fixes #6721
Diffstat (limited to 'src/burn/engine/core.cpp')
| -rw-r--r-- | src/burn/engine/core.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index 8fac7bd0..9d5364a4 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
| @@ -488,7 +488,7 @@ extern "C" HRESULT CorePlan( | |||
| 488 | pEngineState->plan.pPayloads = &pEngineState->payloads; | 488 | pEngineState->plan.pPayloads = &pEngineState->payloads; |
| 489 | pEngineState->plan.wzBundleId = pEngineState->registration.sczId; | 489 | pEngineState->plan.wzBundleId = pEngineState->registration.sczId; |
| 490 | pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; | 490 | pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; |
| 491 | pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback; | 491 | pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action; |
| 492 | pEngineState->plan.fBundleAlreadyRegistered = pEngineState->registration.fInstalled; | 492 | pEngineState->plan.fBundleAlreadyRegistered = pEngineState->registration.fInstalled; |
| 493 | 493 | ||
| 494 | hr = PlanSetVariables(action, &pEngineState->variables); | 494 | hr = PlanSetVariables(action, &pEngineState->variables); |
| @@ -756,6 +756,14 @@ extern "C" HRESULT CoreApply( | |||
| 756 | } | 756 | } |
| 757 | } | 757 | } |
| 758 | 758 | ||
| 759 | if (BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action) | ||
| 760 | { | ||
| 761 | fSuspend = FALSE; | ||
| 762 | restart = BOOTSTRAPPER_APPLY_RESTART_NONE; | ||
| 763 | |||
| 764 | LogId(REPORT_STANDARD, MSG_UNSAFE_APPLY_COMPLETED); | ||
| 765 | } | ||
| 766 | |||
| 759 | if (fSuspend || BOOTSTRAPPER_APPLY_RESTART_INITIATED == restart) | 767 | if (fSuspend || BOOTSTRAPPER_APPLY_RESTART_INITIATED == restart) |
| 760 | { | 768 | { |
| 761 | // Leave cache alone. | 769 | // Leave cache alone. |
| @@ -773,7 +781,7 @@ extern "C" HRESULT CoreApply( | |||
| 773 | } | 781 | } |
| 774 | 782 | ||
| 775 | LExit: | 783 | LExit: |
| 776 | if (fRollbackCache) | 784 | if (fRollbackCache && !pEngineState->plan.fDisableRollback) |
| 777 | { | 785 | { |
| 778 | ApplyCacheRollback(&pEngineState->userExperience, &pEngineState->plan, pEngineState->companionConnection.hCachePipe, &applyContext); | 786 | ApplyCacheRollback(&pEngineState->userExperience, &pEngineState->plan, pEngineState->companionConnection.hCachePipe, &applyContext); |
| 779 | } | 787 | } |
| @@ -978,6 +986,9 @@ static HRESULT CoreRecreateCommandLine( | |||
| 978 | case BOOTSTRAPPER_ACTION_UNINSTALL: | 986 | case BOOTSTRAPPER_ACTION_UNINSTALL: |
| 979 | hr = StrAllocConcat(psczCommandLine, L" /uninstall", 0); | 987 | hr = StrAllocConcat(psczCommandLine, L" /uninstall", 0); |
| 980 | break; | 988 | break; |
| 989 | case BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL: | ||
| 990 | hr = StrAllocConcat(psczCommandLine, L" /unsafeuninstall", 0); | ||
| 991 | break; | ||
| 981 | } | 992 | } |
| 982 | ExitOnFailure(hr, "Failed to append action state to command-line"); | 993 | ExitOnFailure(hr, "Failed to append action state to command-line"); |
| 983 | 994 | ||
| @@ -1414,6 +1425,13 @@ extern "C" HRESULT CoreParseCommandLine( | |||
| 1414 | ExitOnFailure(hr, "Failed to copy path for layout directory."); | 1425 | ExitOnFailure(hr, "Failed to copy path for layout directory."); |
| 1415 | } | 1426 | } |
| 1416 | } | 1427 | } |
| 1428 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"unsafeuninstall", -1)) | ||
| 1429 | { | ||
| 1430 | if (BOOTSTRAPPER_ACTION_HELP != pCommand->action) | ||
| 1431 | { | ||
| 1432 | pCommand->action = BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL; | ||
| 1433 | } | ||
| 1434 | } | ||
| 1417 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"uninstall", -1)) | 1435 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"uninstall", -1)) |
| 1418 | { | 1436 | { |
| 1419 | if (BOOTSTRAPPER_ACTION_HELP != pCommand->action) | 1437 | if (BOOTSTRAPPER_ACTION_HELP != pCommand->action) |
| @@ -2207,7 +2225,7 @@ static void LogPackages( | |||
| 2207 | __in const BOOTSTRAPPER_ACTION action | 2225 | __in const BOOTSTRAPPER_ACTION action |
| 2208 | ) | 2226 | ) |
| 2209 | { | 2227 | { |
| 2210 | BOOL fUninstalling = BOOTSTRAPPER_ACTION_UNINSTALL == action; | 2228 | BOOL fUninstalling = BOOTSTRAPPER_ACTION_UNINSTALL == action || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == action; |
| 2211 | 2229 | ||
| 2212 | if (pUpgradeBundlePackage) | 2230 | if (pUpgradeBundlePackage) |
| 2213 | { | 2231 | { |
| @@ -2286,8 +2304,8 @@ static void LogPackages( | |||
| 2286 | } | 2304 | } |
| 2287 | } | 2305 | } |
| 2288 | 2306 | ||
| 2289 | // Display related bundles last if caching, installing, modifying, or repairing. | 2307 | // Display related bundles last if not uninstalling. |
| 2290 | if (BOOTSTRAPPER_ACTION_UNINSTALL < action) | 2308 | if (!fUninstalling) |
| 2291 | { | 2309 | { |
| 2292 | LogRelatedBundles(pRelatedBundles, FALSE); | 2310 | LogRelatedBundles(pRelatedBundles, FALSE); |
| 2293 | } | 2311 | } |
