diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-02-03 17:09:50 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-02-04 22:16:10 -0600 |
| commit | c6c17104b50936432a3fe9ca214ba9a3dfa32780 (patch) | |
| tree | 7ad23896fd7e1768a5f81ebb4dc2abe99718eadb /src/engine/userexperience.cpp | |
| parent | fd8c2b0899bfbce07386af245c04eb21dc01cbdf (diff) | |
| download | wix-c6c17104b50936432a3fe9ca214ba9a3dfa32780.tar.gz wix-c6c17104b50936432a3fe9ca214ba9a3dfa32780.tar.bz2 wix-c6c17104b50936432a3fe9ca214ba9a3dfa32780.zip | |
Automatically uninstall the bundle after Quit if eligible.
For now, the requirements are:
* The bundle is installed and
* The bundle is per-user or has already elevated and
* No non-permanent packages are installed and
* No non-permanent packages are cached and
* No related bundle would run by default during uninstall and
* The bundle didn't Uninstall/Cache/Install/Modify/Repair and
* The BA didn't opt out of this behavior
Diffstat (limited to 'src/engine/userexperience.cpp')
| -rw-r--r-- | src/engine/userexperience.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index 3a36cab6..a0fb341d 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp | |||
| @@ -736,7 +736,8 @@ LExit: | |||
| 736 | 736 | ||
| 737 | EXTERN_C BAAPI UserExperienceOnDetectComplete( | 737 | EXTERN_C BAAPI UserExperienceOnDetectComplete( |
| 738 | __in BURN_USER_EXPERIENCE* pUserExperience, | 738 | __in BURN_USER_EXPERIENCE* pUserExperience, |
| 739 | __in HRESULT hrStatus | 739 | __in HRESULT hrStatus, |
| 740 | __in BOOL fEligibleForCleanup | ||
| 740 | ) | 741 | ) |
| 741 | { | 742 | { |
| 742 | HRESULT hr = S_OK; | 743 | HRESULT hr = S_OK; |
| @@ -745,6 +746,7 @@ EXTERN_C BAAPI UserExperienceOnDetectComplete( | |||
| 745 | 746 | ||
| 746 | args.cbSize = sizeof(args); | 747 | args.cbSize = sizeof(args); |
| 747 | args.hrStatus = hrStatus; | 748 | args.hrStatus = hrStatus; |
| 749 | args.fEligibleForCleanup = fEligibleForCleanup; | ||
| 748 | 750 | ||
| 749 | results.cbSize = sizeof(results); | 751 | results.cbSize = sizeof(results); |
| 750 | 752 | ||
| @@ -2296,12 +2298,18 @@ static HRESULT SendBAMessage( | |||
| 2296 | { | 2298 | { |
| 2297 | HRESULT hr = S_OK; | 2299 | HRESULT hr = S_OK; |
| 2298 | 2300 | ||
| 2301 | if (!pUserExperience->hUXModule) | ||
| 2302 | { | ||
| 2303 | ExitFunction(); | ||
| 2304 | } | ||
| 2305 | |||
| 2299 | hr = pUserExperience->pfnBAProc(message, pvArgs, pvResults, pUserExperience->pvBAProcContext); | 2306 | hr = pUserExperience->pfnBAProc(message, pvArgs, pvResults, pUserExperience->pvBAProcContext); |
| 2300 | if (hr == E_NOTIMPL) | 2307 | if (hr == E_NOTIMPL) |
| 2301 | { | 2308 | { |
| 2302 | hr = S_OK; | 2309 | hr = S_OK; |
| 2303 | } | 2310 | } |
| 2304 | 2311 | ||
| 2312 | LExit: | ||
| 2305 | return hr; | 2313 | return hr; |
| 2306 | } | 2314 | } |
| 2307 | 2315 | ||
| @@ -2314,11 +2322,17 @@ static HRESULT SendBAMessageFromInactiveEngine( | |||
| 2314 | { | 2322 | { |
| 2315 | HRESULT hr = S_OK; | 2323 | HRESULT hr = S_OK; |
| 2316 | 2324 | ||
| 2325 | if (!pUserExperience->hUXModule) | ||
| 2326 | { | ||
| 2327 | ExitFunction(); | ||
| 2328 | } | ||
| 2329 | |||
| 2317 | UserExperienceDeactivateEngine(pUserExperience); | 2330 | UserExperienceDeactivateEngine(pUserExperience); |
| 2318 | 2331 | ||
| 2319 | hr = SendBAMessage(pUserExperience, message, pvArgs, pvResults); | 2332 | hr = SendBAMessage(pUserExperience, message, pvArgs, pvResults); |
| 2320 | 2333 | ||
| 2321 | UserExperienceActivateEngine(pUserExperience); | 2334 | UserExperienceActivateEngine(pUserExperience); |
| 2322 | 2335 | ||
| 2336 | LExit: | ||
| 2323 | return hr; | 2337 | return hr; |
| 2324 | } | 2338 | } |
