diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-02-24 17:42:31 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-03-02 15:47:43 -0600 |
| commit | 100944a40f363c1a8ce0cd8c5c27728d1db0912e (patch) | |
| tree | d0058249eebb18e738117c7b858671e2777f1340 /src | |
| parent | 7cf03f0ecc0a54062548656fadcacfba996cd459 (diff) | |
| download | wix-100944a40f363c1a8ce0cd8c5c27728d1db0912e.tar.gz wix-100944a40f363c1a8ce0cd8c5c27728d1db0912e.tar.bz2 wix-100944a40f363c1a8ce0cd8c5c27728d1db0912e.zip | |
Let the BA request the bundle to stay installed from OnUnregisterBegin.
#6297
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | 3 | ||||
| -rw-r--r-- | src/engine/apply.cpp | 2 | ||||
| -rw-r--r-- | src/engine/userexperience.cpp | 10 | ||||
| -rw-r--r-- | src/engine/userexperience.h | 3 |
4 files changed, 11 insertions, 7 deletions
diff --git a/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h index 0a89b3f4..6cf3477c 100644 --- a/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h +++ b/src/WixToolset.BootstrapperCore.Native/inc/BootstrapperApplication.h | |||
| @@ -1089,12 +1089,13 @@ struct BA_ONSYSTEMSHUTDOWN_RESULTS | |||
| 1089 | struct BA_ONUNREGISTERBEGIN_ARGS | 1089 | struct BA_ONUNREGISTERBEGIN_ARGS |
| 1090 | { | 1090 | { |
| 1091 | DWORD cbSize; | 1091 | DWORD cbSize; |
| 1092 | BOOL fKeepRegistration; | ||
| 1092 | }; | 1093 | }; |
| 1093 | 1094 | ||
| 1094 | struct BA_ONUNREGISTERBEGIN_RESULTS | 1095 | struct BA_ONUNREGISTERBEGIN_RESULTS |
| 1095 | { | 1096 | { |
| 1096 | DWORD cbSize; | 1097 | DWORD cbSize; |
| 1097 | BOOL fCancel; | 1098 | BOOL fForceKeepRegistration; |
| 1098 | }; | 1099 | }; |
| 1099 | 1100 | ||
| 1100 | struct BA_ONUNREGISTERCOMPLETE_ARGS | 1101 | struct BA_ONUNREGISTERCOMPLETE_ARGS |
diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index f57a56fe..3fbab61a 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp | |||
| @@ -399,7 +399,7 @@ extern "C" HRESULT ApplyUnregister( | |||
| 399 | 399 | ||
| 400 | CalculateKeepRegistration(pEngineState, &fKeepRegistration); | 400 | CalculateKeepRegistration(pEngineState, &fKeepRegistration); |
| 401 | 401 | ||
| 402 | hr = UserExperienceOnUnregisterBegin(&pEngineState->userExperience); | 402 | hr = UserExperienceOnUnregisterBegin(&pEngineState->userExperience, &fKeepRegistration); |
| 403 | ExitOnRootFailure(hr, "BA aborted unregister begin."); | 403 | ExitOnRootFailure(hr, "BA aborted unregister begin."); |
| 404 | 404 | ||
| 405 | // Calculate the correct resume mode. If a restart has been initiated, that trumps all other | 405 | // Calculate the correct resume mode. If a restart has been initiated, that trumps all other |
diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index 88b07d68..84e88718 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp | |||
| @@ -111,7 +111,7 @@ extern "C" HRESULT UserExperienceLoad( | |||
| 111 | args.pCommand = pCommand; | 111 | args.pCommand = pCommand; |
| 112 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; | 112 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; |
| 113 | args.pvBootstrapperEngineProcContext = pEngineContext; | 113 | args.pvBootstrapperEngineProcContext = pEngineContext; |
| 114 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 2, 18, 0); | 114 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2021, 2, 24, 0); |
| 115 | 115 | ||
| 116 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | 116 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); |
| 117 | 117 | ||
| @@ -2011,7 +2011,8 @@ LExit: | |||
| 2011 | } | 2011 | } |
| 2012 | 2012 | ||
| 2013 | EXTERN_C BAAPI UserExperienceOnUnregisterBegin( | 2013 | EXTERN_C BAAPI UserExperienceOnUnregisterBegin( |
| 2014 | __in BURN_USER_EXPERIENCE* pUserExperience | 2014 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 2015 | __inout BOOL* pfKeepRegistration | ||
| 2015 | ) | 2016 | ) |
| 2016 | { | 2017 | { |
| 2017 | HRESULT hr = S_OK; | 2018 | HRESULT hr = S_OK; |
| @@ -2019,15 +2020,16 @@ EXTERN_C BAAPI UserExperienceOnUnregisterBegin( | |||
| 2019 | BA_ONUNREGISTERBEGIN_RESULTS results = { }; | 2020 | BA_ONUNREGISTERBEGIN_RESULTS results = { }; |
| 2020 | 2021 | ||
| 2021 | args.cbSize = sizeof(args); | 2022 | args.cbSize = sizeof(args); |
| 2023 | args.fKeepRegistration = *pfKeepRegistration; | ||
| 2022 | 2024 | ||
| 2023 | results.cbSize = sizeof(results); | 2025 | results.cbSize = sizeof(results); |
| 2024 | 2026 | ||
| 2025 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERBEGIN, &args, &results); | 2027 | hr = SendBAMessage(pUserExperience, BOOTSTRAPPER_APPLICATION_MESSAGE_ONUNREGISTERBEGIN, &args, &results); |
| 2026 | ExitOnFailure(hr, "BA OnUnregisterBegin failed."); | 2028 | ExitOnFailure(hr, "BA OnUnregisterBegin failed."); |
| 2027 | 2029 | ||
| 2028 | if (results.fCancel) | 2030 | if (!args.fKeepRegistration && results.fForceKeepRegistration) |
| 2029 | { | 2031 | { |
| 2030 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | 2032 | *pfKeepRegistration = TRUE; |
| 2031 | } | 2033 | } |
| 2032 | 2034 | ||
| 2033 | LExit: | 2035 | LExit: |
diff --git a/src/engine/userexperience.h b/src/engine/userexperience.h index f02e6279..754a9030 100644 --- a/src/engine/userexperience.h +++ b/src/engine/userexperience.h | |||
| @@ -452,7 +452,8 @@ BAAPI UserExperienceOnSystemShutdown( | |||
| 452 | __inout BOOL* pfCancel | 452 | __inout BOOL* pfCancel |
| 453 | ); | 453 | ); |
| 454 | BAAPI UserExperienceOnUnregisterBegin( | 454 | BAAPI UserExperienceOnUnregisterBegin( |
| 455 | __in BURN_USER_EXPERIENCE* pUserExperience | 455 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 456 | __inout BOOL* pfKeepRegistration | ||
| 456 | ); | 457 | ); |
| 457 | BAAPI UserExperienceOnUnregisterComplete( | 458 | BAAPI UserExperienceOnUnregisterComplete( |
| 458 | __in BURN_USER_EXPERIENCE* pUserExperience, | 459 | __in BURN_USER_EXPERIENCE* pUserExperience, |
