summaryrefslogtreecommitdiff
path: root/src/burn/engine/userexperience.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-05-13 13:50:50 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-05-14 11:12:31 -0500
commit6a6974a15deb6edf593736cdb8043bfb93064782 (patch)
tree0ae2afffcd02967ba3fe0f0a5d3e9273811f1e6f /src/burn/engine/userexperience.cpp
parent7d56566b7c51c49ded526466dfae6af9e1709040 (diff)
downloadwix-6a6974a15deb6edf593736cdb8043bfb93064782.tar.gz
wix-6a6974a15deb6edf593736cdb8043bfb93064782.tar.bz2
wix-6a6974a15deb6edf593736cdb8043bfb93064782.zip
Move infinite loop detection into the hosts.
Tell the BA during Destroy whether it will be reloaded, and let the BA decide then whether it's module should be unloaded. Show error when infinite prereq loop detected. Only clip the exit code if they're Win32 errors. Set related bundle type to none to avoid downgrades during preqba.
Diffstat (limited to 'src/burn/engine/userexperience.cpp')
-rw-r--r--src/burn/engine/userexperience.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/burn/engine/userexperience.cpp b/src/burn/engine/userexperience.cpp
index 4325a6ee..87ef4de1 100644
--- a/src/burn/engine/userexperience.cpp
+++ b/src/burn/engine/userexperience.cpp
@@ -122,7 +122,6 @@ extern "C" HRESULT UserExperienceLoad(
122 122
123 pUserExperience->pfnBAProc = results.pfnBootstrapperApplicationProc; 123 pUserExperience->pfnBAProc = results.pfnBootstrapperApplicationProc;
124 pUserExperience->pvBAProcContext = results.pvBootstrapperApplicationProcContext; 124 pUserExperience->pvBAProcContext = results.pvBootstrapperApplicationProcContext;
125 pUserExperience->fDisableUnloading = results.fDisableUnloading;
126 125
127LExit: 126LExit:
128 return hr; 127 return hr;
@@ -133,10 +132,18 @@ LExit:
133 132
134*******************************************************************/ 133*******************************************************************/
135extern "C" HRESULT UserExperienceUnload( 134extern "C" HRESULT UserExperienceUnload(
136 __in BURN_USER_EXPERIENCE* pUserExperience 135 __in BURN_USER_EXPERIENCE* pUserExperience,
136 __in BOOL fReload
137 ) 137 )
138{ 138{
139 HRESULT hr = S_OK; 139 HRESULT hr = S_OK;
140 BOOTSTRAPPER_DESTROY_ARGS args = { };
141 BOOTSTRAPPER_DESTROY_RESULTS results = { };
142
143 args.cbSize = sizeof(BOOTSTRAPPER_DESTROY_ARGS);
144 args.fReload = fReload;
145
146 results.cbSize = sizeof(BOOTSTRAPPER_DESTROY_RESULTS);
140 147
141 if (pUserExperience->hUXModule) 148 if (pUserExperience->hUXModule)
142 { 149 {
@@ -144,11 +151,11 @@ extern "C" HRESULT UserExperienceUnload(
144 PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = (PFN_BOOTSTRAPPER_APPLICATION_DESTROY)::GetProcAddress(pUserExperience->hUXModule, "BootstrapperApplicationDestroy"); 151 PFN_BOOTSTRAPPER_APPLICATION_DESTROY pfnDestroy = (PFN_BOOTSTRAPPER_APPLICATION_DESTROY)::GetProcAddress(pUserExperience->hUXModule, "BootstrapperApplicationDestroy");
145 if (pfnDestroy) 152 if (pfnDestroy)
146 { 153 {
147 pfnDestroy(); 154 pfnDestroy(&args, &results);
148 } 155 }
149 156
150 // Free BA DLL if it supports it. 157 // Free BA DLL if it supports it.
151 if (!pUserExperience->fDisableUnloading && !::FreeLibrary(pUserExperience->hUXModule)) 158 if (!results.fDisableUnloading && !::FreeLibrary(pUserExperience->hUXModule))
152 { 159 {
153 hr = HRESULT_FROM_WIN32(::GetLastError()); 160 hr = HRESULT_FROM_WIN32(::GetLastError());
154 TraceError(hr, "Failed to unload BA DLL."); 161 TraceError(hr, "Failed to unload BA DLL.");