From 8e8f724d90c6835febb8b5865009746aea73a334 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 22 Feb 2022 20:23:43 -0600 Subject: Add UnsafeUninstall action. Fixes #6721 --- src/burn/engine/apply.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/burn/engine/apply.cpp') diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index 73f8fc72..4e652768 100644 --- a/src/burn/engine/apply.cpp +++ b/src/burn/engine/apply.cpp @@ -505,8 +505,7 @@ extern "C" HRESULT ApplyUnregister( registrationType = defaultRegistrationType; - hr = UserExperienceOnUnregisterBegin(&pEngineState->userExperience, ®istrationType); - ExitOnRootFailure(hr, "BA aborted unregister begin."); + UserExperienceOnUnregisterBegin(&pEngineState->userExperience, ®istrationType); // Barring the special cases, if it was determined that we should keep the registration then // do that, otherwise the resume mode is NONE and registration will be removed. @@ -517,7 +516,7 @@ extern "C" HRESULT ApplyUnregister( // If apply failed in any way and we're going to be keeping the bundle registered then // execute any rollback dependency registration actions. - if (fFailed && BURN_RESUME_MODE_NONE < resumeMode) + if (fFailed && BURN_RESUME_MODE_NONE < resumeMode && !pEngineState->plan.fDisableRollback) { // Execute any rollback registration actions. HRESULT hrRegistrationRollback = ExecuteDependentRegistrationActions(pEngineState->companionConnection.hPipe, &pEngineState->registration, pEngineState->plan.rgRollbackRegistrationActions, pEngineState->plan.cRollbackRegistrationActions); @@ -526,6 +525,14 @@ extern "C" HRESULT ApplyUnregister( LogId(REPORT_STANDARD, MSG_SESSION_END, pEngineState->registration.sczRegistrationKey, LoggingResumeModeToString(resumeMode), LoggingRestartToString(restart), LoggingBoolToString(pEngineState->registration.fDisableResume), LoggingRegistrationTypeToString(defaultRegistrationType), LoggingRegistrationTypeToString(registrationType)); + if (BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action) + { + registrationType = BOOTSTRAPPER_REGISTRATION_TYPE_NONE; + resumeMode = BURN_RESUME_MODE_NONE; + + LogId(REPORT_STANDARD, MSG_UNSAFE_SESSION_END); + } + if (pEngineState->registration.fPerMachine) { hr = ElevationSessionEnd(pEngineState->companionConnection.hPipe, resumeMode, restart, pEngineState->registration.fDetectedForeignProviderKeyBundleId, registrationType); -- cgit v1.2.3-55-g6feb