summaryrefslogtreecommitdiff
path: root/src/ext/Bal/wixstdba/wixstdba.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/ext/Bal/wixstdba/wixstdba.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/ext/Bal/wixstdba/wixstdba.cpp')
-rw-r--r--src/ext/Bal/wixstdba/wixstdba.cpp54
1 files changed, 17 insertions, 37 deletions
diff --git a/src/ext/Bal/wixstdba/wixstdba.cpp b/src/ext/Bal/wixstdba/wixstdba.cpp
index a96f1738..47f3f677 100644
--- a/src/ext/Bal/wixstdba/wixstdba.cpp
+++ b/src/ext/Bal/wixstdba/wixstdba.cpp
@@ -50,7 +50,7 @@ extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
50 hr = BalInitializeFromCreateArgs(pArgs, &pEngine); 50 hr = BalInitializeFromCreateArgs(pArgs, &pEngine);
51 ExitOnFailure(hr, "Failed to initialize Bal."); 51 ExitOnFailure(hr, "Failed to initialize Bal.");
52 52
53 hr = CreateBootstrapperApplication(vhInstance, FALSE, S_OK, pEngine, pArgs, pResults, &vpApplication); 53 hr = CreateBootstrapperApplication(vhInstance, NULL, pEngine, pArgs, pResults, &vpApplication);
54 BalExitOnFailure(hr, "Failed to create bootstrapper application interface."); 54 BalExitOnFailure(hr, "Failed to create bootstrapper application interface.");
55 55
56LExit: 56LExit:
@@ -60,45 +60,24 @@ LExit:
60} 60}
61 61
62 62
63extern "C" void WINAPI BootstrapperApplicationDestroy() 63extern "C" void WINAPI BootstrapperApplicationDestroy(
64{ 64 __in const BOOTSTRAPPER_DESTROY_ARGS* pArgs,
65 ReleaseNullObject(vpApplication); 65 __in BOOTSTRAPPER_DESTROY_RESULTS* pResults
66 BalUninitialize();
67 DutilUninitialize();
68}
69
70
71extern "C" HRESULT WINAPI DncPrereqBootstrapperApplicationCreate(
72 __in HRESULT hrHostInitialization,
73 __in IBootstrapperEngine* pEngine,
74 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
75 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
76 ) 66 )
77{ 67{
78 HRESULT hr = S_OK; 68 if (vpApplication)
79 69 {
80 DutilInitialize(&WixstdbaTraceError); 70 DestroyBootstrapperApplication(vpApplication, pArgs, pResults);
81 71 }
82 BalInitialize(pEngine);
83
84 hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication);
85 BalExitOnFailure(hr, "Failed to create .NET Core prerequisite bootstrapper application interface.");
86
87LExit:
88 return hr;
89}
90
91 72
92extern "C" void WINAPI DncPrereqBootstrapperApplicationDestroy()
93{
94 ReleaseNullObject(vpApplication); 73 ReleaseNullObject(vpApplication);
95 BalUninitialize(); 74 BalUninitialize();
96 DutilUninitialize(); 75 DutilUninitialize();
97} 76}
98 77
99 78
100extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate( 79extern "C" HRESULT WINAPI PrereqBootstrapperApplicationCreate(
101 __in HRESULT hrHostInitialization, 80 __in_opt PREQBA_DATA* pPrereqData,
102 __in IBootstrapperEngine* pEngine, 81 __in IBootstrapperEngine* pEngine,
103 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, 82 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
104 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults 83 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
@@ -110,19 +89,20 @@ extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate(
110 89
111 BalInitialize(pEngine); 90 BalInitialize(pEngine);
112 91
113 hr = CreateBootstrapperApplication(vhInstance, TRUE, hrHostInitialization, pEngine, pArgs, pResults, &vpApplication); 92 hr = CreateBootstrapperApplication(vhInstance, pPrereqData, pEngine, pArgs, pResults, &vpApplication);
114 BalExitOnFailure(hr, "Failed to create managed prerequisite bootstrapper application interface."); 93 BalExitOnFailure(hr, "Failed to create prerequisite bootstrapper application interface.");
115 94
116LExit: 95LExit:
117 return hr; 96 return hr;
118} 97}
119 98
120 99
121extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy() 100extern "C" void WINAPI PrereqBootstrapperApplicationDestroy(
101 __in const BOOTSTRAPPER_DESTROY_ARGS* pArgs,
102 __in BOOTSTRAPPER_DESTROY_RESULTS* pResults
103 )
122{ 104{
123 ReleaseNullObject(vpApplication); 105 BootstrapperApplicationDestroy(pArgs, pResults);
124 BalUninitialize();
125 DutilUninitialize();
126} 106}
127 107
128static void CALLBACK WixstdbaTraceError( 108static void CALLBACK WixstdbaTraceError(