diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2019-12-21 11:23:03 +1100 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2019-12-22 13:19:29 +1000 |
commit | f3c383c2412e376353d64a8b744184fa1cee1c6e (patch) | |
tree | 4e092e2ce0e968e84df0e9c2ce41c13d4715bf4f /src/balutil | |
parent | 46d46435592ba779d6c8d017859c27d90b092aa6 (diff) | |
download | wix-f3c383c2412e376353d64a8b744184fa1cee1c6e.tar.gz wix-f3c383c2412e376353d64a8b744184fa1cee1c6e.tar.bz2 wix-f3c383c2412e376353d64a8b744184fa1cee1c6e.zip |
Move IBootstrapperApplication and IBootstrapperEngine into balutil.
Diffstat (limited to 'src/balutil')
-rw-r--r-- | src/balutil/inc/IBootstrapperApplication.h | 525 | ||||
-rw-r--r-- | src/balutil/inc/IBootstrapperEngine.h | 128 |
2 files changed, 653 insertions, 0 deletions
diff --git a/src/balutil/inc/IBootstrapperApplication.h b/src/balutil/inc/IBootstrapperApplication.h new file mode 100644 index 00000000..6ab7ed20 --- /dev/null +++ b/src/balutil/inc/IBootstrapperApplication.h | |||
@@ -0,0 +1,525 @@ | |||
1 | #pragma once | ||
2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
3 | |||
4 | |||
5 | DECLARE_INTERFACE_IID_(IBootstrapperApplication, IUnknown, "53C31D56-49C0-426B-AB06-099D717C67FE") | ||
6 | { | ||
7 | // OnStartup - called when the engine is ready for the bootstrapper application to start. | ||
8 | // | ||
9 | STDMETHOD(OnStartup)() = 0; | ||
10 | |||
11 | // OnShutdown - called after the bootstrapper application quits the engine. | ||
12 | STDMETHOD(OnShutdown)( | ||
13 | __inout BOOTSTRAPPER_SHUTDOWN_ACTION* pAction | ||
14 | ) = 0; | ||
15 | |||
16 | // OnSystemShutdown - called when the operating system is instructed to shutdown the machine. | ||
17 | STDMETHOD(OnSystemShutdown)( | ||
18 | __in DWORD dwEndSession, | ||
19 | __inout BOOL* pfCancel | ||
20 | ) = 0; | ||
21 | |||
22 | // OnDetectBegin - called when the engine begins detection. | ||
23 | STDMETHOD(OnDetectBegin)( | ||
24 | __in BOOL fInstalled, | ||
25 | __in DWORD cPackages, | ||
26 | __inout BOOL* pfCancel | ||
27 | ) = 0; | ||
28 | |||
29 | // OnDetectForwardCompatibleBundle - called when the engine detects a forward compatible bundle. | ||
30 | STDMETHOD(OnDetectForwardCompatibleBundle)( | ||
31 | __in_z LPCWSTR wzBundleId, | ||
32 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | ||
33 | __in_z LPCWSTR wzBundleTag, | ||
34 | __in BOOL fPerMachine, | ||
35 | __in DWORD64 dw64Version, | ||
36 | __inout BOOL* pfCancel, | ||
37 | __inout BOOL* pfIgnoreBundle | ||
38 | ) = 0; | ||
39 | |||
40 | // OnDetectUpdateBegin - called when the engine begins detection for bundle update. | ||
41 | STDMETHOD(OnDetectUpdateBegin)( | ||
42 | __in_z LPCWSTR wzUpdateLocation, | ||
43 | __inout BOOL* pfCancel, | ||
44 | __inout BOOL* pfSkip | ||
45 | ) = 0; | ||
46 | |||
47 | // OnDetectUpdate - called when the engine has an update candidate for bundle update. | ||
48 | STDMETHOD(OnDetectUpdate)( | ||
49 | __in_z_opt LPCWSTR wzUpdateLocation, | ||
50 | __in DWORD64 dw64Size, | ||
51 | __in DWORD64 dw64Version, | ||
52 | __in_z_opt LPCWSTR wzTitle, | ||
53 | __in_z_opt LPCWSTR wzSummary, | ||
54 | __in_z_opt LPCWSTR wzContentType, | ||
55 | __in_z_opt LPCWSTR wzContent, | ||
56 | __inout BOOL* pfCancel, | ||
57 | __inout BOOL* pfStopProcessingUpdates | ||
58 | ) = 0; | ||
59 | |||
60 | // OnDetectUpdateComplete - called when the engine completes detection for bundle update. | ||
61 | STDMETHOD(OnDetectUpdateComplete)( | ||
62 | __in HRESULT hrStatus, | ||
63 | __inout BOOL* pfIgnoreError | ||
64 | ) = 0; | ||
65 | |||
66 | // OnDetectRelatedBundle - called when the engine detects a related bundle. | ||
67 | STDMETHOD(OnDetectRelatedBundle)( | ||
68 | __in_z LPCWSTR wzBundleId, | ||
69 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | ||
70 | __in_z LPCWSTR wzBundleTag, | ||
71 | __in BOOL fPerMachine, | ||
72 | __in DWORD64 dw64Version, | ||
73 | __in BOOTSTRAPPER_RELATED_OPERATION operation, | ||
74 | __inout BOOL* pfCancel | ||
75 | ) = 0; | ||
76 | |||
77 | // OnDetectPackageBegin - called when the engine begins detecting a package. | ||
78 | STDMETHOD(OnDetectPackageBegin)( | ||
79 | __in_z LPCWSTR wzPackageId, | ||
80 | __inout BOOL* pfCancel | ||
81 | ) = 0; | ||
82 | |||
83 | // OnDetectCompatibleMsiPackage - called when the engine detects that a package is not installed but a newer package using the same provider key is. | ||
84 | STDMETHOD(OnDetectCompatibleMsiPackage)( | ||
85 | __in_z LPCWSTR wzPackageId, | ||
86 | __in_z LPCWSTR wzCompatiblePackageId, | ||
87 | __in DWORD64 dw64CompatiblePackageVersion, | ||
88 | __inout BOOL* pfCancel | ||
89 | ) = 0; | ||
90 | |||
91 | // OnDetectRelatedMsiPackage - called when the engine begins detects a related package. | ||
92 | STDMETHOD(OnDetectRelatedMsiPackage)( | ||
93 | __in_z LPCWSTR wzPackageId, | ||
94 | __in_z LPCWSTR wzUpgradeCode, | ||
95 | __in_z LPCWSTR wzProductCode, | ||
96 | __in BOOL fPerMachine, | ||
97 | __in DWORD64 dw64Version, | ||
98 | __in BOOTSTRAPPER_RELATED_OPERATION operation, | ||
99 | __inout BOOL* pfCancel | ||
100 | ) = 0; | ||
101 | |||
102 | // OnDetectTargetMsiPackage - called when the engine detects a target MSI package for | ||
103 | // an MSP package. | ||
104 | STDMETHOD(OnDetectTargetMsiPackage)( | ||
105 | __in_z LPCWSTR wzPackageId, | ||
106 | __in_z LPCWSTR wzProductCode, | ||
107 | __in BOOTSTRAPPER_PACKAGE_STATE patchState, | ||
108 | __inout BOOL* pfCancel | ||
109 | ) = 0; | ||
110 | |||
111 | // OnDetectMsiFeature - called when the engine detects a feature in an MSI package. | ||
112 | STDMETHOD(OnDetectMsiFeature)( | ||
113 | __in_z LPCWSTR wzPackageId, | ||
114 | __in_z LPCWSTR wzFeatureId, | ||
115 | __in BOOTSTRAPPER_FEATURE_STATE state, | ||
116 | __inout BOOL* pfCancel | ||
117 | ) = 0; | ||
118 | |||
119 | // OnDetectPackageComplete - called after the engine detects a package. | ||
120 | // | ||
121 | STDMETHOD(OnDetectPackageComplete)( | ||
122 | __in_z LPCWSTR wzPackageId, | ||
123 | __in HRESULT hrStatus, | ||
124 | __in BOOTSTRAPPER_PACKAGE_STATE state | ||
125 | ) = 0; | ||
126 | |||
127 | // OnDetectPackageComplete - called after the engine completes detection. | ||
128 | // | ||
129 | STDMETHOD(OnDetectComplete)( | ||
130 | __in HRESULT hrStatus | ||
131 | ) = 0; | ||
132 | |||
133 | // OnPlanBegin - called when the engine begins planning. | ||
134 | STDMETHOD(OnPlanBegin)( | ||
135 | __in DWORD cPackages, | ||
136 | __inout BOOL* pfCancel | ||
137 | ) = 0; | ||
138 | |||
139 | // OnPlanRelatedBundle - called when the engine begins planning a related bundle. | ||
140 | STDMETHOD(OnPlanRelatedBundle)( | ||
141 | __in_z LPCWSTR wzBundleId, | ||
142 | __in BOOTSTRAPPER_REQUEST_STATE recommendedState, | ||
143 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState, | ||
144 | __inout BOOL* pfCancel | ||
145 | ) = 0; | ||
146 | |||
147 | // OnPlanPackageBegin - called when the engine begins planning a package. | ||
148 | STDMETHOD(OnPlanPackageBegin)( | ||
149 | __in_z LPCWSTR wzPackageId, | ||
150 | __in BOOTSTRAPPER_REQUEST_STATE recommendedState, | ||
151 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState, | ||
152 | __inout BOOL* pfCancel | ||
153 | ) = 0; | ||
154 | |||
155 | // OnPlanCompatibleMsiPackageBegin - called when the engine plans a newer, compatible package using the same provider key. | ||
156 | STDMETHOD(OnPlanCompatibleMsiPackageBegin)( | ||
157 | __in_z LPCWSTR wzPackageId, | ||
158 | __in_z LPCWSTR wzCompatiblePackageId, | ||
159 | __in DWORD64 dw64CompatiblePackageVersion, | ||
160 | __in BOOTSTRAPPER_REQUEST_STATE recommendedState, | ||
161 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState, | ||
162 | __inout BOOL* pfCancel | ||
163 | ) = 0; | ||
164 | |||
165 | // OnPlanCompatibleMsiPackageComplete - called after the engine plans the package. | ||
166 | // | ||
167 | STDMETHOD(OnPlanCompatibleMsiPackageComplete)( | ||
168 | __in_z LPCWSTR wzPackageId, | ||
169 | __in_z LPCWSTR wzCompatiblePackageId, | ||
170 | __in HRESULT hrStatus, | ||
171 | __in BOOTSTRAPPER_PACKAGE_STATE state, | ||
172 | __in BOOTSTRAPPER_REQUEST_STATE requested, | ||
173 | __in BOOTSTRAPPER_ACTION_STATE execute, | ||
174 | __in BOOTSTRAPPER_ACTION_STATE rollback | ||
175 | ) = 0; | ||
176 | |||
177 | // OnPlanTargetMsiPackage - called when the engine plans an MSP package | ||
178 | // to apply to an MSI package. | ||
179 | STDMETHOD(OnPlanTargetMsiPackage)( | ||
180 | __in_z LPCWSTR wzPackageId, | ||
181 | __in_z LPCWSTR wzProductCode, | ||
182 | __in BOOTSTRAPPER_REQUEST_STATE recommendedState, | ||
183 | __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState, | ||
184 | __inout BOOL* pfCancel | ||
185 | ) = 0; | ||
186 | |||
187 | // OnPlanMsiFeature - called when the engine plans a feature in an | ||
188 | // MSI package. | ||
189 | STDMETHOD(OnPlanMsiFeature)( | ||
190 | __in_z LPCWSTR wzPackageId, | ||
191 | __in_z LPCWSTR wzFeatureId, | ||
192 | __in BOOTSTRAPPER_FEATURE_STATE recommendedState, | ||
193 | __inout BOOTSTRAPPER_FEATURE_STATE* pRequestedState, | ||
194 | __inout BOOL* pfCancel | ||
195 | ) = 0; | ||
196 | |||
197 | // OnPlanPackageComplete - called after the engine plans a package. | ||
198 | // | ||
199 | STDMETHOD(OnPlanPackageComplete)( | ||
200 | __in_z LPCWSTR wzPackageId, | ||
201 | __in HRESULT hrStatus, | ||
202 | __in BOOTSTRAPPER_PACKAGE_STATE state, | ||
203 | __in BOOTSTRAPPER_REQUEST_STATE requested, | ||
204 | __in BOOTSTRAPPER_ACTION_STATE execute, | ||
205 | __in BOOTSTRAPPER_ACTION_STATE rollback | ||
206 | ) = 0; | ||
207 | |||
208 | // OnPlanComplete - called when the engine completes planning. | ||
209 | // | ||
210 | STDMETHOD(OnPlanComplete)( | ||
211 | __in HRESULT hrStatus | ||
212 | ) = 0; | ||
213 | |||
214 | // OnApplyBegin - called when the engine begins applying the plan. | ||
215 | // | ||
216 | STDMETHOD(OnApplyBegin)( | ||
217 | __in DWORD dwPhaseCount, | ||
218 | __inout BOOL* pfCancel | ||
219 | ) = 0; | ||
220 | |||
221 | // OnElevateBegin - called before the engine displays an elevation prompt. | ||
222 | // Will only happen once per execution of the engine, | ||
223 | // assuming the elevation was successful. | ||
224 | STDMETHOD(OnElevateBegin)( | ||
225 | __inout BOOL* pfCancel | ||
226 | ) = 0; | ||
227 | |||
228 | // OnElevateComplete - called after the engine attempted to elevate. | ||
229 | // | ||
230 | STDMETHOD(OnElevateComplete)( | ||
231 | __in HRESULT hrStatus | ||
232 | ) = 0; | ||
233 | |||
234 | // OnProgress - called when the engine makes progress. | ||
235 | // | ||
236 | STDMETHOD(OnProgress)( | ||
237 | __in DWORD dwProgressPercentage, | ||
238 | __in DWORD dwOverallPercentage, | ||
239 | __inout BOOL* pfCancel | ||
240 | ) = 0; | ||
241 | |||
242 | // OnError - called when the engine encounters an error. | ||
243 | // | ||
244 | // nResult: | ||
245 | // uiFlags is a combination of valid ID* return values appropriate for | ||
246 | // the error. | ||
247 | // | ||
248 | // IDNOACTION instructs the engine to pass the error through to default | ||
249 | // handling which usually results in the apply failing. | ||
250 | STDMETHOD(OnError)( | ||
251 | __in BOOTSTRAPPER_ERROR_TYPE errorType, | ||
252 | __in_z_opt LPCWSTR wzPackageId, | ||
253 | __in DWORD dwCode, | ||
254 | __in_z_opt LPCWSTR wzError, | ||
255 | __in DWORD dwUIHint, | ||
256 | __in DWORD cData, | ||
257 | __in_ecount_z_opt(cData) LPCWSTR* rgwzData, | ||
258 | __in int nRecommendation, | ||
259 | __inout int* pResult | ||
260 | ) = 0; | ||
261 | |||
262 | // OnRegisterBegin - called when the engine registers the bundle. | ||
263 | // | ||
264 | STDMETHOD(OnRegisterBegin)( | ||
265 | __inout BOOL* pfCancel | ||
266 | ) = 0; | ||
267 | |||
268 | // OnRegisterComplete - called when the engine registration is | ||
269 | // complete. | ||
270 | // | ||
271 | STDMETHOD(OnRegisterComplete)( | ||
272 | __in HRESULT hrStatus | ||
273 | ) = 0; | ||
274 | |||
275 | // OnCacheBegin - called when the engine begins caching. | ||
276 | // | ||
277 | STDMETHOD(OnCacheBegin)( | ||
278 | __inout BOOL* pfCancel | ||
279 | ) = 0; | ||
280 | |||
281 | // OnCachePackageBegin - called when the engine begins caching | ||
282 | // a package. | ||
283 | // | ||
284 | STDMETHOD(OnCachePackageBegin)( | ||
285 | __in_z LPCWSTR wzPackageId, | ||
286 | __in DWORD cCachePayloads, | ||
287 | __in DWORD64 dw64PackageCacheSize, | ||
288 | __inout BOOL* pfCancel | ||
289 | ) = 0; | ||
290 | |||
291 | // OnCacheAcquireBegin - called when the engine begins copying or | ||
292 | // downloading a payload to the working folder. | ||
293 | // | ||
294 | STDMETHOD(OnCacheAcquireBegin)( | ||
295 | __in_z_opt LPCWSTR wzPackageOrContainerId, | ||
296 | __in_z_opt LPCWSTR wzPayloadId, | ||
297 | __in BOOTSTRAPPER_CACHE_OPERATION operation, | ||
298 | __in_z LPCWSTR wzSource, | ||
299 | __inout BOOL* pfCancel | ||
300 | ) = 0; | ||
301 | |||
302 | // OnCacheAcquireProgress - called when the engine makes progresss copying | ||
303 | // or downloading a payload to the working folder. | ||
304 | // | ||
305 | STDMETHOD(OnCacheAcquireProgress)( | ||
306 | __in_z_opt LPCWSTR wzPackageOrContainerId, | ||
307 | __in_z_opt LPCWSTR wzPayloadId, | ||
308 | __in DWORD64 dw64Progress, | ||
309 | __in DWORD64 dw64Total, | ||
310 | __in DWORD dwOverallPercentage, | ||
311 | __inout BOOL* pfCancel | ||
312 | ) = 0; | ||
313 | |||
314 | // OnResolveSource - called when a payload or container cannot be found locally. | ||
315 | // | ||
316 | // Parameters: | ||
317 | // wzPayloadId will be NULL when resolving a container. | ||
318 | // wzDownloadSource will be NULL if the container or payload does not provide a DownloadURL. | ||
319 | // | ||
320 | // Notes: | ||
321 | // It is expected the BA may call IBootstrapperEngine::SetLocalSource() or IBootstrapperEngine::SetDownloadSource() | ||
322 | // to update the source location before returning BOOTSTRAPPER_RESOLVESOURCE_ACTION_RETRY or BOOTSTRAPPER_RESOLVESOURCE_ACTION_DOWNLOAD. | ||
323 | STDMETHOD(OnResolveSource)( | ||
324 | __in_z LPCWSTR wzPackageOrContainerId, | ||
325 | __in_z_opt LPCWSTR wzPayloadId, | ||
326 | __in_z LPCWSTR wzLocalSource, | ||
327 | __in_z_opt LPCWSTR wzDownloadSource, | ||
328 | __in BOOTSTRAPPER_RESOLVESOURCE_ACTION recommendation, | ||
329 | __inout BOOTSTRAPPER_RESOLVESOURCE_ACTION* pAction, | ||
330 | __inout BOOL* pfCancel | ||
331 | ) = 0; | ||
332 | |||
333 | // OnCacheAcquireComplete - called after the engine copied or downloaded | ||
334 | // a payload to the working folder. | ||
335 | // | ||
336 | STDMETHOD(OnCacheAcquireComplete)( | ||
337 | __in_z_opt LPCWSTR wzPackageOrContainerId, | ||
338 | __in_z_opt LPCWSTR wzPayloadId, | ||
339 | __in HRESULT hrStatus, | ||
340 | __in BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, | ||
341 | __inout BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION* pAction | ||
342 | ) = 0; | ||
343 | |||
344 | // OnCacheVerifyBegin - called when the engine begins to verify then copy | ||
345 | // a payload or container to the package cache folder. | ||
346 | // | ||
347 | STDMETHOD(OnCacheVerifyBegin)( | ||
348 | __in_z_opt LPCWSTR wzPackageOrContainerId, | ||
349 | __in_z_opt LPCWSTR wzPayloadId, | ||
350 | __inout BOOL* pfCancel | ||
351 | ) = 0; | ||
352 | |||
353 | // OnCacheVerifyComplete - called after the engine verifies and copies | ||
354 | // a payload or container to the package cache folder. | ||
355 | // | ||
356 | STDMETHOD(OnCacheVerifyComplete)( | ||
357 | __in_z_opt LPCWSTR wzPackageOrContainerId, | ||
358 | __in_z_opt LPCWSTR wzPayloadId, | ||
359 | __in HRESULT hrStatus, | ||
360 | __in BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation, | ||
361 | __inout BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION* pAction | ||
362 | ) = 0; | ||
363 | |||
364 | // OnCachePackageComplete - called after the engine attempts to copy or download all | ||
365 | // payloads of a package into the package cache folder. | ||
366 | // | ||
367 | STDMETHOD(OnCachePackageComplete)( | ||
368 | __in_z LPCWSTR wzPackageId, | ||
369 | __in HRESULT hrStatus, | ||
370 | __in BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation, | ||
371 | __inout BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION* pAction | ||
372 | ) = 0; | ||
373 | |||
374 | // OnCacheComplete - called when the engine caching is complete. | ||
375 | // | ||
376 | STDMETHOD(OnCacheComplete)( | ||
377 | __in HRESULT hrStatus | ||
378 | ) = 0; | ||
379 | |||
380 | // OnExecuteBegin - called when the engine begins executing the plan. | ||
381 | // | ||
382 | STDMETHOD(OnExecuteBegin)( | ||
383 | __in DWORD cExecutingPackages, | ||
384 | __inout BOOL* pfCancel | ||
385 | ) = 0; | ||
386 | |||
387 | // OnExecuteBegin - called when the engine begins executing a package. | ||
388 | // | ||
389 | STDMETHOD(OnExecutePackageBegin)( | ||
390 | __in_z LPCWSTR wzPackageId, | ||
391 | __in BOOL fExecute, | ||
392 | __inout BOOL* pfCancel | ||
393 | ) = 0; | ||
394 | |||
395 | // OnExecutePatchTarget - called for each patch in an MspPackage targeting the product | ||
396 | // when the engine begins executing the MspPackage. | ||
397 | // | ||
398 | STDMETHOD(OnExecutePatchTarget)( | ||
399 | __in_z LPCWSTR wzPackageId, | ||
400 | __in_z LPCWSTR wzTargetProductCode, | ||
401 | __inout BOOL* pfCancel | ||
402 | ) = 0; | ||
403 | |||
404 | // OnExecuteProgress - called when the engine makes progress executing a package. | ||
405 | // | ||
406 | STDMETHOD(OnExecuteProgress)( | ||
407 | __in_z LPCWSTR wzPackageId, | ||
408 | __in DWORD dwProgressPercentage, | ||
409 | __in DWORD dwOverallPercentage, | ||
410 | __inout BOOL* pfCancel | ||
411 | ) = 0; | ||
412 | |||
413 | // OnExecuteMsiMessage - called when the engine receives an MSI package message. | ||
414 | // | ||
415 | // Return: | ||
416 | // uiFlags is a combination of valid ID* return values appropriate for | ||
417 | // the message. | ||
418 | // | ||
419 | // IDNOACTION instructs the engine to pass the message through to default | ||
420 | // handling which usually results in the execution continuing. | ||
421 | STDMETHOD(OnExecuteMsiMessage)( | ||
422 | __in_z LPCWSTR wzPackageId, | ||
423 | __in INSTALLMESSAGE messageType, | ||
424 | __in DWORD dwUIHint, | ||
425 | __in_z LPCWSTR wzMessage, | ||
426 | __in DWORD cData, | ||
427 | __in_ecount_z_opt(cData) LPCWSTR* rgwzData, | ||
428 | __in int nRecommendation, | ||
429 | __inout int* pResult | ||
430 | ) = 0; | ||
431 | |||
432 | // OnExecuteFilesInUse - called when the engine encounters files in use while | ||
433 | // executing a package. | ||
434 | // | ||
435 | // Return: | ||
436 | // IDOK instructs the engine to let the Restart Manager attempt to close the | ||
437 | // applications to avoid a restart. | ||
438 | // | ||
439 | // IDCANCEL instructs the engine to abort the execution and start rollback. | ||
440 | // | ||
441 | // IDIGNORE instructs the engine to ignore the running applications. A restart will be | ||
442 | // required. | ||
443 | // | ||
444 | // IDRETRY instructs the engine to check if the applications are still running again. | ||
445 | // | ||
446 | // IDNOACTION is equivalent to ignoring the running applications. A restart will be | ||
447 | // required. | ||
448 | STDMETHOD(OnExecuteFilesInUse)( | ||
449 | __in_z LPCWSTR wzPackageId, | ||
450 | __in DWORD cFiles, | ||
451 | __in_ecount_z(cFiles) LPCWSTR* rgwzFiles, | ||
452 | __in int nRecommendation, | ||
453 | __inout int* pResult | ||
454 | ) = 0; | ||
455 | |||
456 | // OnExecutePackageComplete - called when a package execution is complete. | ||
457 | // | ||
458 | STDMETHOD(OnExecutePackageComplete)( | ||
459 | __in_z LPCWSTR wzPackageId, | ||
460 | __in HRESULT hrStatus, | ||
461 | __in BOOTSTRAPPER_APPLY_RESTART restart, | ||
462 | __in BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation, | ||
463 | __inout BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION* pAction | ||
464 | ) = 0; | ||
465 | |||
466 | // OnExecuteComplete - called when the engine execution is complete. | ||
467 | // | ||
468 | STDMETHOD(OnExecuteComplete)( | ||
469 | __in HRESULT hrStatus | ||
470 | ) = 0; | ||
471 | |||
472 | // OnUnregisterBegin - called when the engine unregisters the bundle. | ||
473 | // | ||
474 | STDMETHOD(OnUnregisterBegin)( | ||
475 | __inout BOOL* pfCancel | ||
476 | ) = 0; | ||
477 | |||
478 | // OnUnregisterComplete - called when the engine unregistration is complete. | ||
479 | // | ||
480 | STDMETHOD(OnUnregisterComplete)( | ||
481 | __in HRESULT hrStatus | ||
482 | ) = 0; | ||
483 | |||
484 | // OnApplyComplete - called after the plan has been applied. | ||
485 | // | ||
486 | STDMETHOD(OnApplyComplete)( | ||
487 | __in HRESULT hrStatus, | ||
488 | __in BOOTSTRAPPER_APPLY_RESTART restart, | ||
489 | __in BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation, | ||
490 | __inout BOOTSTRAPPER_APPLYCOMPLETE_ACTION* pAction | ||
491 | ) = 0; | ||
492 | |||
493 | // OnLaunchApprovedExeBegin - called before trying to launch the preapproved executable. | ||
494 | // | ||
495 | STDMETHOD(OnLaunchApprovedExeBegin)( | ||
496 | __inout BOOL* pfCancel | ||
497 | ) = 0; | ||
498 | |||
499 | // OnLaunchApprovedExeComplete - called after trying to launch the preapproved executable. | ||
500 | // | ||
501 | STDMETHOD(OnLaunchApprovedExeComplete)( | ||
502 | __in HRESULT hrStatus, | ||
503 | __in DWORD dwProcessId | ||
504 | ) = 0; | ||
505 | |||
506 | // BAProc - The PFN_BOOTSTRAPPER_APPLICATION_PROC can call this method to give the BA raw access to the callback from the engine. | ||
507 | // This might be used to help the BA support more than one version of the engine. | ||
508 | STDMETHOD(BAProc)( | ||
509 | __in BOOTSTRAPPER_APPLICATION_MESSAGE message, | ||
510 | __in const LPVOID pvArgs, | ||
511 | __inout LPVOID pvResults, | ||
512 | __in_opt LPVOID pvContext | ||
513 | ) = 0; | ||
514 | |||
515 | // BAProcFallback - The PFN_BOOTSTRAPPER_APPLICATION_PROC can call this method | ||
516 | // to give the BA the ability to use default behavior | ||
517 | // and then forward the message to extensions. | ||
518 | STDMETHOD_(void, BAProcFallback)( | ||
519 | __in BOOTSTRAPPER_APPLICATION_MESSAGE message, | ||
520 | __in const LPVOID pvArgs, | ||
521 | __inout LPVOID pvResults, | ||
522 | __inout HRESULT* phr, | ||
523 | __in_opt LPVOID pvContext | ||
524 | ) = 0; | ||
525 | }; | ||
diff --git a/src/balutil/inc/IBootstrapperEngine.h b/src/balutil/inc/IBootstrapperEngine.h new file mode 100644 index 00000000..3fe3d401 --- /dev/null +++ b/src/balutil/inc/IBootstrapperEngine.h | |||
@@ -0,0 +1,128 @@ | |||
1 | #pragma once | ||
2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
3 | |||
4 | |||
5 | DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-81512C29C2FB") | ||
6 | { | ||
7 | STDMETHOD(GetPackageCount)( | ||
8 | __out DWORD* pcPackages | ||
9 | ) = 0; | ||
10 | |||
11 | STDMETHOD(GetVariableNumeric)( | ||
12 | __in_z LPCWSTR wzVariable, | ||
13 | __out LONGLONG* pllValue | ||
14 | ) = 0; | ||
15 | |||
16 | STDMETHOD(GetVariableString)( | ||
17 | __in_z LPCWSTR wzVariable, | ||
18 | __out_ecount_opt(*pcchValue) LPWSTR wzValue, | ||
19 | __inout DWORD* pcchValue | ||
20 | ) = 0; | ||
21 | |||
22 | STDMETHOD(GetVariableVersion)( | ||
23 | __in_z LPCWSTR wzVariable, | ||
24 | __out DWORD64* pqwValue | ||
25 | ) = 0; | ||
26 | |||
27 | STDMETHOD(FormatString)( | ||
28 | __in_z LPCWSTR wzIn, | ||
29 | __out_ecount_opt(*pcchOut) LPWSTR wzOut, | ||
30 | __inout DWORD* pcchOut | ||
31 | ) = 0; | ||
32 | |||
33 | STDMETHOD(EscapeString)( | ||
34 | __in_z LPCWSTR wzIn, | ||
35 | __out_ecount_opt(*pcchOut) LPWSTR wzOut, | ||
36 | __inout DWORD* pcchOut | ||
37 | ) = 0; | ||
38 | |||
39 | STDMETHOD(EvaluateCondition)( | ||
40 | __in_z LPCWSTR wzCondition, | ||
41 | __out BOOL* pf | ||
42 | ) = 0; | ||
43 | |||
44 | STDMETHOD(Log)( | ||
45 | __in BOOTSTRAPPER_LOG_LEVEL level, | ||
46 | __in_z LPCWSTR wzMessage | ||
47 | ) = 0; | ||
48 | |||
49 | STDMETHOD(SendEmbeddedError)( | ||
50 | __in DWORD dwErrorCode, | ||
51 | __in_z_opt LPCWSTR wzMessage, | ||
52 | __in DWORD dwUIHint, | ||
53 | __out int* pnResult | ||
54 | ) = 0; | ||
55 | |||
56 | STDMETHOD(SendEmbeddedProgress)( | ||
57 | __in DWORD dwProgressPercentage, | ||
58 | __in DWORD dwOverallProgressPercentage, | ||
59 | __out int* pnResult | ||
60 | ) = 0; | ||
61 | |||
62 | STDMETHOD(SetUpdate)( | ||
63 | __in_z_opt LPCWSTR wzLocalSource, | ||
64 | __in_z_opt LPCWSTR wzDownloadSource, | ||
65 | __in DWORD64 qwSize, | ||
66 | __in BOOTSTRAPPER_UPDATE_HASH_TYPE hashType, | ||
67 | __in_bcount_opt(cbHash) BYTE* rgbHash, | ||
68 | __in DWORD cbHash | ||
69 | ) = 0; | ||
70 | |||
71 | STDMETHOD(SetLocalSource)( | ||
72 | __in_z LPCWSTR wzPackageOrContainerId, | ||
73 | __in_z_opt LPCWSTR wzPayloadId, | ||
74 | __in_z LPCWSTR wzPath | ||
75 | ) = 0; | ||
76 | |||
77 | STDMETHOD(SetDownloadSource)( | ||
78 | __in_z LPCWSTR wzPackageOrContainerId, | ||
79 | __in_z_opt LPCWSTR wzPayloadId, | ||
80 | __in_z LPCWSTR wzUrl, | ||
81 | __in_z_opt LPCWSTR wzUser, | ||
82 | __in_z_opt LPCWSTR wzPassword | ||
83 | ) = 0; | ||
84 | |||
85 | STDMETHOD(SetVariableNumeric)( | ||
86 | __in_z LPCWSTR wzVariable, | ||
87 | __in LONGLONG llValue | ||
88 | ) = 0; | ||
89 | |||
90 | STDMETHOD(SetVariableString)( | ||
91 | __in_z LPCWSTR wzVariable, | ||
92 | __in_z_opt LPCWSTR wzValue | ||
93 | ) = 0; | ||
94 | |||
95 | STDMETHOD(SetVariableVersion)( | ||
96 | __in_z LPCWSTR wzVariable, | ||
97 | __in DWORD64 qwValue | ||
98 | ) = 0; | ||
99 | |||
100 | STDMETHOD(CloseSplashScreen)() = 0; | ||
101 | |||
102 | STDMETHOD(Detect)( | ||
103 | __in_opt HWND hwndParent = NULL | ||
104 | ) = 0; | ||
105 | |||
106 | STDMETHOD(Plan)( | ||
107 | __in BOOTSTRAPPER_ACTION action | ||
108 | ) = 0; | ||
109 | |||
110 | STDMETHOD(Elevate)( | ||
111 | __in_opt HWND hwndParent | ||
112 | ) = 0; | ||
113 | |||
114 | STDMETHOD(Apply)( | ||
115 | __in_opt HWND hwndParent | ||
116 | ) = 0; | ||
117 | |||
118 | STDMETHOD(Quit)( | ||
119 | __in DWORD dwExitCode | ||
120 | ) = 0; | ||
121 | |||
122 | STDMETHOD(LaunchApprovedExe)( | ||
123 | __in_opt HWND hwndParent, | ||
124 | __in_z LPCWSTR wzApprovedExeForElevationId, | ||
125 | __in_z_opt LPCWSTR wzArguments, | ||
126 | __in DWORD dwWaitForInputIdleTimeout | ||
127 | ) = 0; | ||
128 | }; | ||