summaryrefslogtreecommitdiff
path: root/src/api/burn/WixToolset.Mba.Core
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2021-04-22 05:46:03 -0700
committerRob Mensching <rob@firegiant.com>2021-04-29 16:41:44 -0700
commitc00516901e6b67e398396b14fe7682d0376f8643 (patch)
treeb0d62089a1c5700c7f2c3e3790750bf2d8ea33c0 /src/api/burn/WixToolset.Mba.Core
parent8eb98efd2175d9ece2e4639d43081667af9a4990 (diff)
downloadwix-c00516901e6b67e398396b14fe7682d0376f8643.tar.gz
wix-c00516901e6b67e398396b14fe7682d0376f8643.tar.bz2
wix-c00516901e6b67e398396b14fe7682d0376f8643.zip
Move balutil into API/burn
Diffstat (limited to 'src/api/burn/WixToolset.Mba.Core')
-rw-r--r--src/api/burn/WixToolset.Mba.Core/BalUtil.cs22
-rw-r--r--src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs63
-rw-r--r--src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs1873
-rw-r--r--src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationData.cs101
-rw-r--r--src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs35
-rw-r--r--src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs145
-rw-r--r--src/api/burn/WixToolset.Mba.Core/BundleInfo.cs86
-rw-r--r--src/api/burn/WixToolset.Mba.Core/Engine.cs541
-rw-r--r--src/api/burn/WixToolset.Mba.Core/EventArgs.cs2186
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs1917
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationData.cs22
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs66
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IBootstrapperCommand.cs76
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs536
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs39
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs387
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IEngine.cs222
-rw-r--r--src/api/burn/WixToolset.Mba.Core/IPackageInfo.cs90
-rw-r--r--src/api/burn/WixToolset.Mba.Core/NativeMethods.cs37
-rw-r--r--src/api/burn/WixToolset.Mba.Core/PackageInfo.cs317
-rw-r--r--src/api/burn/WixToolset.Mba.Core/VerUtil.cs145
-rw-r--r--src/api/burn/WixToolset.Mba.Core/VerUtilVersion.cs99
-rw-r--r--src/api/burn/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs36
-rw-r--r--src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj59
-rw-r--r--src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec33
25 files changed, 9133 insertions, 0 deletions
diff --git a/src/api/burn/WixToolset.Mba.Core/BalUtil.cs b/src/api/burn/WixToolset.Mba.Core/BalUtil.cs
new file mode 100644
index 00000000..f478eca4
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/BalUtil.cs
@@ -0,0 +1,22 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 internal static class BalUtil
9 {
10 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
11 internal static extern IBootstrapperEngine InitializeFromCreateArgs(
12 IntPtr pArgs,
13 ref Command pCommand
14 );
15
16 [DllImport("mbanative.dll", ExactSpelling = true)]
17 internal static extern void StoreBAInCreateResults(
18 IntPtr pResults,
19 [MarshalAs(UnmanagedType.Interface)] IBootstrapperApplication pBA
20 );
21 }
22}
diff --git a/src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs b/src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..ad8a5dc0
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs
@@ -0,0 +1,63 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// Default implementation of <see cref="IBootstrapperApplicationFactory"/>.
10 /// </summary>
11 public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory
12 {
13 /// <summary>
14 /// Default implementation of <see cref="IBootstrapperApplicationFactory.Create(IntPtr, IntPtr)"/>
15 /// </summary>
16 /// <param name="pArgs"></param>
17 /// <param name="pResults"></param>
18 public void Create(IntPtr pArgs, IntPtr pResults)
19 {
20 InitializeFromCreateArgs(pArgs, out var engine, out var bootstrapperCommand);
21
22 var ba = this.Create(engine, bootstrapperCommand);
23 StoreBAInCreateResults(pResults, ba);
24 }
25
26 /// <summary>
27 /// Called by <see cref="BaseBootstrapperApplicationFactory.Create(IntPtr, IntPtr)"/> to get the <see cref="IBootstrapperApplication"/>.
28 /// </summary>
29 /// <param name="engine">The bundle engine.</param>
30 /// <param name="bootstrapperCommand">Command information passed from the engine for the BA to perform.</param>
31 /// <returns>The <see cref="IBootstrapperApplication"/> for the bundle.</returns>
32 protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand);
33
34 /// <summary>
35 /// Initializes the native part of <see cref="WixToolset.Mba.Core"/>.
36 /// Most users should inherit from <see cref="BaseBootstrapperApplicationFactory"/> instead of calling this method.
37 /// </summary>
38 /// <param name="pArgs">The args struct given by the engine when initially creating the BA.</param>
39 /// <param name="engine">The bundle engine interface.</param>
40 /// <param name="bootstrapperCommand">The context of the current run of the bundle.</param>
41 public static void InitializeFromCreateArgs(IntPtr pArgs, out IEngine engine, out IBootstrapperCommand bootstrapperCommand)
42 {
43 Command pCommand = new Command
44 {
45 cbSize = Marshal.SizeOf(typeof(Command))
46 };
47 var pEngine = BalUtil.InitializeFromCreateArgs(pArgs, ref pCommand);
48 engine = new Engine(pEngine);
49 bootstrapperCommand = pCommand.GetBootstrapperCommand();
50 }
51
52 /// <summary>
53 /// Registers the BA with the engine using the default mapping between the message based interface and the COM interface.
54 /// Most users should inherit from <see cref="BaseBootstrapperApplicationFactory"/> instead of calling this method.
55 /// </summary>
56 /// <param name="pResults">The results struct given by the engine when initially creating the BA</param>
57 /// <param name="ba">The <see cref="IBootstrapperApplication"/>.</param>
58 public static void StoreBAInCreateResults(IntPtr pResults, IBootstrapperApplication ba)
59 {
60 BalUtil.StoreBAInCreateResults(pResults, ba);
61 }
62 }
63}
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs
new file mode 100644
index 00000000..072d3ef0
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplication.cs
@@ -0,0 +1,1873 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7 using System.Threading;
8
9 /// <summary>
10 /// The default bootstrapper application.
11 /// </summary>
12 [ClassInterface(ClassInterfaceType.None)]
13 public abstract class BootstrapperApplication : MarshalByRefObject, IDefaultBootstrapperApplication
14 {
15 /// <summary>
16 /// Specifies whether this bootstrapper should run asynchronously. The default is true.
17 /// </summary>
18 protected readonly bool asyncExecution;
19
20 /// <summary>
21 /// Gets the <see cref="IEngine"/> for interaction with the engine.
22 /// </summary>
23 protected readonly IEngine engine;
24
25 private bool applying;
26
27 /// <summary>
28 /// Creates a new instance of the <see cref="BootstrapperApplication"/> class.
29 /// </summary>
30 protected BootstrapperApplication(IEngine engine)
31 {
32 this.engine = engine;
33 this.applying = false;
34 this.asyncExecution = true;
35 }
36
37 /// <inheritdoc/>
38 public event EventHandler<StartupEventArgs> Startup;
39
40 /// <inheritdoc/>
41 public event EventHandler<ShutdownEventArgs> Shutdown;
42
43 /// <inheritdoc/>
44 public event EventHandler<SystemShutdownEventArgs> SystemShutdown;
45
46 /// <inheritdoc/>
47 public event EventHandler<DetectBeginEventArgs> DetectBegin;
48
49 /// <inheritdoc/>
50 public event EventHandler<DetectForwardCompatibleBundleEventArgs> DetectForwardCompatibleBundle;
51
52 /// <inheritdoc/>
53 public event EventHandler<DetectUpdateBeginEventArgs> DetectUpdateBegin;
54
55 /// <inheritdoc/>
56 public event EventHandler<DetectUpdateEventArgs> DetectUpdate;
57
58 /// <inheritdoc/>
59 public event EventHandler<DetectUpdateCompleteEventArgs> DetectUpdateComplete;
60
61 /// <inheritdoc/>
62 public event EventHandler<DetectRelatedBundleEventArgs> DetectRelatedBundle;
63
64 /// <inheritdoc/>
65 public event EventHandler<DetectPackageBeginEventArgs> DetectPackageBegin;
66
67 /// <inheritdoc/>
68 public event EventHandler<DetectRelatedMsiPackageEventArgs> DetectRelatedMsiPackage;
69
70 /// <inheritdoc/>
71 public event EventHandler<DetectPatchTargetEventArgs> DetectPatchTarget;
72
73 /// <inheritdoc/>
74 public event EventHandler<DetectMsiFeatureEventArgs> DetectMsiFeature;
75
76 /// <inheritdoc/>
77 public event EventHandler<DetectPackageCompleteEventArgs> DetectPackageComplete;
78
79 /// <inheritdoc/>
80 public event EventHandler<DetectCompleteEventArgs> DetectComplete;
81
82 /// <inheritdoc/>
83 public event EventHandler<PlanBeginEventArgs> PlanBegin;
84
85 /// <inheritdoc/>
86 public event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle;
87
88 /// <inheritdoc/>
89 public event EventHandler<PlanPackageBeginEventArgs> PlanPackageBegin;
90
91 /// <inheritdoc/>
92 public event EventHandler<PlanPatchTargetEventArgs> PlanPatchTarget;
93
94 /// <inheritdoc/>
95 public event EventHandler<PlanMsiFeatureEventArgs> PlanMsiFeature;
96
97 /// <inheritdoc/>
98 public event EventHandler<PlanMsiPackageEventArgs> PlanMsiPackage;
99
100 /// <inheritdoc/>
101 public event EventHandler<PlanPackageCompleteEventArgs> PlanPackageComplete;
102
103 /// <inheritdoc/>
104 public event EventHandler<PlannedPackageEventArgs> PlannedPackage;
105
106 /// <inheritdoc/>
107 public event EventHandler<PlanCompleteEventArgs> PlanComplete;
108
109 /// <inheritdoc/>
110 public event EventHandler<ApplyBeginEventArgs> ApplyBegin;
111
112 /// <inheritdoc/>
113 public event EventHandler<ElevateBeginEventArgs> ElevateBegin;
114
115 /// <inheritdoc/>
116 public event EventHandler<ElevateCompleteEventArgs> ElevateComplete;
117
118 /// <inheritdoc/>
119 public event EventHandler<ProgressEventArgs> Progress;
120
121 /// <inheritdoc/>
122 public event EventHandler<ErrorEventArgs> Error;
123
124 /// <inheritdoc/>
125 public event EventHandler<RegisterBeginEventArgs> RegisterBegin;
126
127 /// <inheritdoc/>
128 public event EventHandler<RegisterCompleteEventArgs> RegisterComplete;
129
130 /// <inheritdoc/>
131 public event EventHandler<UnregisterBeginEventArgs> UnregisterBegin;
132
133 /// <inheritdoc/>
134 public event EventHandler<UnregisterCompleteEventArgs> UnregisterComplete;
135
136 /// <inheritdoc/>
137 public event EventHandler<CacheBeginEventArgs> CacheBegin;
138
139 /// <inheritdoc/>
140 public event EventHandler<CachePackageBeginEventArgs> CachePackageBegin;
141
142 /// <inheritdoc/>
143 public event EventHandler<CacheAcquireBeginEventArgs> CacheAcquireBegin;
144
145 /// <inheritdoc/>
146 public event EventHandler<CacheAcquireProgressEventArgs> CacheAcquireProgress;
147
148 /// <inheritdoc/>
149 public event EventHandler<CacheAcquireResolvingEventArgs> CacheAcquireResolving;
150
151 /// <inheritdoc/>
152 public event EventHandler<CacheAcquireCompleteEventArgs> CacheAcquireComplete;
153
154 /// <inheritdoc/>
155 public event EventHandler<CacheVerifyBeginEventArgs> CacheVerifyBegin;
156
157 /// <inheritdoc/>
158 public event EventHandler<CacheVerifyProgressEventArgs> CacheVerifyProgress;
159
160 /// <inheritdoc/>
161 public event EventHandler<CacheVerifyCompleteEventArgs> CacheVerifyComplete;
162
163 /// <inheritdoc/>
164 public event EventHandler<CachePackageCompleteEventArgs> CachePackageComplete;
165
166 /// <inheritdoc/>
167 public event EventHandler<CacheCompleteEventArgs> CacheComplete;
168
169 /// <inheritdoc/>
170 public event EventHandler<ExecuteBeginEventArgs> ExecuteBegin;
171
172 /// <inheritdoc/>
173 public event EventHandler<ExecutePackageBeginEventArgs> ExecutePackageBegin;
174
175 /// <inheritdoc/>
176 public event EventHandler<ExecutePatchTargetEventArgs> ExecutePatchTarget;
177
178 /// <inheritdoc/>
179 public event EventHandler<ExecuteMsiMessageEventArgs> ExecuteMsiMessage;
180
181 /// <inheritdoc/>
182 public event EventHandler<ExecuteFilesInUseEventArgs> ExecuteFilesInUse;
183
184 /// <inheritdoc/>
185 public event EventHandler<ExecutePackageCompleteEventArgs> ExecutePackageComplete;
186
187 /// <inheritdoc/>
188 public event EventHandler<ExecuteCompleteEventArgs> ExecuteComplete;
189
190 /// <inheritdoc/>
191 public event EventHandler<ApplyCompleteEventArgs> ApplyComplete;
192
193 /// <inheritdoc/>
194 public event EventHandler<ExecuteProgressEventArgs> ExecuteProgress;
195
196 /// <inheritdoc/>
197 public event EventHandler<LaunchApprovedExeBeginEventArgs> LaunchApprovedExeBegin;
198
199 /// <inheritdoc/>
200 public event EventHandler<LaunchApprovedExeCompleteEventArgs> LaunchApprovedExeComplete;
201
202 /// <inheritdoc/>
203 public event EventHandler<BeginMsiTransactionBeginEventArgs> BeginMsiTransactionBegin;
204
205 /// <inheritdoc/>
206 public event EventHandler<BeginMsiTransactionCompleteEventArgs> BeginMsiTransactionComplete;
207
208 /// <inheritdoc/>
209 public event EventHandler<CommitMsiTransactionBeginEventArgs> CommitMsiTransactionBegin;
210
211 /// <inheritdoc/>
212 public event EventHandler<CommitMsiTransactionCompleteEventArgs> CommitMsiTransactionComplete;
213
214 /// <inheritdoc/>
215 public event EventHandler<RollbackMsiTransactionBeginEventArgs> RollbackMsiTransactionBegin;
216
217 /// <inheritdoc/>
218 public event EventHandler<RollbackMsiTransactionCompleteEventArgs> RollbackMsiTransactionComplete;
219
220 /// <inheritdoc/>
221 public event EventHandler<PauseAutomaticUpdatesBeginEventArgs> PauseAutomaticUpdatesBegin;
222
223 /// <inheritdoc/>
224 public event EventHandler<PauseAutomaticUpdatesCompleteEventArgs> PauseAutomaticUpdatesComplete;
225
226 /// <inheritdoc/>
227 public event EventHandler<SystemRestorePointBeginEventArgs> SystemRestorePointBegin;
228
229 /// <inheritdoc/>
230 public event EventHandler<SystemRestorePointCompleteEventArgs> SystemRestorePointComplete;
231
232 /// <inheritdoc/>
233 public event EventHandler<PlanForwardCompatibleBundleEventArgs> PlanForwardCompatibleBundle;
234
235 /// <inheritdoc/>
236 public event EventHandler<CacheContainerOrPayloadVerifyBeginEventArgs> CacheContainerOrPayloadVerifyBegin;
237
238 /// <inheritdoc/>
239 public event EventHandler<CacheContainerOrPayloadVerifyProgressEventArgs> CacheContainerOrPayloadVerifyProgress;
240
241 /// <inheritdoc/>
242 public event EventHandler<CacheContainerOrPayloadVerifyCompleteEventArgs> CacheContainerOrPayloadVerifyComplete;
243
244 /// <inheritdoc/>
245 public event EventHandler<CachePayloadExtractBeginEventArgs> CachePayloadExtractBegin;
246
247 /// <inheritdoc/>
248 public event EventHandler<CachePayloadExtractProgressEventArgs> CachePayloadExtractProgress;
249
250 /// <inheritdoc/>
251 public event EventHandler<CachePayloadExtractCompleteEventArgs> CachePayloadExtractComplete;
252
253 /// <summary>
254 /// Entry point that is called when the bootstrapper application is ready to run.
255 /// </summary>
256 protected abstract void Run();
257
258 /// <summary>
259 /// Called by the engine, raises the <see cref="Startup"/> event.
260 /// </summary>
261 /// <param name="args">Additional arguments for this event.</param>
262 protected virtual void OnStartup(StartupEventArgs args)
263 {
264 EventHandler<StartupEventArgs> handler = this.Startup;
265 if (null != handler)
266 {
267 handler(this, args);
268 }
269
270 if (this.asyncExecution)
271 {
272 this.engine.Log(LogLevel.Verbose, "Creating BA thread to run asynchronously.");
273 Thread uiThread = new Thread(this.Run);
274 uiThread.Name = "UIThread";
275 uiThread.SetApartmentState(ApartmentState.STA);
276 uiThread.Start();
277 }
278 else
279 {
280 this.engine.Log(LogLevel.Verbose, "Creating BA thread to run synchronously.");
281 this.Run();
282 }
283 }
284
285 /// <summary>
286 /// Called by the engine, raises the <see cref="Shutdown"/> event.
287 /// </summary>
288 /// <param name="args">Additional arguments for this event.</param>
289 protected virtual void OnShutdown(ShutdownEventArgs args)
290 {
291 EventHandler<ShutdownEventArgs> handler = this.Shutdown;
292 if (null != handler)
293 {
294 handler(this, args);
295 }
296 }
297
298 /// <summary>
299 /// Called by the engine, raises the <see cref="SystemShutdown"/> event.
300 /// </summary>
301 /// <param name="args">Additional arguments for this event.</param>
302 protected virtual void OnSystemShutdown(SystemShutdownEventArgs args)
303 {
304 EventHandler<SystemShutdownEventArgs> handler = this.SystemShutdown;
305 if (null != handler)
306 {
307 handler(this, args);
308 }
309 else if (null != args)
310 {
311 // Allow requests to shut down when critical or not applying.
312 bool critical = EndSessionReasons.Critical == (EndSessionReasons.Critical & args.Reasons);
313 args.Cancel = !critical && this.applying;
314 }
315 }
316
317 /// <summary>
318 /// Called by the engine, raises the <see cref="DetectBegin"/> event.
319 /// </summary>
320 /// <param name="args">Additional arguments for this event.</param>
321 protected virtual void OnDetectBegin(DetectBeginEventArgs args)
322 {
323 EventHandler<DetectBeginEventArgs> handler = this.DetectBegin;
324 if (null != handler)
325 {
326 handler(this, args);
327 }
328 }
329
330 /// <summary>
331 /// Called by the engine, raises the <see cref="DetectForwardCompatibleBundle"/> event.
332 /// </summary>
333 /// <param name="args">Additional arguments for this event.</param>
334 protected virtual void OnDetectForwardCompatibleBundle(DetectForwardCompatibleBundleEventArgs args)
335 {
336 EventHandler<DetectForwardCompatibleBundleEventArgs> handler = this.DetectForwardCompatibleBundle;
337 if (null != handler)
338 {
339 handler(this, args);
340 }
341 }
342
343 /// <summary>
344 /// Called by the engine, raises the <see cref="DetectUpdateBegin"/> event.
345 /// </summary>
346 /// <param name="args">Additional arguments for this event.</param>
347 protected virtual void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args)
348 {
349 EventHandler<DetectUpdateBeginEventArgs> handler = this.DetectUpdateBegin;
350 if (null != handler)
351 {
352 handler(this, args);
353 }
354 }
355
356 /// <summary>
357 /// Called by the engine, raises the <see cref="DetectUpdate"/> event.
358 /// </summary>
359 /// <param name="args">Additional arguments for this event.</param>
360 protected virtual void OnDetectUpdate(DetectUpdateEventArgs args)
361 {
362 EventHandler<DetectUpdateEventArgs> handler = this.DetectUpdate;
363 if (null != handler)
364 {
365 handler(this, args);
366 }
367 }
368
369 /// <summary>
370 /// Called by the engine, raises the <see cref="DetectUpdateComplete"/> event.
371 /// </summary>
372 /// <param name="args">Additional arguments for this event.</param>
373 protected virtual void OnDetectUpdateComplete(DetectUpdateCompleteEventArgs args)
374 {
375 EventHandler<DetectUpdateCompleteEventArgs> handler = this.DetectUpdateComplete;
376 if (null != handler)
377 {
378 handler(this, args);
379 }
380 }
381
382 /// <summary>
383 /// Called by the engine, raises the <see cref="DetectRelatedBundle"/> event.
384 /// </summary>
385 /// <param name="args">Additional arguments for this event.</param>
386 protected virtual void OnDetectRelatedBundle(DetectRelatedBundleEventArgs args)
387 {
388 EventHandler<DetectRelatedBundleEventArgs> handler = this.DetectRelatedBundle;
389 if (null != handler)
390 {
391 handler(this, args);
392 }
393 }
394
395 /// <summary>
396 /// Called by the engine, raises the <see cref="DetectPackageBegin"/> event.
397 /// </summary>
398 /// <param name="args">Additional arguments for this event.</param>
399 protected virtual void OnDetectPackageBegin(DetectPackageBeginEventArgs args)
400 {
401 EventHandler<DetectPackageBeginEventArgs> handler = this.DetectPackageBegin;
402 if (null != handler)
403 {
404 handler(this, args);
405 }
406 }
407
408 /// <summary>
409 /// Called by the engine, raises the <see cref="DetectRelatedMsiPackage"/> event.
410 /// </summary>
411 /// <param name="args">Additional arguments for this event.</param>
412 protected virtual void OnDetectRelatedMsiPackage(DetectRelatedMsiPackageEventArgs args)
413 {
414 EventHandler<DetectRelatedMsiPackageEventArgs> handler = this.DetectRelatedMsiPackage;
415 if (null != handler)
416 {
417 handler(this, args);
418 }
419 }
420
421 /// <summary>
422 /// Called by the engine, raises the <see cref="DetectPatchTarget"/> event.
423 /// </summary>
424 /// <param name="args">Additional arguments for this event.</param>
425 protected virtual void OnDetectPatchTarget(DetectPatchTargetEventArgs args)
426 {
427 EventHandler<DetectPatchTargetEventArgs> handler = this.DetectPatchTarget;
428 if (null != handler)
429 {
430 handler(this, args);
431 }
432 }
433
434 /// <summary>
435 /// Called by the engine, raises the <see cref="DetectMsiFeature"/> event.
436 /// </summary>
437 /// <param name="args">Additional arguments for this event.</param>
438 protected virtual void OnDetectMsiFeature(DetectMsiFeatureEventArgs args)
439 {
440 EventHandler<DetectMsiFeatureEventArgs> handler = this.DetectMsiFeature;
441 if (null != handler)
442 {
443 handler(this, args);
444 }
445 }
446
447 /// <summary>
448 /// Called by the engine, raises the <see cref="DetectPackageComplete"/> event.
449 /// </summary>
450 /// <param name="args">Additional arguments for this event.</param>
451 protected virtual void OnDetectPackageComplete(DetectPackageCompleteEventArgs args)
452 {
453 EventHandler<DetectPackageCompleteEventArgs> handler = this.DetectPackageComplete;
454 if (null != handler)
455 {
456 handler(this, args);
457 }
458 }
459
460 /// <summary>
461 /// Called by the engine, raises the <see cref="DetectComplete"/> event.
462 /// </summary>
463 /// <param name="args">Additional arguments for this event.</param>
464 protected virtual void OnDetectComplete(DetectCompleteEventArgs args)
465 {
466 EventHandler<DetectCompleteEventArgs> handler = this.DetectComplete;
467 if (null != handler)
468 {
469 handler(this, args);
470 }
471 }
472
473 /// <summary>
474 /// Called by the engine, raises the <see cref="PlanBegin"/> event.
475 /// </summary>
476 /// <param name="args">Additional arguments for this event.</param>
477 protected virtual void OnPlanBegin(PlanBeginEventArgs args)
478 {
479 EventHandler<PlanBeginEventArgs> handler = this.PlanBegin;
480 if (null != handler)
481 {
482 handler(this, args);
483 }
484 }
485
486 /// <summary>
487 /// Called by the engine, raises the <see cref="PlanRelatedBundle"/> event.
488 /// </summary>
489 /// <param name="args">Additional arguments for this event.</param>
490 protected virtual void OnPlanRelatedBundle(PlanRelatedBundleEventArgs args)
491 {
492 EventHandler<PlanRelatedBundleEventArgs> handler = this.PlanRelatedBundle;
493 if (null != handler)
494 {
495 handler(this, args);
496 }
497 }
498
499 /// <summary>
500 /// Called by the engine, raises the <see cref="PlanPackageBegin"/> event.
501 /// </summary>
502 /// <param name="args">Additional arguments for this event.</param>
503 protected virtual void OnPlanPackageBegin(PlanPackageBeginEventArgs args)
504 {
505 EventHandler<PlanPackageBeginEventArgs> handler = this.PlanPackageBegin;
506 if (null != handler)
507 {
508 handler(this, args);
509 }
510 }
511
512 /// <summary>
513 /// Called by the engine, raises the <see cref="PlanPatchTarget"/> event.
514 /// </summary>
515 /// <param name="args">Additional arguments for this event.</param>
516 protected virtual void OnPlanPatchTarget(PlanPatchTargetEventArgs args)
517 {
518 EventHandler<PlanPatchTargetEventArgs> handler = this.PlanPatchTarget;
519 if (null != handler)
520 {
521 handler(this, args);
522 }
523 }
524
525 /// <summary>
526 /// Called by the engine, raises the <see cref="PlanMsiFeature"/> event.
527 /// </summary>
528 /// <param name="args">Additional arguments for this event.</param>
529 protected virtual void OnPlanMsiFeature(PlanMsiFeatureEventArgs args)
530 {
531 EventHandler<PlanMsiFeatureEventArgs> handler = this.PlanMsiFeature;
532 if (null != handler)
533 {
534 handler(this, args);
535 }
536 }
537
538 /// <summary>
539 /// Called by the engine, raises the <see cref="PlanMsiPackage"/> event.
540 /// </summary>
541 /// <param name="args">Additional arguments for this event.</param>
542 protected virtual void OnPlanMsiPackage(PlanMsiPackageEventArgs args)
543 {
544 EventHandler<PlanMsiPackageEventArgs> handler = this.PlanMsiPackage;
545 if (null != handler)
546 {
547 handler(this, args);
548 }
549 }
550
551 /// <summary>
552 /// Called by the engine, raises the <see cref="PlanPackageComplete"/> event.
553 /// </summary>
554 /// <param name="args">Additional arguments for this event.</param>
555 protected virtual void OnPlanPackageComplete(PlanPackageCompleteEventArgs args)
556 {
557 EventHandler<PlanPackageCompleteEventArgs> handler = this.PlanPackageComplete;
558 if (null != handler)
559 {
560 handler(this, args);
561 }
562 }
563
564 /// <summary>
565 /// Called by the engine, raises the <see cref="PlannedPackage"/> event.
566 /// </summary>
567 /// <param name="args">Additional arguments for this event.</param>
568 protected virtual void OnPlannedPackage(PlannedPackageEventArgs args)
569 {
570 EventHandler<PlannedPackageEventArgs> handler = this.PlannedPackage;
571 if (null != handler)
572 {
573 handler(this, args);
574 }
575 }
576
577 /// <summary>
578 /// Called by the engine, raises the <see cref="PlanComplete"/> event.
579 /// </summary>
580 /// <param name="args">Additional arguments for this event.</param>
581 protected virtual void OnPlanComplete(PlanCompleteEventArgs args)
582 {
583 EventHandler<PlanCompleteEventArgs> handler = this.PlanComplete;
584 if (null != handler)
585 {
586 handler(this, args);
587 }
588 }
589
590 /// <summary>
591 /// Called by the engine, raises the <see cref="ApplyBegin"/> event.
592 /// </summary>
593 /// <param name="args">Additional arguments for this event.</param>
594 protected virtual void OnApplyBegin(ApplyBeginEventArgs args)
595 {
596 EventHandler<ApplyBeginEventArgs> handler = this.ApplyBegin;
597 if (null != handler)
598 {
599 handler(this, args);
600 }
601 }
602
603 /// <summary>
604 /// Called by the engine, raises the <see cref="ElevateBegin"/> event.
605 /// </summary>
606 /// <param name="args">Additional arguments for this event.</param>
607 protected virtual void OnElevateBegin(ElevateBeginEventArgs args)
608 {
609 EventHandler<ElevateBeginEventArgs> handler = this.ElevateBegin;
610 if (null != handler)
611 {
612 handler(this, args);
613 }
614 }
615
616 /// <summary>
617 /// Called by the engine, raises the <see cref="ElevateComplete"/> event.
618 /// </summary>
619 /// <param name="args">Additional arguments for this event.</param>
620 protected virtual void OnElevateComplete(ElevateCompleteEventArgs args)
621 {
622 EventHandler<ElevateCompleteEventArgs> handler = this.ElevateComplete;
623 if (null != handler)
624 {
625 handler(this, args);
626 }
627 }
628
629 /// <summary>
630 /// Called by the engine, raises the <see cref="Progress"/> event.
631 /// </summary>
632 /// <param name="args">Additional arguments for this event.</param>
633 protected virtual void OnProgress(ProgressEventArgs args)
634 {
635 EventHandler<ProgressEventArgs> handler = this.Progress;
636 if (null != handler)
637 {
638 handler(this, args);
639 }
640 }
641
642 /// <summary>
643 /// Called by the engine, raises the <see cref="Error"/> event.
644 /// </summary>
645 /// <param name="args">Additional arguments for this event.</param>
646 protected virtual void OnError(ErrorEventArgs args)
647 {
648 EventHandler<ErrorEventArgs> handler = this.Error;
649 if (null != handler)
650 {
651 handler(this, args);
652 }
653 }
654
655 /// <summary>
656 /// Called by the engine, raises the <see cref="RegisterBegin"/> event.
657 /// </summary>
658 /// <param name="args">Additional arguments for this event.</param>
659 protected virtual void OnRegisterBegin(RegisterBeginEventArgs args)
660 {
661 EventHandler<RegisterBeginEventArgs> handler = this.RegisterBegin;
662 if (null != handler)
663 {
664 handler(this, args);
665 }
666 }
667
668 /// <summary>
669 /// Called by the engine, raises the <see cref="RegisterComplete"/> event.
670 /// </summary>
671 /// <param name="args">Additional arguments for this event.</param>
672 protected virtual void OnRegisterComplete(RegisterCompleteEventArgs args)
673 {
674 EventHandler<RegisterCompleteEventArgs> handler = this.RegisterComplete;
675 if (null != handler)
676 {
677 handler(this, args);
678 }
679 }
680
681 /// <summary>
682 /// Called by the engine, raises the <see cref="UnregisterBegin"/> event.
683 /// </summary>
684 /// <param name="args">Additional arguments for this event.</param>
685 protected virtual void OnUnregisterBegin(UnregisterBeginEventArgs args)
686 {
687 EventHandler<UnregisterBeginEventArgs> handler = this.UnregisterBegin;
688 if (null != handler)
689 {
690 handler(this, args);
691 }
692 }
693
694 /// <summary>
695 /// Called by the engine, raises the <see cref="UnregisterComplete"/> event.
696 /// </summary>
697 /// <param name="args">Additional arguments for this event.</param>
698 protected virtual void OnUnregisterComplete(UnregisterCompleteEventArgs args)
699 {
700 EventHandler<UnregisterCompleteEventArgs> handler = this.UnregisterComplete;
701 if (null != handler)
702 {
703 handler(this, args);
704 }
705 }
706
707 /// <summary>
708 /// Called by the engine, raises the <see cref="CacheBegin"/> event.
709 /// </summary>
710 /// <param name="args"></param>
711 protected virtual void OnCacheBegin(CacheBeginEventArgs args)
712 {
713 EventHandler<CacheBeginEventArgs> handler = this.CacheBegin;
714 if (null != handler)
715 {
716 handler(this, args);
717 }
718 }
719
720 /// <summary>
721 /// Called by the engine, raises the <see cref="CachePackageBegin"/> event.
722 /// </summary>
723 /// <param name="args"></param>
724 protected virtual void OnCachePackageBegin(CachePackageBeginEventArgs args)
725 {
726 EventHandler<CachePackageBeginEventArgs> handler = this.CachePackageBegin;
727 if (null != handler)
728 {
729 handler(this, args);
730 }
731 }
732
733 /// <summary>
734 /// Called by the engine, raises the <see cref="CacheAcquireBegin"/> event.
735 /// </summary>
736 /// <param name="args"></param>
737 protected virtual void OnCacheAcquireBegin(CacheAcquireBeginEventArgs args)
738 {
739 EventHandler<CacheAcquireBeginEventArgs> handler = this.CacheAcquireBegin;
740 if (null != handler)
741 {
742 handler(this, args);
743 }
744 }
745
746 /// <summary>
747 /// Called by the engine, raises the <see cref="CacheAcquireProgress"/> event.
748 /// </summary>
749 /// <param name="args"></param>
750 protected virtual void OnCacheAcquireProgress(CacheAcquireProgressEventArgs args)
751 {
752 EventHandler<CacheAcquireProgressEventArgs> handler = this.CacheAcquireProgress;
753 if (null != handler)
754 {
755 handler(this, args);
756 }
757 }
758
759 /// <summary>
760 /// Called by the engine, raises the <see cref="CacheAcquireResolving"/> event.
761 /// </summary>
762 /// <param name="args">Additional arguments for this event.</param>
763 protected virtual void OnCacheAcquireResolving(CacheAcquireResolvingEventArgs args)
764 {
765 EventHandler<CacheAcquireResolvingEventArgs> handler = this.CacheAcquireResolving;
766 if (null != handler)
767 {
768 handler(this, args);
769 }
770 }
771
772 /// <summary>
773 /// Called by the engine, raises the <see cref="CacheAcquireComplete"/> event.
774 /// </summary>
775 /// <param name="args"></param>
776 protected virtual void OnCacheAcquireComplete(CacheAcquireCompleteEventArgs args)
777 {
778 EventHandler<CacheAcquireCompleteEventArgs> handler = this.CacheAcquireComplete;
779 if (null != handler)
780 {
781 handler(this, args);
782 }
783 }
784
785 /// <summary>
786 /// Called by the engine, raises the <see cref="CacheVerifyBegin"/> event.
787 /// </summary>
788 /// <param name="args"></param>
789 protected virtual void OnCacheVerifyBegin(CacheVerifyBeginEventArgs args)
790 {
791 EventHandler<CacheVerifyBeginEventArgs> handler = this.CacheVerifyBegin;
792 if (null != handler)
793 {
794 handler(this, args);
795 }
796 }
797
798 /// <summary>
799 /// Called by the engine, raises the <see cref="CacheVerifyProgress"/> event.
800 /// </summary>
801 /// <param name="args"></param>
802 protected virtual void OnCacheVerifyProgress(CacheVerifyProgressEventArgs args)
803 {
804 EventHandler<CacheVerifyProgressEventArgs> handler = this.CacheVerifyProgress;
805 if (null != handler)
806 {
807 handler(this, args);
808 }
809 }
810
811 /// <summary>
812 /// Called by the engine, raises the <see cref="CacheVerifyComplete"/> event.
813 /// </summary>
814 /// <param name="args"></param>
815 protected virtual void OnCacheVerifyComplete(CacheVerifyCompleteEventArgs args)
816 {
817 EventHandler<CacheVerifyCompleteEventArgs> handler = this.CacheVerifyComplete;
818 if (null != handler)
819 {
820 handler(this, args);
821 }
822 }
823
824 /// <summary>
825 /// Called by the engine, raises the <see cref="CachePackageComplete"/> event.
826 /// </summary>
827 /// <param name="args"></param>
828 protected virtual void OnCachePackageComplete(CachePackageCompleteEventArgs args)
829 {
830 EventHandler<CachePackageCompleteEventArgs> handler = this.CachePackageComplete;
831 if (null != handler)
832 {
833 handler(this, args);
834 }
835 }
836
837 /// <summary>
838 /// Called by the engine, raises the <see cref="CacheComplete"/> event.
839 /// </summary>
840 /// <param name="args">Additional arguments for this event.</param>
841 protected virtual void OnCacheComplete(CacheCompleteEventArgs args)
842 {
843 EventHandler<CacheCompleteEventArgs> handler = this.CacheComplete;
844 if (null != handler)
845 {
846 handler(this, args);
847 }
848 }
849
850 /// <summary>
851 /// Called by the engine, raises the <see cref="ExecuteBegin"/> event.
852 /// </summary>
853 /// <param name="args">Additional arguments for this event.</param>
854 protected virtual void OnExecuteBegin(ExecuteBeginEventArgs args)
855 {
856 EventHandler<ExecuteBeginEventArgs> handler = this.ExecuteBegin;
857 if (null != handler)
858 {
859 handler(this, args);
860 }
861 }
862
863 /// <summary>
864 /// Called by the engine, raises the <see cref="ExecutePackageBegin"/> event.
865 /// </summary>
866 /// <param name="args">Additional arguments for this event.</param>
867 protected virtual void OnExecutePackageBegin(ExecutePackageBeginEventArgs args)
868 {
869 EventHandler<ExecutePackageBeginEventArgs> handler = this.ExecutePackageBegin;
870 if (null != handler)
871 {
872 handler(this, args);
873 }
874 }
875
876 /// <summary>
877 /// Called by the engine, raises the <see cref="ExecutePatchTarget"/> event.
878 /// </summary>
879 /// <param name="args">Additional arguments for this event.</param>
880 protected virtual void OnExecutePatchTarget(ExecutePatchTargetEventArgs args)
881 {
882 EventHandler<ExecutePatchTargetEventArgs> handler = this.ExecutePatchTarget;
883 if (null != handler)
884 {
885 handler(this, args);
886 }
887 }
888
889 /// <summary>
890 /// Called by the engine, raises the <see cref="ExecuteMsiMessage"/> event.
891 /// </summary>
892 /// <param name="args">Additional arguments for this event.</param>
893 protected virtual void OnExecuteMsiMessage(ExecuteMsiMessageEventArgs args)
894 {
895 EventHandler<ExecuteMsiMessageEventArgs> handler = this.ExecuteMsiMessage;
896 if (null != handler)
897 {
898 handler(this, args);
899 }
900 }
901
902 /// <summary>
903 /// Called by the engine, raises the <see cref="ExecuteFilesInUse"/> event.
904 /// </summary>
905 /// <param name="args">Additional arguments for this event.</param>
906 protected virtual void OnExecuteFilesInUse(ExecuteFilesInUseEventArgs args)
907 {
908 EventHandler<ExecuteFilesInUseEventArgs> handler = this.ExecuteFilesInUse;
909 if (null != handler)
910 {
911 handler(this, args);
912 }
913 }
914
915 /// <summary>
916 /// Called by the engine, raises the <see cref="ExecutePackageComplete"/> event.
917 /// </summary>
918 /// <param name="args">Additional arguments for this event.</param>
919 protected virtual void OnExecutePackageComplete(ExecutePackageCompleteEventArgs args)
920 {
921 EventHandler<ExecutePackageCompleteEventArgs> handler = this.ExecutePackageComplete;
922 if (null != handler)
923 {
924 handler(this, args);
925 }
926 }
927
928 /// <summary>
929 /// Called by the engine, raises the <see cref="ExecuteComplete"/> event.
930 /// </summary>
931 /// <param name="args">Additional arguments for this event.</param>
932 protected virtual void OnExecuteComplete(ExecuteCompleteEventArgs args)
933 {
934 EventHandler<ExecuteCompleteEventArgs> handler = this.ExecuteComplete;
935 if (null != handler)
936 {
937 handler(this, args);
938 }
939 }
940
941 /// <summary>
942 /// Called by the engine, raises the <see cref="ApplyComplete"/> event.
943 /// </summary>
944 /// <param name="args">Additional arguments for this event.</param>
945 protected virtual void OnApplyComplete(ApplyCompleteEventArgs args)
946 {
947 EventHandler<ApplyCompleteEventArgs> handler = this.ApplyComplete;
948 if (null != handler)
949 {
950 handler(this, args);
951 }
952 }
953
954 /// <summary>
955 /// Called by the engine, raises the <see cref="ExecuteProgress"/> event.
956 /// </summary>
957 /// <param name="args">Additional arguments for this event.</param>
958 protected virtual void OnExecuteProgress(ExecuteProgressEventArgs args)
959 {
960 EventHandler<ExecuteProgressEventArgs> handler = this.ExecuteProgress;
961 if (null != handler)
962 {
963 handler(this, args);
964 }
965 }
966
967 /// <summary>
968 /// Called by the engine, raises the <see cref="LaunchApprovedExeBegin"/> event.
969 /// </summary>
970 /// <param name="args">Additional arguments for this event.</param>
971 protected virtual void OnLaunchApprovedExeBegin(LaunchApprovedExeBeginEventArgs args)
972 {
973 EventHandler<LaunchApprovedExeBeginEventArgs> handler = this.LaunchApprovedExeBegin;
974 if (null != handler)
975 {
976 handler(this, args);
977 }
978 }
979
980 /// <summary>
981 /// Called by the engine, raises the <see cref="LaunchApprovedExeComplete"/> event.
982 /// </summary>
983 /// <param name="args">Additional arguments for this event.</param>
984 protected virtual void OnLaunchApprovedExeComplete(LaunchApprovedExeCompleteEventArgs args)
985 {
986 EventHandler<LaunchApprovedExeCompleteEventArgs> handler = this.LaunchApprovedExeComplete;
987 if (null != handler)
988 {
989 handler(this, args);
990 }
991 }
992
993 /// <summary>
994 /// Called by the engine, raises the <see cref="BeginMsiTransactionBegin"/> event.
995 /// </summary>
996 /// <param name="args">Additional arguments for this event.</param>
997 protected virtual void OnBeginMsiTransactionBegin(BeginMsiTransactionBeginEventArgs args)
998 {
999 EventHandler<BeginMsiTransactionBeginEventArgs> handler = this.BeginMsiTransactionBegin;
1000 if (null != handler)
1001 {
1002 handler(this, args);
1003 }
1004 }
1005
1006 /// <summary>
1007 /// Called by the engine, raises the <see cref="BeginMsiTransactionComplete"/> event.
1008 /// </summary>
1009 /// <param name="args">Additional arguments for this event.</param>
1010 protected virtual void OnBeginMsiTransactionComplete(BeginMsiTransactionCompleteEventArgs args)
1011 {
1012 EventHandler<BeginMsiTransactionCompleteEventArgs> handler = this.BeginMsiTransactionComplete;
1013 if (null != handler)
1014 {
1015 handler(this, args);
1016 }
1017 }
1018
1019 /// <summary>
1020 /// Called by the engine, raises the <see cref="CommitMsiTransactionBegin"/> event.
1021 /// </summary>
1022 /// <param name="args">Additional arguments for this event.</param>
1023 protected virtual void OnCommitMsiTransactionBegin(CommitMsiTransactionBeginEventArgs args)
1024 {
1025 EventHandler<CommitMsiTransactionBeginEventArgs> handler = this.CommitMsiTransactionBegin;
1026 if (null != handler)
1027 {
1028 handler(this, args);
1029 }
1030 }
1031
1032 /// <summary>
1033 /// Called by the engine, raises the <see cref="CommitMsiTransactionComplete"/> event.
1034 /// </summary>
1035 /// <param name="args">Additional arguments for this event.</param>
1036 protected virtual void OnCommitMsiTransactionComplete(CommitMsiTransactionCompleteEventArgs args)
1037 {
1038 EventHandler<CommitMsiTransactionCompleteEventArgs> handler = this.CommitMsiTransactionComplete;
1039 if (null != handler)
1040 {
1041 handler(this, args);
1042 }
1043 }
1044
1045 /// <summary>
1046 /// Called by the engine, raises the <see cref="RollbackMsiTransactionBegin"/> event.
1047 /// </summary>
1048 /// <param name="args">Additional arguments for this event.</param>
1049 protected virtual void OnRollbackMsiTransactionBegin(RollbackMsiTransactionBeginEventArgs args)
1050 {
1051 EventHandler<RollbackMsiTransactionBeginEventArgs> handler = this.RollbackMsiTransactionBegin;
1052 if (null != handler)
1053 {
1054 handler(this, args);
1055 }
1056 }
1057
1058 /// <summary>
1059 /// Called by the engine, raises the <see cref="RollbackMsiTransactionComplete"/> event.
1060 /// </summary>
1061 /// <param name="args">Additional arguments for this event.</param>
1062 protected virtual void OnRollbackMsiTransactionComplete(RollbackMsiTransactionCompleteEventArgs args)
1063 {
1064 EventHandler<RollbackMsiTransactionCompleteEventArgs> handler = this.RollbackMsiTransactionComplete;
1065 if (null != handler)
1066 {
1067 handler(this, args);
1068 }
1069 }
1070
1071 /// <summary>
1072 /// Called by the engine, raises the <see cref="PauseAutomaticUpdatesBegin"/> event.
1073 /// </summary>
1074 /// <param name="args">Additional arguments for this event.</param>
1075 protected virtual void OnPauseAutomaticUpdatesBegin(PauseAutomaticUpdatesBeginEventArgs args)
1076 {
1077 EventHandler<PauseAutomaticUpdatesBeginEventArgs> handler = this.PauseAutomaticUpdatesBegin;
1078 if (null != handler)
1079 {
1080 handler(this, args);
1081 }
1082 }
1083
1084 /// <summary>
1085 /// Called by the engine, raises the <see cref="PauseAutomaticUpdatesComplete"/> event.
1086 /// </summary>
1087 /// <param name="args">Additional arguments for this event.</param>
1088 protected virtual void OnPauseAutomaticUpdatesComplete(PauseAutomaticUpdatesCompleteEventArgs args)
1089 {
1090 EventHandler<PauseAutomaticUpdatesCompleteEventArgs> handler = this.PauseAutomaticUpdatesComplete;
1091 if (null != handler)
1092 {
1093 handler(this, args);
1094 }
1095 }
1096
1097 /// <summary>
1098 /// Called by the engine, raises the <see cref="SystemRestorePointBegin"/> event.
1099 /// </summary>
1100 /// <param name="args">Additional arguments for this event.</param>
1101 protected virtual void OnSystemRestorePointBegin(SystemRestorePointBeginEventArgs args)
1102 {
1103 EventHandler<SystemRestorePointBeginEventArgs> handler = this.SystemRestorePointBegin;
1104 if (null != handler)
1105 {
1106 handler(this, args);
1107 }
1108 }
1109
1110 /// <summary>
1111 /// Called by the engine, raises the <see cref="SystemRestorePointComplete"/> event.
1112 /// </summary>
1113 /// <param name="args">Additional arguments for this event.</param>
1114 protected virtual void OnSystemRestorePointComplete(SystemRestorePointCompleteEventArgs args)
1115 {
1116 EventHandler<SystemRestorePointCompleteEventArgs> handler = this.SystemRestorePointComplete;
1117 if (null != handler)
1118 {
1119 handler(this, args);
1120 }
1121 }
1122
1123 /// <summary>
1124 /// Called by the engine, raises the <see cref="PlanForwardCompatibleBundle"/> event.
1125 /// </summary>
1126 protected virtual void OnPlanForwardCompatibleBundle(PlanForwardCompatibleBundleEventArgs args)
1127 {
1128 EventHandler<PlanForwardCompatibleBundleEventArgs> handler = this.PlanForwardCompatibleBundle;
1129 if (null != handler)
1130 {
1131 handler(this, args);
1132 }
1133 }
1134
1135 /// <summary>
1136 /// Called by the engine, raises the <see cref="CacheContainerOrPayloadVerifyBegin"/> event.
1137 /// </summary>
1138 /// <param name="args"></param>
1139 protected virtual void OnCacheContainerOrPayloadVerifyBegin(CacheContainerOrPayloadVerifyBeginEventArgs args)
1140 {
1141 EventHandler<CacheContainerOrPayloadVerifyBeginEventArgs> handler = this.CacheContainerOrPayloadVerifyBegin;
1142 if (null != handler)
1143 {
1144 handler(this, args);
1145 }
1146 }
1147
1148 /// <summary>
1149 /// Called by the engine, raises the <see cref="CacheContainerOrPayloadVerifyProgress"/> event.
1150 /// </summary>
1151 /// <param name="args"></param>
1152 protected virtual void OnCacheContainerOrPayloadVerifyProgress(CacheContainerOrPayloadVerifyProgressEventArgs args)
1153 {
1154 EventHandler<CacheContainerOrPayloadVerifyProgressEventArgs> handler = this.CacheContainerOrPayloadVerifyProgress;
1155 if (null != handler)
1156 {
1157 handler(this, args);
1158 }
1159 }
1160
1161 /// <summary>
1162 /// Called by the engine, raises the <see cref="CacheContainerOrPayloadVerifyComplete"/> event.
1163 /// </summary>
1164 /// <param name="args"></param>
1165 protected virtual void OnCacheContainerOrPayloadVerifyComplete(CacheContainerOrPayloadVerifyCompleteEventArgs args)
1166 {
1167 EventHandler<CacheContainerOrPayloadVerifyCompleteEventArgs> handler = this.CacheContainerOrPayloadVerifyComplete;
1168 if (null != handler)
1169 {
1170 handler(this, args);
1171 }
1172 }
1173
1174 /// <summary>
1175 /// Called by the engine, raises the <see cref="CachePayloadExtractBegin"/> event.
1176 /// </summary>
1177 /// <param name="args"></param>
1178 protected virtual void OnCachePayloadExtractBegin(CachePayloadExtractBeginEventArgs args)
1179 {
1180 EventHandler<CachePayloadExtractBeginEventArgs> handler = this.CachePayloadExtractBegin;
1181 if (null != handler)
1182 {
1183 handler(this, args);
1184 }
1185 }
1186
1187 /// <summary>
1188 /// Called by the engine, raises the <see cref="CachePayloadExtractProgress"/> event.
1189 /// </summary>
1190 /// <param name="args"></param>
1191 protected virtual void OnCachePayloadExtractProgress(CachePayloadExtractProgressEventArgs args)
1192 {
1193 EventHandler<CachePayloadExtractProgressEventArgs> handler = this.CachePayloadExtractProgress;
1194 if (null != handler)
1195 {
1196 handler(this, args);
1197 }
1198 }
1199
1200 /// <summary>
1201 /// Called by the engine, raises the <see cref="CachePayloadExtractComplete"/> event.
1202 /// </summary>
1203 /// <param name="args"></param>
1204 protected virtual void OnCachePayloadExtractComplete(CachePayloadExtractCompleteEventArgs args)
1205 {
1206 EventHandler<CachePayloadExtractCompleteEventArgs> handler = this.CachePayloadExtractComplete;
1207 if (null != handler)
1208 {
1209 handler(this, args);
1210 }
1211 }
1212
1213 #region IBootstrapperApplication Members
1214
1215 int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults, IntPtr pvContext)
1216 {
1217 switch (message)
1218 {
1219 default:
1220 return NativeMethods.E_NOTIMPL;
1221 }
1222 }
1223
1224 void IBootstrapperApplication.BAProcFallback(int message, IntPtr pvArgs, IntPtr pvResults, ref int phr, IntPtr pvContext)
1225 {
1226 }
1227
1228 int IBootstrapperApplication.OnStartup()
1229 {
1230 StartupEventArgs args = new StartupEventArgs();
1231 this.OnStartup(args);
1232
1233 return args.HResult;
1234 }
1235
1236 int IBootstrapperApplication.OnShutdown(ref BOOTSTRAPPER_SHUTDOWN_ACTION action)
1237 {
1238 ShutdownEventArgs args = new ShutdownEventArgs(action);
1239 this.OnShutdown(args);
1240
1241 action = args.Action;
1242 return args.HResult;
1243 }
1244
1245 int IBootstrapperApplication.OnSystemShutdown(EndSessionReasons dwEndSession, ref bool fCancel)
1246 {
1247 SystemShutdownEventArgs args = new SystemShutdownEventArgs(dwEndSession, fCancel);
1248 this.OnSystemShutdown(args);
1249
1250 fCancel = args.Cancel;
1251 return args.HResult;
1252 }
1253
1254 int IBootstrapperApplication.OnDetectBegin(bool fCached, bool fInstalled, int cPackages, ref bool fCancel)
1255 {
1256 DetectBeginEventArgs args = new DetectBeginEventArgs(fCached, fInstalled, cPackages, fCancel);
1257 this.OnDetectBegin(args);
1258
1259 fCancel = args.Cancel;
1260 return args.HResult;
1261 }
1262
1263 int IBootstrapperApplication.OnDetectForwardCompatibleBundle(string wzBundleId, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, bool fMissingFromCache, ref bool fCancel)
1264 {
1265 DetectForwardCompatibleBundleEventArgs args = new DetectForwardCompatibleBundleEventArgs(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, fCancel);
1266 this.OnDetectForwardCompatibleBundle(args);
1267
1268 fCancel = args.Cancel;
1269 return args.HResult;
1270 }
1271
1272 int IBootstrapperApplication.OnDetectUpdateBegin(string wzUpdateLocation, ref bool fCancel, ref bool fSkip)
1273 {
1274 DetectUpdateBeginEventArgs args = new DetectUpdateBeginEventArgs(wzUpdateLocation, fCancel, fSkip);
1275 this.OnDetectUpdateBegin(args);
1276
1277 fCancel = args.Cancel;
1278 fSkip = args.Skip;
1279 return args.HResult;
1280 }
1281
1282 int IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, string wzVersion, string wzTitle, string wzSummary, string wzContentType, string wzContent, ref bool fCancel, ref bool fStopProcessingUpdates)
1283 {
1284 DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, wzVersion, wzTitle, wzSummary, wzContentType, wzContent, fCancel, fStopProcessingUpdates);
1285 this.OnDetectUpdate(args);
1286
1287 fCancel = args.Cancel;
1288 fStopProcessingUpdates = args.StopProcessingUpdates;
1289 return args.HResult;
1290 }
1291
1292 int IBootstrapperApplication.OnDetectUpdateComplete(int hrStatus, ref bool fIgnoreError)
1293 {
1294 DetectUpdateCompleteEventArgs args = new DetectUpdateCompleteEventArgs(hrStatus, fIgnoreError);
1295 this.OnDetectUpdateComplete(args);
1296
1297 fIgnoreError = args.IgnoreError;
1298 return args.HResult;
1299 }
1300
1301 int IBootstrapperApplication.OnDetectRelatedBundle(string wzProductCode, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, RelatedOperation operation, bool fMissingFromCache, ref bool fCancel)
1302 {
1303 DetectRelatedBundleEventArgs args = new DetectRelatedBundleEventArgs(wzProductCode, relationType, wzBundleTag, fPerMachine, wzVersion, operation, fMissingFromCache, fCancel);
1304 this.OnDetectRelatedBundle(args);
1305
1306 fCancel = args.Cancel;
1307 return args.HResult;
1308 }
1309
1310 int IBootstrapperApplication.OnDetectPackageBegin(string wzPackageId, ref bool fCancel)
1311 {
1312 DetectPackageBeginEventArgs args = new DetectPackageBeginEventArgs(wzPackageId, fCancel);
1313 this.OnDetectPackageBegin(args);
1314
1315 fCancel = args.Cancel;
1316 return args.HResult;
1317 }
1318
1319 int IBootstrapperApplication.OnDetectRelatedMsiPackage(string wzPackageId, string wzUpgradeCode, string wzProductCode, bool fPerMachine, string wzVersion, RelatedOperation operation, ref bool fCancel)
1320 {
1321 DetectRelatedMsiPackageEventArgs args = new DetectRelatedMsiPackageEventArgs(wzPackageId, wzUpgradeCode, wzProductCode, fPerMachine, wzVersion, operation, fCancel);
1322 this.OnDetectRelatedMsiPackage(args);
1323
1324 fCancel = args.Cancel;
1325 return args.HResult;
1326 }
1327
1328 int IBootstrapperApplication.OnDetectPatchTarget(string wzPackageId, string wzProductCode, PackageState patchState, ref bool fCancel)
1329 {
1330 DetectPatchTargetEventArgs args = new DetectPatchTargetEventArgs(wzPackageId, wzProductCode, patchState, fCancel);
1331 this.OnDetectPatchTarget(args);
1332
1333 fCancel = args.Cancel;
1334 return args.HResult;
1335 }
1336
1337 int IBootstrapperApplication.OnDetectMsiFeature(string wzPackageId, string wzFeatureId, FeatureState state, ref bool fCancel)
1338 {
1339 DetectMsiFeatureEventArgs args = new DetectMsiFeatureEventArgs(wzPackageId, wzFeatureId, state, fCancel);
1340 this.OnDetectMsiFeature(args);
1341
1342 fCancel = args.Cancel;
1343 return args.HResult;
1344 }
1345
1346 int IBootstrapperApplication.OnDetectPackageComplete(string wzPackageId, int hrStatus, PackageState state, bool fCached)
1347 {
1348 DetectPackageCompleteEventArgs args = new DetectPackageCompleteEventArgs(wzPackageId, hrStatus, state, fCached);
1349 this.OnDetectPackageComplete(args);
1350
1351 return args.HResult;
1352 }
1353
1354 int IBootstrapperApplication.OnDetectComplete(int hrStatus, bool fEligibleForCleanup)
1355 {
1356 DetectCompleteEventArgs args = new DetectCompleteEventArgs(hrStatus, fEligibleForCleanup);
1357 this.OnDetectComplete(args);
1358
1359 return args.HResult;
1360 }
1361
1362 int IBootstrapperApplication.OnPlanBegin(int cPackages, ref bool fCancel)
1363 {
1364 PlanBeginEventArgs args = new PlanBeginEventArgs(cPackages, fCancel);
1365 this.OnPlanBegin(args);
1366
1367 fCancel = args.Cancel;
1368 return args.HResult;
1369 }
1370
1371 int IBootstrapperApplication.OnPlanRelatedBundle(string wzBundleId, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
1372 {
1373 PlanRelatedBundleEventArgs args = new PlanRelatedBundleEventArgs(wzBundleId, recommendedState, pRequestedState, fCancel);
1374 this.OnPlanRelatedBundle(args);
1375
1376 pRequestedState = args.State;
1377 fCancel = args.Cancel;
1378 return args.HResult;
1379 }
1380
1381 int IBootstrapperApplication.OnPlanPackageBegin(string wzPackageId, PackageState state, bool fCached, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, RequestState recommendedState, BOOTSTRAPPER_CACHE_TYPE recommendedCacheType, ref RequestState pRequestedState, ref BOOTSTRAPPER_CACHE_TYPE pRequestedCacheType, ref bool fCancel)
1382 {
1383 PlanPackageBeginEventArgs args = new PlanPackageBeginEventArgs(wzPackageId, state, fCached, installCondition, recommendedState, recommendedCacheType, pRequestedState, pRequestedCacheType, fCancel);
1384 this.OnPlanPackageBegin(args);
1385
1386 pRequestedState = args.State;
1387 fCancel = args.Cancel;
1388 return args.HResult;
1389 }
1390
1391 int IBootstrapperApplication.OnPlanPatchTarget(string wzPackageId, string wzProductCode, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
1392 {
1393 PlanPatchTargetEventArgs args = new PlanPatchTargetEventArgs(wzPackageId, wzProductCode, recommendedState, pRequestedState, fCancel);
1394 this.OnPlanPatchTarget(args);
1395
1396 pRequestedState = args.State;
1397 fCancel = args.Cancel;
1398 return args.HResult;
1399 }
1400
1401 int IBootstrapperApplication.OnPlanMsiFeature(string wzPackageId, string wzFeatureId, FeatureState recommendedState, ref FeatureState pRequestedState, ref bool fCancel)
1402 {
1403 PlanMsiFeatureEventArgs args = new PlanMsiFeatureEventArgs(wzPackageId, wzFeatureId, recommendedState, pRequestedState, fCancel);
1404 this.OnPlanMsiFeature(args);
1405
1406 pRequestedState = args.State;
1407 fCancel = args.Cancel;
1408 return args.HResult;
1409 }
1410
1411 int IBootstrapperApplication.OnPlanMsiPackage(string wzPackageId, bool fExecute, ActionState action, ref bool fCancel, ref BURN_MSI_PROPERTY actionMsiProperty, ref INSTALLUILEVEL uiLevel, ref bool fDisableExternalUiHandler)
1412 {
1413 PlanMsiPackageEventArgs args = new PlanMsiPackageEventArgs(wzPackageId, fExecute, action, fCancel, actionMsiProperty, uiLevel, fDisableExternalUiHandler);
1414 this.OnPlanMsiPackage(args);
1415
1416 fCancel = args.Cancel;
1417 actionMsiProperty = args.ActionMsiProperty;
1418 uiLevel = args.UiLevel;
1419 fDisableExternalUiHandler = args.DisableExternalUiHandler;
1420 return args.HResult;
1421 }
1422
1423 int IBootstrapperApplication.OnPlanPackageComplete(string wzPackageId, int hrStatus, RequestState requested)
1424 {
1425 var args = new PlanPackageCompleteEventArgs(wzPackageId, hrStatus, requested);
1426 this.OnPlanPackageComplete(args);
1427
1428 return args.HResult;
1429 }
1430
1431 int IBootstrapperApplication.OnPlannedPackage(string wzPackageId, ActionState execute, ActionState rollback, bool fPlannedCache, bool fPlannedUncache)
1432 {
1433 var args = new PlannedPackageEventArgs(wzPackageId, execute, rollback, fPlannedCache, fPlannedUncache);
1434 this.OnPlannedPackage(args);
1435
1436 return args.HResult;
1437 }
1438
1439 int IBootstrapperApplication.OnPlanComplete(int hrStatus)
1440 {
1441 PlanCompleteEventArgs args = new PlanCompleteEventArgs(hrStatus);
1442 this.OnPlanComplete(args);
1443
1444 return args.HResult;
1445 }
1446
1447 int IBootstrapperApplication.OnApplyBegin(int dwPhaseCount, ref bool fCancel)
1448 {
1449 this.applying = true;
1450
1451 ApplyBeginEventArgs args = new ApplyBeginEventArgs(dwPhaseCount, fCancel);
1452 this.OnApplyBegin(args);
1453
1454 fCancel = args.Cancel;
1455 return args.HResult;
1456 }
1457
1458 int IBootstrapperApplication.OnElevateBegin(ref bool fCancel)
1459 {
1460 ElevateBeginEventArgs args = new ElevateBeginEventArgs(fCancel);
1461 this.OnElevateBegin(args);
1462
1463 fCancel = args.Cancel;
1464 return args.HResult;
1465 }
1466
1467 int IBootstrapperApplication.OnElevateComplete(int hrStatus)
1468 {
1469 ElevateCompleteEventArgs args = new ElevateCompleteEventArgs(hrStatus);
1470 this.OnElevateComplete(args);
1471
1472 return args.HResult;
1473 }
1474
1475 int IBootstrapperApplication.OnProgress(int dwProgressPercentage, int dwOverallPercentage, ref bool fCancel)
1476 {
1477 ProgressEventArgs args = new ProgressEventArgs(dwProgressPercentage, dwOverallPercentage, fCancel);
1478 this.OnProgress(args);
1479
1480 fCancel = args.Cancel;
1481 return args.HResult;
1482 }
1483
1484 int IBootstrapperApplication.OnError(ErrorType errorType, string wzPackageId, int dwCode, string wzError, int dwUIHint, int cData, string[] rgwzData, Result nRecommendation, ref Result pResult)
1485 {
1486 ErrorEventArgs args = new ErrorEventArgs(errorType, wzPackageId, dwCode, wzError, dwUIHint, rgwzData, nRecommendation, pResult);
1487 this.OnError(args);
1488
1489 pResult = args.Result;
1490 return args.HResult;
1491 }
1492
1493 int IBootstrapperApplication.OnRegisterBegin(ref bool fCancel)
1494 {
1495 RegisterBeginEventArgs args = new RegisterBeginEventArgs(fCancel);
1496 this.OnRegisterBegin(args);
1497
1498 fCancel = args.Cancel;
1499 return args.HResult;
1500 }
1501
1502 int IBootstrapperApplication.OnRegisterComplete(int hrStatus)
1503 {
1504 RegisterCompleteEventArgs args = new RegisterCompleteEventArgs(hrStatus);
1505 this.OnRegisterComplete(args);
1506
1507 return args.HResult;
1508 }
1509
1510 int IBootstrapperApplication.OnCacheBegin(ref bool fCancel)
1511 {
1512 CacheBeginEventArgs args = new CacheBeginEventArgs(fCancel);
1513 this.OnCacheBegin(args);
1514
1515 fCancel = args.Cancel;
1516 return args.HResult;
1517 }
1518
1519 int IBootstrapperApplication.OnCachePackageBegin(string wzPackageId, int cCachePayloads, long dw64PackageCacheSize, ref bool fCancel)
1520 {
1521 CachePackageBeginEventArgs args = new CachePackageBeginEventArgs(wzPackageId, cCachePayloads, dw64PackageCacheSize, fCancel);
1522 this.OnCachePackageBegin(args);
1523
1524 fCancel = args.Cancel;
1525 return args.HResult;
1526 }
1527
1528 int IBootstrapperApplication.OnCacheAcquireBegin(string wzPackageOrContainerId, string wzPayloadId, string wzSource, string wzDownloadUrl, string wzPayloadContainerId, CacheOperation recommendation, ref CacheOperation action, ref bool fCancel)
1529 {
1530 CacheAcquireBeginEventArgs args = new CacheAcquireBeginEventArgs(wzPackageOrContainerId, wzPayloadId, wzSource, wzDownloadUrl, wzPayloadContainerId, recommendation, action, fCancel);
1531 this.OnCacheAcquireBegin(args);
1532
1533 action = args.Action;
1534 fCancel = args.Cancel;
1535 return args.HResult;
1536 }
1537
1538 int IBootstrapperApplication.OnCacheAcquireProgress(string wzPackageOrContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, ref bool fCancel)
1539 {
1540 CacheAcquireProgressEventArgs args = new CacheAcquireProgressEventArgs(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, fCancel);
1541 this.OnCacheAcquireProgress(args);
1542
1543 fCancel = args.Cancel;
1544 return args.HResult;
1545 }
1546
1547 int IBootstrapperApplication.OnCacheAcquireResolving(string wzPackageOrContainerId, string wzPayloadId, string[] searchPaths, int cSearchPaths, bool fFoundLocal, int dwRecommendedSearchPath, string wzDownloadUrl, string wzPayloadContainerId, CacheResolveOperation recommendation, ref int dwChosenSearchPath, ref CacheResolveOperation action, ref bool fCancel)
1548 {
1549 CacheAcquireResolvingEventArgs args = new CacheAcquireResolvingEventArgs(wzPackageOrContainerId, wzPayloadId, searchPaths, fFoundLocal, dwRecommendedSearchPath, wzDownloadUrl, wzPayloadContainerId, recommendation, dwChosenSearchPath, action, fCancel);
1550 this.OnCacheAcquireResolving(args);
1551
1552 dwChosenSearchPath = args.ChosenSearchPath;
1553 action = args.Action;
1554 fCancel = args.Cancel;
1555 return args.HResult;
1556 }
1557
1558 int IBootstrapperApplication.OnCacheAcquireComplete(string wzPackageOrContainerId, string wzPayloadId, int hrStatus, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action)
1559 {
1560 CacheAcquireCompleteEventArgs args = new CacheAcquireCompleteEventArgs(wzPackageOrContainerId, wzPayloadId, hrStatus, recommendation, action);
1561 this.OnCacheAcquireComplete(args);
1562
1563 action = args.Action;
1564 return args.HResult;
1565 }
1566
1567 int IBootstrapperApplication.OnCacheVerifyBegin(string wzPackageOrContainerId, string wzPayloadId, ref bool fCancel)
1568 {
1569 CacheVerifyBeginEventArgs args = new CacheVerifyBeginEventArgs(wzPackageOrContainerId, wzPayloadId, fCancel);
1570 this.OnCacheVerifyBegin(args);
1571
1572 fCancel = args.Cancel;
1573 return args.HResult;
1574 }
1575
1576 int IBootstrapperApplication.OnCacheVerifyProgress(string wzPackageOrContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, CacheVerifyStep verifyStep, ref bool fCancel)
1577 {
1578 CacheVerifyProgressEventArgs args = new CacheVerifyProgressEventArgs(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, verifyStep, fCancel);
1579 this.OnCacheVerifyProgress(args);
1580
1581 fCancel = args.Cancel;
1582 return args.HResult;
1583 }
1584
1585 int IBootstrapperApplication.OnCacheVerifyComplete(string wzPackageOrContainerId, string wzPayloadId, int hrStatus, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action)
1586 {
1587 CacheVerifyCompleteEventArgs args = new CacheVerifyCompleteEventArgs(wzPackageOrContainerId, wzPayloadId, hrStatus, recommendation, action);
1588 this.OnCacheVerifyComplete(args);
1589
1590 action = args.Action;
1591 return args.HResult;
1592 }
1593
1594 int IBootstrapperApplication.OnCachePackageComplete(string wzPackageId, int hrStatus, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action)
1595 {
1596 CachePackageCompleteEventArgs args = new CachePackageCompleteEventArgs(wzPackageId, hrStatus, recommendation, action);
1597 this.OnCachePackageComplete(args);
1598
1599 action = args.Action;
1600 return args.HResult;
1601 }
1602
1603 int IBootstrapperApplication.OnCacheComplete(int hrStatus)
1604 {
1605 CacheCompleteEventArgs args = new CacheCompleteEventArgs(hrStatus);
1606 this.OnCacheComplete(args);
1607
1608 return args.HResult;
1609 }
1610
1611 int IBootstrapperApplication.OnExecuteBegin(int cExecutingPackages, ref bool fCancel)
1612 {
1613 ExecuteBeginEventArgs args = new ExecuteBeginEventArgs(cExecutingPackages, fCancel);
1614 this.OnExecuteBegin(args);
1615
1616 args.Cancel = fCancel;
1617 return args.HResult;
1618 }
1619
1620 int IBootstrapperApplication.OnExecutePackageBegin(string wzPackageId, bool fExecute, ActionState action, INSTALLUILEVEL uiLevel, bool fDisableExternalUiHandler, ref bool fCancel)
1621 {
1622 ExecutePackageBeginEventArgs args = new ExecutePackageBeginEventArgs(wzPackageId, fExecute, action, uiLevel, fDisableExternalUiHandler, fCancel);
1623 this.OnExecutePackageBegin(args);
1624
1625 fCancel = args.Cancel;
1626 return args.HResult;
1627 }
1628
1629 int IBootstrapperApplication.OnExecutePatchTarget(string wzPackageId, string wzTargetProductCode, ref bool fCancel)
1630 {
1631 ExecutePatchTargetEventArgs args = new ExecutePatchTargetEventArgs(wzPackageId, wzTargetProductCode, fCancel);
1632 this.OnExecutePatchTarget(args);
1633
1634 fCancel = args.Cancel;
1635 return args.HResult;
1636 }
1637
1638 int IBootstrapperApplication.OnExecuteProgress(string wzPackageId, int dwProgressPercentage, int dwOverallPercentage, ref bool fCancel)
1639 {
1640 ExecuteProgressEventArgs args = new ExecuteProgressEventArgs(wzPackageId, dwProgressPercentage, dwOverallPercentage, fCancel);
1641 this.OnExecuteProgress(args);
1642
1643 fCancel = args.Cancel;
1644 return args.HResult;
1645 }
1646
1647 int IBootstrapperApplication.OnExecuteMsiMessage(string wzPackageId, InstallMessage messageType, int dwUIHint, string wzMessage, int cData, string[] rgwzData, Result nRecommendation, ref Result pResult)
1648 {
1649 ExecuteMsiMessageEventArgs args = new ExecuteMsiMessageEventArgs(wzPackageId, messageType, dwUIHint, wzMessage, rgwzData, nRecommendation, pResult);
1650 this.OnExecuteMsiMessage(args);
1651
1652 pResult = args.Result;
1653 return args.HResult;
1654 }
1655
1656 int IBootstrapperApplication.OnExecuteFilesInUse(string wzPackageId, int cFiles, string[] rgwzFiles, Result nRecommendation, ref Result pResult)
1657 {
1658 ExecuteFilesInUseEventArgs args = new ExecuteFilesInUseEventArgs(wzPackageId, rgwzFiles, nRecommendation, pResult);
1659 this.OnExecuteFilesInUse(args);
1660
1661 pResult = args.Result;
1662 return args.HResult;
1663 }
1664
1665 int IBootstrapperApplication.OnExecutePackageComplete(string wzPackageId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION pAction)
1666 {
1667 ExecutePackageCompleteEventArgs args = new ExecutePackageCompleteEventArgs(wzPackageId, hrStatus, restart, recommendation, pAction);
1668 this.OnExecutePackageComplete(args);
1669
1670 pAction = args.Action;
1671 return args.HResult;
1672 }
1673
1674 int IBootstrapperApplication.OnExecuteComplete(int hrStatus)
1675 {
1676 ExecuteCompleteEventArgs args = new ExecuteCompleteEventArgs(hrStatus);
1677 this.OnExecuteComplete(args);
1678
1679 return args.HResult;
1680 }
1681
1682 int IBootstrapperApplication.OnUnregisterBegin(bool fKeepRegistration, ref bool fForceKeepRegistration)
1683 {
1684 UnregisterBeginEventArgs args = new UnregisterBeginEventArgs(fKeepRegistration, fForceKeepRegistration);
1685 this.OnUnregisterBegin(args);
1686
1687 fForceKeepRegistration = args.ForceKeepRegistration;
1688 return args.HResult;
1689 }
1690
1691 int IBootstrapperApplication.OnUnregisterComplete(int hrStatus)
1692 {
1693 UnregisterCompleteEventArgs args = new UnregisterCompleteEventArgs(hrStatus);
1694 this.OnUnregisterComplete(args);
1695
1696 return args.HResult;
1697 }
1698
1699 int IBootstrapperApplication.OnApplyComplete(int hrStatus, ApplyRestart restart, BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_APPLYCOMPLETE_ACTION pAction)
1700 {
1701 ApplyCompleteEventArgs args = new ApplyCompleteEventArgs(hrStatus, restart, recommendation, pAction);
1702 this.OnApplyComplete(args);
1703
1704 this.applying = false;
1705
1706 pAction = args.Action;
1707 return args.HResult;
1708 }
1709
1710 int IBootstrapperApplication.OnLaunchApprovedExeBegin(ref bool fCancel)
1711 {
1712 LaunchApprovedExeBeginEventArgs args = new LaunchApprovedExeBeginEventArgs(fCancel);
1713 this.OnLaunchApprovedExeBegin(args);
1714
1715 fCancel = args.Cancel;
1716 return args.HResult;
1717 }
1718
1719 int IBootstrapperApplication.OnLaunchApprovedExeComplete(int hrStatus, int processId)
1720 {
1721 LaunchApprovedExeCompleteEventArgs args = new LaunchApprovedExeCompleteEventArgs(hrStatus, processId);
1722 this.OnLaunchApprovedExeComplete(args);
1723
1724 return args.HResult;
1725 }
1726
1727 int IBootstrapperApplication.OnBeginMsiTransactionBegin(string transactionId, ref bool fCancel)
1728 {
1729 BeginMsiTransactionBeginEventArgs args = new BeginMsiTransactionBeginEventArgs(transactionId, fCancel);
1730 this.OnBeginMsiTransactionBegin(args);
1731
1732 fCancel = args.Cancel;
1733 return args.HResult;
1734 }
1735
1736 int IBootstrapperApplication.OnBeginMsiTransactionComplete(string transactionId, int hrStatus)
1737 {
1738 BeginMsiTransactionCompleteEventArgs args = new BeginMsiTransactionCompleteEventArgs(transactionId, hrStatus);
1739 this.OnBeginMsiTransactionComplete(args);
1740
1741 return args.HResult;
1742 }
1743
1744 int IBootstrapperApplication.OnCommitMsiTransactionBegin(string transactionId, ref bool fCancel)
1745 {
1746 CommitMsiTransactionBeginEventArgs args = new CommitMsiTransactionBeginEventArgs(transactionId, fCancel);
1747 this.OnCommitMsiTransactionBegin(args);
1748
1749 fCancel = args.Cancel;
1750 return args.HResult;
1751 }
1752
1753 int IBootstrapperApplication.OnCommitMsiTransactionComplete(string transactionId, int hrStatus)
1754 {
1755 CommitMsiTransactionCompleteEventArgs args = new CommitMsiTransactionCompleteEventArgs(transactionId, hrStatus);
1756 this.OnCommitMsiTransactionComplete(args);
1757
1758 return args.HResult;
1759 }
1760
1761 int IBootstrapperApplication.OnRollbackMsiTransactionBegin(string transactionId)
1762 {
1763 RollbackMsiTransactionBeginEventArgs args = new RollbackMsiTransactionBeginEventArgs(transactionId);
1764 this.OnRollbackMsiTransactionBegin(args);
1765
1766 return args.HResult;
1767 }
1768
1769 int IBootstrapperApplication.OnRollbackMsiTransactionComplete(string transactionId, int hrStatus)
1770 {
1771 RollbackMsiTransactionCompleteEventArgs args = new RollbackMsiTransactionCompleteEventArgs(transactionId, hrStatus);
1772 this.OnRollbackMsiTransactionComplete(args);
1773
1774 return args.HResult;
1775 }
1776
1777 int IBootstrapperApplication.OnPauseAutomaticUpdatesBegin()
1778 {
1779 PauseAutomaticUpdatesBeginEventArgs args = new PauseAutomaticUpdatesBeginEventArgs();
1780 this.OnPauseAutomaticUpdatesBegin(args);
1781
1782 return args.HResult;
1783 }
1784
1785 int IBootstrapperApplication.OnPauseAutomaticUpdatesComplete(int hrStatus)
1786 {
1787 PauseAutomaticUpdatesCompleteEventArgs args = new PauseAutomaticUpdatesCompleteEventArgs(hrStatus);
1788 this.OnPauseAutomaticUpdatesComplete(args);
1789
1790 return args.HResult;
1791 }
1792
1793 int IBootstrapperApplication.OnSystemRestorePointBegin()
1794 {
1795 SystemRestorePointBeginEventArgs args = new SystemRestorePointBeginEventArgs();
1796 this.OnSystemRestorePointBegin(args);
1797
1798 return args.HResult;
1799 }
1800
1801 int IBootstrapperApplication.OnSystemRestorePointComplete(int hrStatus)
1802 {
1803 SystemRestorePointCompleteEventArgs args = new SystemRestorePointCompleteEventArgs(hrStatus);
1804 this.OnSystemRestorePointComplete(args);
1805
1806 return args.HResult;
1807 }
1808
1809 int IBootstrapperApplication.OnPlanForwardCompatibleBundle(string wzBundleId, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, bool fRecommendedIgnoreBundle, ref bool fCancel, ref bool fIgnoreBundle)
1810 {
1811 PlanForwardCompatibleBundleEventArgs args = new PlanForwardCompatibleBundleEventArgs(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fRecommendedIgnoreBundle, fCancel, fIgnoreBundle);
1812 this.OnPlanForwardCompatibleBundle(args);
1813
1814 fCancel = args.Cancel;
1815 fIgnoreBundle = args.IgnoreBundle;
1816 return args.HResult;
1817 }
1818
1819 int IBootstrapperApplication.OnCacheContainerOrPayloadVerifyBegin(string wzPackageOrContainerId, string wzPayloadId, ref bool fCancel)
1820 {
1821 CacheContainerOrPayloadVerifyBeginEventArgs args = new CacheContainerOrPayloadVerifyBeginEventArgs(wzPackageOrContainerId, wzPayloadId, fCancel);
1822 this.OnCacheContainerOrPayloadVerifyBegin(args);
1823
1824 fCancel = args.Cancel;
1825 return args.HResult;
1826 }
1827
1828 int IBootstrapperApplication.OnCacheContainerOrPayloadVerifyProgress(string wzPackageOrContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, ref bool fCancel)
1829 {
1830 CacheContainerOrPayloadVerifyProgressEventArgs args = new CacheContainerOrPayloadVerifyProgressEventArgs(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, fCancel);
1831 this.OnCacheContainerOrPayloadVerifyProgress(args);
1832
1833 fCancel = args.Cancel;
1834 return args.HResult;
1835 }
1836
1837 int IBootstrapperApplication.OnCacheContainerOrPayloadVerifyComplete(string wzPackageOrContainerId, string wzPayloadId, int hrStatus)
1838 {
1839 CacheContainerOrPayloadVerifyCompleteEventArgs args = new CacheContainerOrPayloadVerifyCompleteEventArgs(wzPackageOrContainerId, wzPayloadId, hrStatus);
1840 this.OnCacheContainerOrPayloadVerifyComplete(args);
1841
1842 return args.HResult;
1843 }
1844
1845 int IBootstrapperApplication.OnCachePayloadExtractBegin(string wzContainerId, string wzPayloadId, ref bool fCancel)
1846 {
1847 CachePayloadExtractBeginEventArgs args = new CachePayloadExtractBeginEventArgs(wzContainerId, wzPayloadId, fCancel);
1848 this.OnCachePayloadExtractBegin(args);
1849
1850 fCancel = args.Cancel;
1851 return args.HResult;
1852 }
1853
1854 int IBootstrapperApplication.OnCachePayloadExtractProgress(string wzContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, ref bool fCancel)
1855 {
1856 CachePayloadExtractProgressEventArgs args = new CachePayloadExtractProgressEventArgs(wzContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, fCancel);
1857 this.OnCachePayloadExtractProgress(args);
1858
1859 fCancel = args.Cancel;
1860 return args.HResult;
1861 }
1862
1863 int IBootstrapperApplication.OnCachePayloadExtractComplete(string wzContainerId, string wzPayloadId, int hrStatus)
1864 {
1865 CachePayloadExtractCompleteEventArgs args = new CachePayloadExtractCompleteEventArgs(wzContainerId, wzPayloadId, hrStatus);
1866 this.OnCachePayloadExtractComplete(args);
1867
1868 return args.HResult;
1869 }
1870
1871 #endregion
1872 }
1873}
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationData.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationData.cs
new file mode 100644
index 00000000..739a08bb
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationData.cs
@@ -0,0 +1,101 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.IO;
7 using System.Xml.XPath;
8
9 /// <summary>
10 /// Utility class for reading BootstrapperApplicationData.xml.
11 /// </summary>
12 public class BootstrapperApplicationData : IBootstrapperApplicationData
13 {
14 /// <summary>
15 ///
16 /// </summary>
17 public const string DefaultFileName = "BootstrapperApplicationData.xml";
18
19 /// <summary>
20 ///
21 /// </summary>
22 public const string XMLNamespace = "http://wixtoolset.org/schemas/v4/BootstrapperApplicationData";
23
24 /// <summary>
25 /// The default path of where the BA was extracted to.
26 /// </summary>
27 public static readonly DirectoryInfo DefaultFolder;
28
29 /// <summary>
30 /// The default path to BootstrapperApplicationData.xml.
31 /// </summary>
32 public static readonly FileInfo DefaultFile;
33
34 static BootstrapperApplicationData()
35 {
36 DefaultFolder = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
37 DefaultFile = new FileInfo(Path.Combine(DefaultFolder.FullName, DefaultFileName));
38 }
39
40 /// <inheritdoc/>
41 public FileInfo BADataFile { get; private set; }
42
43 /// <inheritdoc/>
44 public IBundleInfo Bundle { get; private set; }
45
46 /// <summary>
47 /// Uses the default location for BootstrapperApplicationData.xml.
48 /// </summary>
49 public BootstrapperApplicationData() : this(DefaultFile) { }
50
51 /// <summary>
52 /// Uses the given file for BootstrapperApplicationData.xml.
53 /// </summary>
54 /// <param name="baDataFile"></param>
55 public BootstrapperApplicationData(FileInfo baDataFile)
56 {
57 this.BADataFile = baDataFile;
58
59 using (FileStream fs = this.BADataFile.OpenRead())
60 {
61 this.Bundle = BundleInfo.ParseBundleFromStream(fs);
62 }
63 }
64
65 /// <summary>
66 /// Utility method for parsing BootstrapperApplicationData.xml.
67 /// </summary>
68 /// <param name="node"></param>
69 /// <param name="attributeName"></param>
70 /// <returns></returns>
71 public static string GetAttribute(XPathNavigator node, string attributeName)
72 {
73 XPathNavigator attribute = node.SelectSingleNode("@" + attributeName);
74
75 if (attribute == null)
76 {
77 return null;
78 }
79
80 return attribute.Value;
81 }
82
83 /// <summary>
84 /// Utility method for parsing BootstrapperApplicationData.xml.
85 /// </summary>
86 /// <param name="node"></param>
87 /// <param name="attributeName"></param>
88 /// <returns></returns>
89 public static bool? GetYesNoAttribute(XPathNavigator node, string attributeName)
90 {
91 string attributeValue = GetAttribute(node, attributeName);
92
93 if (attributeValue == null)
94 {
95 return null;
96 }
97
98 return attributeValue.Equals("yes", StringComparison.InvariantCulture);
99 }
100 }
101}
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs
new file mode 100644
index 00000000..95252cf3
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperApplicationFactoryAttribute.cs
@@ -0,0 +1,35 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6
7 /// <summary>
8 /// Identifies the bootstrapper application factory class.
9 /// </summary>
10 /// <remarks>
11 /// This required assembly attribute identifies the bootstrapper application factory class.
12 /// </remarks>
13 [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
14 public sealed class BootstrapperApplicationFactoryAttribute : Attribute
15 {
16 private Type bootstrapperApplicationFactoryType;
17
18 /// <summary>
19 /// Creates a new instance of the <see cref="BootstrapperApplicationFactoryAttribute"/> class.
20 /// </summary>
21 /// <param name="bootstrapperApplicationFactoryType">The <see cref="Type"/> of the BA factory.</param>
22 public BootstrapperApplicationFactoryAttribute(Type bootstrapperApplicationFactoryType)
23 {
24 this.bootstrapperApplicationFactoryType = bootstrapperApplicationFactoryType;
25 }
26
27 /// <summary>
28 /// Gets the type of the bootstrapper application factory class to create.
29 /// </summary>
30 public Type BootstrapperApplicationFactoryType
31 {
32 get { return this.bootstrapperApplicationFactoryType; }
33 }
34 }
35}
diff --git a/src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs b/src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs
new file mode 100644
index 00000000..65dde0f4
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/BootstrapperCommand.cs
@@ -0,0 +1,145 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.ComponentModel;
7 using System.Runtime.InteropServices;
8
9 /// <summary>
10 /// Default implementation of <see cref="IBootstrapperCommand"/>.
11 /// </summary>
12 public sealed class BootstrapperCommand : IBootstrapperCommand
13 {
14 private readonly string commandLine;
15
16 /// <summary>
17 ///
18 /// </summary>
19 /// <param name="action"></param>
20 /// <param name="display"></param>
21 /// <param name="restart"></param>
22 /// <param name="commandLine"></param>
23 /// <param name="cmdShow"></param>
24 /// <param name="resume"></param>
25 /// <param name="splashScreen"></param>
26 /// <param name="relation"></param>
27 /// <param name="passthrough"></param>
28 /// <param name="layoutDirectory"></param>
29 /// <param name="bootstrapperWorkingFolder"></param>
30 /// <param name="bootstrapperApplicationDataPath"></param>
31 public BootstrapperCommand(
32 LaunchAction action,
33 Display display,
34 Restart restart,
35 string commandLine,
36 int cmdShow,
37 ResumeType resume,
38 IntPtr splashScreen,
39 RelationType relation,
40 bool passthrough,
41 string layoutDirectory,
42 string bootstrapperWorkingFolder,
43 string bootstrapperApplicationDataPath)
44 {
45 this.Action = action;
46 this.Display = display;
47 this.Restart = restart;
48 this.commandLine = commandLine;
49 this.CmdShow = cmdShow;
50 this.Resume = resume;
51 this.SplashScreen = splashScreen;
52 this.Relation = relation;
53 this.Passthrough = passthrough;
54 this.LayoutDirectory = layoutDirectory;
55 this.BootstrapperWorkingFolder = bootstrapperWorkingFolder;
56 this.BootstrapperApplicationDataPath = bootstrapperApplicationDataPath;
57 }
58
59 /// <inheritdoc/>
60 public LaunchAction Action { get; }
61
62 /// <inheritdoc/>
63 public Display Display { get; }
64
65 /// <inheritdoc/>
66 public Restart Restart { get; }
67
68 /// <inheritdoc/>
69 public string[] CommandLineArgs => GetCommandLineArgs(this.commandLine);
70
71 /// <inheritdoc/>
72 public int CmdShow { get; }
73
74 /// <inheritdoc/>
75 public ResumeType Resume { get; }
76
77 /// <inheritdoc/>
78 public IntPtr SplashScreen { get; }
79
80 /// <inheritdoc/>
81 public RelationType Relation { get; }
82
83 /// <inheritdoc/>
84 public bool Passthrough { get; }
85
86 /// <inheritdoc/>
87 public string LayoutDirectory { get; }
88
89 /// <inheritdoc/>
90 public string BootstrapperWorkingFolder { get; }
91
92 /// <inheritdoc/>
93 public string BootstrapperApplicationDataPath { get; }
94
95 /// <summary>
96 /// Gets the command line arguments as a string array.
97 /// </summary>
98 /// <returns>
99 /// Array of command line arguments.
100 /// </returns>
101 /// <exception type="Win32Exception">The command line could not be parsed into an array.</exception>
102 /// <remarks>
103 /// This method uses the same parsing as the operating system which handles quotes and spaces correctly.
104 /// </remarks>
105 public static string[] GetCommandLineArgs(string commandLine)
106 {
107 if (null == commandLine)
108 {
109 return new string[0];
110 }
111
112 // Parse the filtered command line arguments into a native array.
113 int argc = 0;
114
115 // CommandLineToArgvW tries to treat the first argument as the path to the process,
116 // which fails pretty miserably if your first argument is something like
117 // FOO="C:\Program Files\My Company". So give it something harmless to play with.
118 IntPtr argv = NativeMethods.CommandLineToArgvW("ignored " + commandLine, out argc);
119
120 if (IntPtr.Zero == argv)
121 {
122 // Throw an exception with the last error.
123 throw new Win32Exception();
124 }
125
126 // Marshal each native array pointer to a managed string.
127 try
128 {
129 // Skip "ignored" argument/hack.
130 string[] args = new string[argc - 1];
131 for (int i = 1; i < argc; ++i)
132 {
133 IntPtr argvi = Marshal.ReadIntPtr(argv, i * IntPtr.Size);
134 args[i - 1] = Marshal.PtrToStringUni(argvi);
135 }
136
137 return args;
138 }
139 finally
140 {
141 NativeMethods.LocalFree(argv);
142 }
143 }
144 }
145}
diff --git a/src/api/burn/WixToolset.Mba.Core/BundleInfo.cs b/src/api/burn/WixToolset.Mba.Core/BundleInfo.cs
new file mode 100644
index 00000000..3d5d535d
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/BundleInfo.cs
@@ -0,0 +1,86 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Collections.Generic;
7 using System.IO;
8 using System.Xml;
9 using System.Xml.XPath;
10
11 /// <summary>
12 /// Default implementation of <see cref="IBundleInfo"/>.
13 /// </summary>
14 public class BundleInfo : IBundleInfo
15 {
16 /// <inheritdoc/>
17 public bool PerMachine { get; internal set; }
18
19 /// <inheritdoc/>
20 public string Name { get; internal set; }
21
22 /// <inheritdoc/>
23 public string LogVariable { get; internal set; }
24
25 /// <inheritdoc/>
26 public IDictionary<string, IPackageInfo> Packages { get; internal set; }
27
28 internal BundleInfo()
29 {
30 this.Packages = new Dictionary<string, IPackageInfo>();
31 }
32
33 /// <inheritdoc/>
34 public IPackageInfo AddRelatedBundleAsPackage(DetectRelatedBundleEventArgs e)
35 {
36 var package = PackageInfo.GetRelatedBundleAsPackage(e.ProductCode, e.RelationType, e.PerMachine, e.Version);
37 this.Packages.Add(package.Id, package);
38 return package;
39 }
40
41 /// <summary>
42 /// Parses BA manifest from the given stream.
43 /// </summary>
44 /// <param name="stream"></param>
45 /// <returns></returns>
46 public static IBundleInfo ParseBundleFromStream(Stream stream)
47 {
48 XPathDocument manifest = new XPathDocument(stream);
49 XPathNavigator root = manifest.CreateNavigator();
50 return ParseBundleFromXml(root);
51 }
52
53 /// <summary>
54 /// Parses BA manifest from the given <see cref="XPathNavigator"/>.
55 /// </summary>
56 /// <param name="root">The root of the BA manifest.</param>
57 /// <returns></returns>
58 public static IBundleInfo ParseBundleFromXml(XPathNavigator root)
59 {
60 BundleInfo bundle = new BundleInfo();
61
62 XmlNamespaceManager namespaceManager = new XmlNamespaceManager(root.NameTable);
63 namespaceManager.AddNamespace("p", BootstrapperApplicationData.XMLNamespace);
64 XPathNavigator bundleNode = root.SelectSingleNode("/p:BootstrapperApplicationData/p:WixBundleProperties", namespaceManager);
65
66 if (bundleNode == null)
67 {
68 throw new Exception("Failed to select bundle information.");
69 }
70
71 bool? perMachine = BootstrapperApplicationData.GetYesNoAttribute(bundleNode, "PerMachine");
72 if (perMachine.HasValue)
73 {
74 bundle.PerMachine = perMachine.Value;
75 }
76
77 bundle.Name = BootstrapperApplicationData.GetAttribute(bundleNode, "DisplayName");
78
79 bundle.LogVariable = BootstrapperApplicationData.GetAttribute(bundleNode, "LogPathVariable");
80
81 bundle.Packages = PackageInfo.ParsePackagesFromXml(root);
82
83 return bundle;
84 }
85 }
86}
diff --git a/src/api/burn/WixToolset.Mba.Core/Engine.cs b/src/api/burn/WixToolset.Mba.Core/Engine.cs
new file mode 100644
index 00000000..aed420d5
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/Engine.cs
@@ -0,0 +1,541 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.ComponentModel;
7 using System.Runtime.InteropServices;
8 using System.Security;
9 using System.Text;
10
11 /// <summary>
12 /// Default implementation of <see cref="IEngine"/>.
13 /// </summary>
14 public sealed class Engine : IEngine
15 {
16 // Burn errs on empty strings, so declare initial buffer size.
17 private const int InitialBufferSize = 80;
18 private static readonly string normalizeVersionFormatString = "{0} must be less than or equal to " + UInt16.MaxValue;
19
20 private IBootstrapperEngine engine;
21
22 /// <summary>
23 /// Creates a new instance of the <see cref="Engine"/> container class.
24 /// </summary>
25 /// <param name="engine">The <see cref="IBootstrapperEngine"/> to contain.</param>
26 internal Engine(IBootstrapperEngine engine)
27 {
28 this.engine = engine;
29 }
30
31 /// <inheritdoc/>
32 public int PackageCount
33 {
34 get
35 {
36 int count;
37 this.engine.GetPackageCount(out count);
38
39 return count;
40 }
41 }
42
43 /// <inheritdoc/>
44 public void Apply(IntPtr hwndParent)
45 {
46 this.engine.Apply(hwndParent);
47 }
48
49 /// <inheritdoc/>
50 public void CloseSplashScreen()
51 {
52 this.engine.CloseSplashScreen();
53 }
54
55 /// <inheritdoc/>
56 public int CompareVersions(string version1, string version2)
57 {
58 this.engine.CompareVersions(version1, version2, out var result);
59 return result;
60 }
61
62 /// <inheritdoc/>
63 public bool ContainsVariable(string name)
64 {
65 IntPtr capacity = new IntPtr(0);
66 int ret = this.engine.GetVariableString(name, IntPtr.Zero, ref capacity);
67 return NativeMethods.E_NOTFOUND != ret;
68 }
69
70 /// <inheritdoc/>
71 public void Detect()
72 {
73 this.Detect(IntPtr.Zero);
74 }
75
76 /// <inheritdoc/>
77 public void Detect(IntPtr hwndParent)
78 {
79 this.engine.Detect(hwndParent);
80 }
81
82 /// <inheritdoc/>
83 public bool Elevate(IntPtr hwndParent)
84 {
85 int ret = this.engine.Elevate(hwndParent);
86
87 if (NativeMethods.S_OK == ret || NativeMethods.E_ALREADYINITIALIZED == ret)
88 {
89 return true;
90 }
91 else if (NativeMethods.E_CANCELLED == ret)
92 {
93 return false;
94 }
95 else
96 {
97 throw new Win32Exception(ret);
98 }
99 }
100
101 /// <inheritdoc/>
102 public string EscapeString(string input)
103 {
104 IntPtr capacity = new IntPtr(InitialBufferSize);
105 StringBuilder sb = new StringBuilder(capacity.ToInt32());
106
107 // Get the size of the buffer.
108 int ret = this.engine.EscapeString(input, sb, ref capacity);
109 if (NativeMethods.E_INSUFFICIENT_BUFFER == ret || NativeMethods.E_MOREDATA == ret)
110 {
111 capacity = new IntPtr(capacity.ToInt32() + 1); // Add one for the null terminator.
112 sb.Capacity = capacity.ToInt32();
113 ret = this.engine.EscapeString(input, sb, ref capacity);
114 }
115
116 if (NativeMethods.S_OK != ret)
117 {
118 throw new Win32Exception(ret);
119 }
120
121 return sb.ToString();
122 }
123
124 /// <inheritdoc/>
125 public bool EvaluateCondition(string condition)
126 {
127 bool value;
128 this.engine.EvaluateCondition(condition, out value);
129
130 return value;
131 }
132
133 /// <inheritdoc/>
134 public string FormatString(string format)
135 {
136 IntPtr capacity = new IntPtr(InitialBufferSize);
137 StringBuilder sb = new StringBuilder(capacity.ToInt32());
138
139 // Get the size of the buffer.
140 int ret = this.engine.FormatString(format, sb, ref capacity);
141 if (NativeMethods.E_INSUFFICIENT_BUFFER == ret || NativeMethods.E_MOREDATA == ret)
142 {
143 capacity = new IntPtr(capacity.ToInt32() + 1); // Add one for the null terminator.
144 sb.Capacity = capacity.ToInt32();
145 ret = this.engine.FormatString(format, sb, ref capacity);
146 }
147
148 if (NativeMethods.S_OK != ret)
149 {
150 throw new Win32Exception(ret);
151 }
152
153 return sb.ToString();
154 }
155
156 /// <inheritdoc/>
157 public long GetVariableNumeric(string name)
158 {
159 int ret = this.engine.GetVariableNumeric(name, out long value);
160 if (NativeMethods.S_OK != ret)
161 {
162 throw new Win32Exception(ret);
163 }
164
165 return value;
166 }
167
168 /// <inheritdoc/>
169 public SecureString GetVariableSecureString(string name)
170 {
171 var pUniString = this.getStringVariable(name, out var length);
172 try
173 {
174 return this.convertToSecureString(pUniString, length);
175 }
176 finally
177 {
178 if (IntPtr.Zero != pUniString)
179 {
180 Marshal.FreeCoTaskMem(pUniString);
181 }
182 }
183 }
184
185 /// <inheritdoc/>
186 public string GetVariableString(string name)
187 {
188 int length;
189 IntPtr pUniString = this.getStringVariable(name, out length);
190 try
191 {
192 return Marshal.PtrToStringUni(pUniString, length);
193 }
194 finally
195 {
196 if (IntPtr.Zero != pUniString)
197 {
198 Marshal.FreeCoTaskMem(pUniString);
199 }
200 }
201 }
202
203 /// <inheritdoc/>
204 public string GetVariableVersion(string name)
205 {
206 int length;
207 IntPtr pUniString = this.getVersionVariable(name, out length);
208 try
209 {
210 return Marshal.PtrToStringUni(pUniString, length);
211 }
212 finally
213 {
214 if (IntPtr.Zero != pUniString)
215 {
216 Marshal.FreeCoTaskMem(pUniString);
217 }
218 }
219 }
220
221 /// <inheritdoc/>
222 public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments)
223 {
224 this.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, 0);
225 }
226
227 /// <inheritdoc/>
228 public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout)
229 {
230 this.engine.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout);
231 }
232 /// <inheritdoc/>
233
234 public void Log(LogLevel level, string message)
235 {
236 this.engine.Log(level, message);
237 }
238
239 /// <inheritdoc/>
240 public void Plan(LaunchAction action)
241 {
242 this.engine.Plan(action);
243 }
244
245 /// <inheritdoc/>
246 public void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, byte[] hash)
247 {
248 this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash, null == hash ? 0 : hash.Length);
249 }
250
251 /// <inheritdoc/>
252 public void SetUpdateSource(string url)
253 {
254 this.engine.SetUpdateSource(url);
255 }
256
257 /// <inheritdoc/>
258 public void SetLocalSource(string packageOrContainerId, string payloadId, string path)
259 {
260 this.engine.SetLocalSource(packageOrContainerId, payloadId, path);
261 }
262
263 /// <inheritdoc/>
264 public void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password)
265 {
266 this.engine.SetDownloadSource(packageOrContainerId, payloadId, url, user, password);
267 }
268
269 /// <inheritdoc/>
270 public void SetVariableNumeric(string name, long value)
271 {
272 this.engine.SetVariableNumeric(name, value);
273 }
274
275 /// <inheritdoc/>
276 public void SetVariableString(string name, SecureString value, bool formatted)
277 {
278 IntPtr pValue = Marshal.SecureStringToCoTaskMemUnicode(value);
279 try
280 {
281 this.engine.SetVariableString(name, pValue, formatted);
282 }
283 finally
284 {
285 Marshal.FreeCoTaskMem(pValue);
286 }
287 }
288
289 /// <inheritdoc/>
290 public void SetVariableString(string name, string value, bool formatted)
291 {
292 IntPtr pValue = Marshal.StringToCoTaskMemUni(value);
293 try
294 {
295 this.engine.SetVariableString(name, pValue, formatted);
296 }
297 finally
298 {
299 Marshal.FreeCoTaskMem(pValue);
300 }
301 }
302
303 /// <inheritdoc/>
304 public void SetVariableVersion(string name, string value)
305 {
306 IntPtr pValue = Marshal.StringToCoTaskMemUni(value);
307 try
308 {
309 this.engine.SetVariableVersion(name, pValue);
310 }
311 finally
312 {
313 Marshal.FreeCoTaskMem(pValue);
314 }
315 }
316
317 /// <inheritdoc/>
318 public int SendEmbeddedError(int errorCode, string message, int uiHint)
319 {
320 int result = 0;
321 this.engine.SendEmbeddedError(errorCode, message, uiHint, out result);
322 return result;
323 }
324
325 /// <inheritdoc/>
326 public int SendEmbeddedProgress(int progressPercentage, int overallPercentage)
327 {
328 int result = 0;
329 this.engine.SendEmbeddedProgress(progressPercentage, overallPercentage, out result);
330 return result;
331 }
332
333 /// <inheritdoc/>
334 public void Quit(int exitCode)
335 {
336 this.engine.Quit(exitCode);
337 }
338
339 /// <summary>
340 /// Gets the variable given by <paramref name="name"/> as a string.
341 /// </summary>
342 /// <param name="name">The name of the variable to get.</param>
343 /// <param name="length">The length of the Unicode string.</param>
344 /// <returns>The value by a pointer to a Unicode string. Must be freed by Marshal.FreeCoTaskMem.</returns>
345 /// <exception cref="Exception">An error occurred getting the variable.</exception>
346 internal IntPtr getStringVariable(string name, out int length)
347 {
348 IntPtr capacity = new IntPtr(InitialBufferSize);
349 bool success = false;
350 IntPtr pValue = Marshal.AllocCoTaskMem(capacity.ToInt32() * UnicodeEncoding.CharSize);
351 try
352 {
353 // Get the size of the buffer.
354 int ret = this.engine.GetVariableString(name, pValue, ref capacity);
355 if (NativeMethods.E_INSUFFICIENT_BUFFER == ret || NativeMethods.E_MOREDATA == ret)
356 {
357 // Don't need to add 1 for the null terminator, the engine already includes that.
358 pValue = Marshal.ReAllocCoTaskMem(pValue, capacity.ToInt32() * UnicodeEncoding.CharSize);
359 ret = this.engine.GetVariableString(name, pValue, ref capacity);
360 }
361
362 if (NativeMethods.S_OK != ret)
363 {
364 throw Marshal.GetExceptionForHR(ret);
365 }
366
367 // The engine only returns the exact length of the string if the buffer was too small, so calculate it ourselves.
368 int maxLength = capacity.ToInt32();
369 for (length = 0; length < maxLength; ++length)
370 {
371 if (0 == Marshal.ReadInt16(pValue, length * UnicodeEncoding.CharSize))
372 {
373 break;
374 }
375 }
376
377 success = true;
378 return pValue;
379 }
380 finally
381 {
382 if (!success && IntPtr.Zero != pValue)
383 {
384 Marshal.FreeCoTaskMem(pValue);
385 }
386 }
387 }
388
389 /// <summary>
390 /// Gets the variable given by <paramref name="name"/> as a version string.
391 /// </summary>
392 /// <param name="name">The name of the variable to get.</param>
393 /// <param name="length">The length of the Unicode string.</param>
394 /// <returns>The value by a pointer to a Unicode string. Must be freed by Marshal.FreeCoTaskMem.</returns>
395 /// <exception cref="Exception">An error occurred getting the variable.</exception>
396 internal IntPtr getVersionVariable(string name, out int length)
397 {
398 IntPtr capacity = new IntPtr(InitialBufferSize);
399 bool success = false;
400 IntPtr pValue = Marshal.AllocCoTaskMem(capacity.ToInt32() * UnicodeEncoding.CharSize);
401 try
402 {
403 // Get the size of the buffer.
404 int ret = this.engine.GetVariableVersion(name, pValue, ref capacity);
405 if (NativeMethods.E_INSUFFICIENT_BUFFER == ret || NativeMethods.E_MOREDATA == ret)
406 {
407 // Don't need to add 1 for the null terminator, the engine already includes that.
408 pValue = Marshal.ReAllocCoTaskMem(pValue, capacity.ToInt32() * UnicodeEncoding.CharSize);
409 ret = this.engine.GetVariableVersion(name, pValue, ref capacity);
410 }
411
412 if (NativeMethods.S_OK != ret)
413 {
414 throw Marshal.GetExceptionForHR(ret);
415 }
416
417 // The engine only returns the exact length of the string if the buffer was too small, so calculate it ourselves.
418 int maxLength = capacity.ToInt32();
419 for (length = 0; length < maxLength; ++length)
420 {
421 if (0 == Marshal.ReadInt16(pValue, length * UnicodeEncoding.CharSize))
422 {
423 break;
424 }
425 }
426
427 success = true;
428 return pValue;
429 }
430 finally
431 {
432 if (!success && IntPtr.Zero != pValue)
433 {
434 Marshal.FreeCoTaskMem(pValue);
435 }
436 }
437 }
438
439 /// <summary>
440 /// Initialize a SecureString with the given Unicode string.
441 /// </summary>
442 /// <param name="pUniString">Pointer to Unicode string.</param>
443 /// <param name="length">The string's length.</param>
444 internal SecureString convertToSecureString(IntPtr pUniString, int length)
445 {
446 if (IntPtr.Zero == pUniString)
447 {
448 return null;
449 }
450
451 SecureString value = new SecureString();
452 short s;
453 char c;
454 for (int charIndex = 0; charIndex < length; charIndex++)
455 {
456 s = Marshal.ReadInt16(pUniString, charIndex * UnicodeEncoding.CharSize);
457 c = (char)s;
458 value.AppendChar(c);
459 s = 0;
460 c = (char)0;
461 }
462 return value;
463 }
464
465 /// <summary>
466 /// Utility method for converting a <see cref="Version"/> into a <see cref="long"/>.
467 /// </summary>
468 /// <param name="version"></param>
469 /// <returns></returns>
470 public static long VersionToLong(Version version)
471 {
472 // In Windows, each version component has a max value of 65535,
473 // so we truncate the version before shifting it, which will overflow if invalid.
474 long major = (long)(ushort)version.Major << 48;
475 long minor = (long)(ushort)version.Minor << 32;
476 long build = (long)(ushort)version.Build << 16;
477 long revision = (long)(ushort)version.Revision;
478
479 return major | minor | build | revision;
480 }
481
482 /// <summary>
483 /// Utility method for converting a <see cref="long"/> into a <see cref="Version"/>.
484 /// </summary>
485 /// <param name="version"></param>
486 /// <returns></returns>
487 public static Version LongToVersion(long version)
488 {
489 int major = (int)((version & ((long)0xffff << 48)) >> 48);
490 int minor = (int)((version & ((long)0xffff << 32)) >> 32);
491 int build = (int)((version & ((long)0xffff << 16)) >> 16);
492 int revision = (int)(version & 0xffff);
493
494 return new Version(major, minor, build, revision);
495 }
496
497 /// <summary>
498 /// Verifies that Version can be represented in a <see cref="long"/>.
499 /// If the Build or Revision fields are undefined, they are set to zero.
500 /// </summary>
501 public static Version NormalizeVersion(Version version)
502 {
503 if (version == null)
504 {
505 throw new ArgumentNullException("version");
506 }
507
508 int major = version.Major;
509 int minor = version.Minor;
510 int build = version.Build;
511 int revision = version.Revision;
512
513 if (major > UInt16.MaxValue)
514 {
515 throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Major"));
516 }
517 if (minor > UInt16.MaxValue)
518 {
519 throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Minor"));
520 }
521 if (build > UInt16.MaxValue)
522 {
523 throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Build"));
524 }
525 if (build == -1)
526 {
527 build = 0;
528 }
529 if (revision > UInt16.MaxValue)
530 {
531 throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Revision"));
532 }
533 if (revision == -1)
534 {
535 revision = 0;
536 }
537
538 return new Version(major, minor, build, revision);
539 }
540 }
541}
diff --git a/src/api/burn/WixToolset.Mba.Core/EventArgs.cs b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs
new file mode 100644
index 00000000..8ef8af14
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/EventArgs.cs
@@ -0,0 +1,2186 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Collections.ObjectModel;
8
9 /// <summary>
10 /// Base class for BA <see cref="EventArgs"/> classes.
11 /// </summary>
12 [Serializable]
13 public abstract class HResultEventArgs : EventArgs
14 {
15 /// <summary>
16 /// Creates a new instance of the <see cref="HResultEventArgs"/> class.
17 /// </summary>
18 public HResultEventArgs()
19 {
20 }
21
22 /// <summary>
23 /// Gets or sets the <see cref="HResult"/> of the operation. This is passed back to the engine.
24 /// </summary>
25 public int HResult { get; set; }
26 }
27
28 /// <summary>
29 /// Base class for cancellable BA <see cref="EventArgs"/> classes.
30 /// </summary>
31 [Serializable]
32 public abstract class CancellableHResultEventArgs : HResultEventArgs
33 {
34 /// <summary>
35 /// Creates a new instance of the <see cref="CancellableHResultEventArgs"/> class.
36 /// </summary>
37 public CancellableHResultEventArgs(bool cancelRecommendation)
38 {
39 this.Cancel = cancelRecommendation;
40 }
41
42 /// <summary>
43 /// Gets or sets whether to cancel the operation. This is passed back to the engine.
44 /// </summary>
45 public bool Cancel { get; set; }
46 }
47
48 /// <summary>
49 /// Base class for <see cref="EventArgs"/> classes that must return a <see cref="Result"/>.
50 /// </summary>
51 [Serializable]
52 public abstract class ResultEventArgs : HResultEventArgs
53 {
54 /// <summary />
55 public ResultEventArgs(Result recommendation, Result result)
56 {
57 this.Recommendation = recommendation;
58 this.Result = result;
59 }
60
61 /// <summary>
62 /// Gets the recommended <see cref="Result"/> of the operation.
63 /// </summary>
64 public Result Recommendation { get; private set; }
65
66 /// <summary>
67 /// Gets or sets the <see cref="Result"/> of the operation. This is passed back to the engine.
68 /// </summary>
69 public Result Result { get; set; }
70 }
71
72 /// <summary>
73 /// Base class for <see cref="EventArgs"/> classes that receive status from the engine.
74 /// </summary>
75 [Serializable]
76 public abstract class StatusEventArgs : HResultEventArgs
77 {
78 /// <summary>
79 /// Creates a new instance of the <see cref="StatusEventArgs"/> class.
80 /// </summary>
81 /// <param name="hrStatus">The return code of the operation.</param>
82 public StatusEventArgs(int hrStatus)
83 {
84 this.Status = hrStatus;
85 }
86
87 /// <summary>
88 /// Gets the return code of the operation.
89 /// </summary>
90 public int Status { get; private set; }
91 }
92
93 /// <summary>
94 /// Base class for <see cref="EventArgs"/> classes that receive status from the engine and return an action.
95 /// </summary>
96 public abstract class ActionEventArgs<T> : StatusEventArgs
97 {
98 /// <summary />
99 public ActionEventArgs(int hrStatus, T recommendation, T action)
100 : base(hrStatus)
101 {
102 this.Recommendation = recommendation;
103 this.Action = action;
104 }
105
106 /// <summary>
107 /// Gets the recommended action from the engine.
108 /// </summary>
109 public T Recommendation { get; private set; }
110
111 /// <summary>
112 /// Gets or sets the action to be performed. This is passed back to the engine.
113 /// </summary>
114 public T Action { get; set; }
115 }
116
117 /// <summary>
118 /// Base class for cancellable action BA <see cref="EventArgs"/> classes.
119 /// </summary>
120 [Serializable]
121 public abstract class CancellableActionEventArgs<T> : CancellableHResultEventArgs
122 {
123 /// <summary />
124 public CancellableActionEventArgs(bool cancelRecommendation, T recommendation, T action)
125 : base(cancelRecommendation)
126 {
127 this.Recommendation = recommendation;
128 this.Action = action;
129 }
130
131 /// <summary>
132 /// Gets the recommended action from the engine.
133 /// </summary>
134 public T Recommendation { get; private set; }
135
136 /// <summary>
137 /// Gets or sets the action to be performed. This is passed back to the engine.
138 /// </summary>
139 public T Action { get; set; }
140 }
141
142 /// <summary>
143 /// Base class for cache progress events.
144 /// </summary>
145 [Serializable]
146 public abstract class CacheProgressBaseEventArgs : CancellableHResultEventArgs
147 {
148 /// <summary />
149 public CacheProgressBaseEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
150 : base(cancelRecommendation)
151 {
152 this.PackageOrContainerId = packageOrContainerId;
153 this.PayloadId = payloadId;
154 this.Progress = progress;
155 this.Total = total;
156 this.OverallPercentage = overallPercentage;
157 }
158
159 /// <summary>
160 /// Gets the identifier of the container or package.
161 /// </summary>
162 public string PackageOrContainerId { get; private set; }
163
164 /// <summary>
165 /// Gets the identifier of the payload.
166 /// </summary>
167 public string PayloadId { get; private set; }
168
169 /// <summary>
170 /// Gets the number of bytes cached thus far.
171 /// </summary>
172 public long Progress { get; private set; }
173
174 /// <summary>
175 /// Gets the total bytes to cache.
176 /// </summary>
177 public long Total { get; private set; }
178
179 /// <summary>
180 /// Gets the overall percentage of progress of caching.
181 /// </summary>
182 public int OverallPercentage { get; private set; }
183 }
184
185 /// <summary>
186 /// Additional arguments used when startup has begun.
187 /// </summary>
188 [Serializable]
189 public class StartupEventArgs : HResultEventArgs
190 {
191 /// <summary>
192 /// Creates a new instance of the <see cref="StartupEventArgs"/> class.
193 /// </summary>
194 public StartupEventArgs()
195 {
196 }
197 }
198
199 /// <summary>
200 /// Additional arguments used when shutdown has begun.
201 /// </summary>
202 [Serializable]
203 public class ShutdownEventArgs : HResultEventArgs
204 {
205 /// <summary>
206 /// Creates a new instance of the <see cref="ShutdownEventArgs"/> class.
207 /// </summary>
208 public ShutdownEventArgs(BOOTSTRAPPER_SHUTDOWN_ACTION action)
209 {
210 this.Action = action;
211 }
212
213 /// <summary>
214 /// The action for OnShutdown.
215 /// </summary>
216 public BOOTSTRAPPER_SHUTDOWN_ACTION Action { get; set; }
217 }
218
219 /// <summary>
220 /// Event arguments for <see cref="IDefaultBootstrapperApplication.SystemShutdown"/>
221 /// </summary>
222 [Serializable]
223 public class SystemShutdownEventArgs : CancellableHResultEventArgs
224 {
225 /// <summary />
226 public SystemShutdownEventArgs(EndSessionReasons reasons, bool cancelRecommendation)
227 : base(cancelRecommendation)
228 {
229 this.Reasons = reasons;
230 }
231
232 /// <summary>
233 /// Gets the reason the application is requested to close or being closed.
234 /// </summary>
235 /// <remarks>
236 /// <para>To prevent shutting down or logging off, set <see cref="CancellableHResultEventArgs.Cancel"/> to
237 /// true; otherwise, set it to false.</para>
238 /// <para>If <see cref="SystemShutdownEventArgs.Reasons"/> contains <see cref="EndSessionReasons.Critical"/>
239 /// the bootstrapper cannot prevent the shutdown and only has a few seconds to save state or perform any other
240 /// critical operations before being closed by the operating system.</para>
241 /// </remarks>
242 public EndSessionReasons Reasons { get; private set; }
243 }
244
245 /// <summary>
246 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectBegin"/>
247 /// </summary>
248 [Serializable]
249 public class DetectBeginEventArgs : CancellableHResultEventArgs
250 {
251 /// <summary />
252 public DetectBeginEventArgs(bool cached, bool installed, int packageCount, bool cancelRecommendation)
253 : base(cancelRecommendation)
254 {
255 this.Cached = cached;
256 this.Installed = installed;
257 this.PackageCount = packageCount;
258 }
259
260 /// <summary>
261 /// Gets whether the bundle is cached.
262 /// </summary>
263 public bool Cached { get; private set; }
264
265 /// <summary>
266 /// Gets whether the bundle is installed.
267 /// </summary>
268 public bool Installed { get; private set; }
269
270 /// <summary>
271 /// Gets the number of packages to detect.
272 /// </summary>
273 public int PackageCount { get; private set; }
274 }
275
276 /// <summary>
277 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectForwardCompatibleBundle"/>
278 /// </summary>
279 [Serializable]
280 public class DetectForwardCompatibleBundleEventArgs : CancellableHResultEventArgs
281 {
282 /// <summary />
283 public DetectForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, string version, bool missingFromCache, bool cancelRecommendation)
284 : base(cancelRecommendation)
285 {
286 this.BundleId = bundleId;
287 this.RelationType = relationType;
288 this.BundleTag = bundleTag;
289 this.PerMachine = perMachine;
290 this.Version = version;
291 this.MissingFromCache = missingFromCache;
292 }
293
294 /// <summary>
295 /// Gets the identity of the forward compatible bundle detected.
296 /// </summary>
297 public string BundleId { get; private set; }
298
299 /// <summary>
300 /// Gets the relationship type of the forward compatible bundle.
301 /// </summary>
302 public RelationType RelationType { get; private set; }
303
304 /// <summary>
305 /// Gets the tag of the forward compatible bundle.
306 /// </summary>
307 public string BundleTag { get; private set; }
308
309 /// <summary>
310 /// Gets whether the detected forward compatible bundle is per machine.
311 /// </summary>
312 public bool PerMachine { get; private set; }
313
314 /// <summary>
315 /// Gets the version of the forward compatible bundle detected.
316 /// </summary>
317 public string Version { get; private set; }
318
319 /// <summary>
320 /// Whether the forward compatible bundle is missing from the package cache.
321 /// </summary>
322 public bool MissingFromCache { get; set; }
323 }
324
325 /// <summary>
326 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdateBegin"/>
327 /// </summary>
328 [Serializable]
329 public class DetectUpdateBeginEventArgs : CancellableHResultEventArgs
330 {
331 /// <summary />
332 public DetectUpdateBeginEventArgs(string updateLocation, bool cancelRecommendation, bool skipRecommendation)
333 : base(cancelRecommendation)
334 {
335 this.UpdateLocation = updateLocation;
336 this.Skip = skipRecommendation;
337 }
338
339 /// <summary>
340 /// Gets the identity of the bundle to detect.
341 /// </summary>
342 public string UpdateLocation { get; private set; }
343
344 /// <summary>
345 /// Whether to skip checking for bundle updates.
346 /// </summary>
347 public bool Skip { get; set; }
348 }
349
350 /// <summary>
351 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdate"/>
352 /// </summary>
353 [Serializable]
354 public class DetectUpdateEventArgs : CancellableHResultEventArgs
355 {
356 /// <summary />
357 public DetectUpdateEventArgs(string updateLocation, long size, string version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation)
358 : base(cancelRecommendation)
359 {
360 this.UpdateLocation = updateLocation;
361 this.Size = size;
362 this.Version = version;
363 this.Title = title;
364 this.Summary = summary;
365 this.ContentType = contentType;
366 this.Content = content;
367 this.StopProcessingUpdates = stopRecommendation;
368 }
369
370 /// <summary>
371 /// Gets the identity of the bundle to detect.
372 /// </summary>
373 public string UpdateLocation { get; private set; }
374
375 /// <summary>
376 /// Gets the size of the updated bundle.
377 /// </summary>
378 public long Size { get; private set; }
379
380 /// <summary>
381 /// Gets the version of the updated bundle.
382 /// </summary>
383 public string Version { get; private set; }
384
385 /// <summary>
386 /// Gets the title of the the updated bundle.
387 /// </summary>
388 public string Title { get; private set; }
389
390 /// <summary>
391 /// Gets the summary of the updated bundle.
392 /// </summary>
393 public string Summary { get; private set; }
394
395 /// <summary>
396 /// Gets the content type of the content of the updated bundle.
397 /// </summary>
398 public string ContentType { get; private set; }
399
400 /// <summary>
401 /// Gets the content of the updated bundle.
402 /// </summary>
403 public string Content { get; private set; }
404
405 /// <summary>
406 /// Tells the engine to stop giving the rest of the updates found in the feed.
407 /// </summary>
408 public bool StopProcessingUpdates { get; set; }
409 }
410
411 /// <summary>
412 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdateComplete"/>
413 /// </summary>
414 [Serializable]
415 public class DetectUpdateCompleteEventArgs : StatusEventArgs
416 {
417 /// <summary />
418 public DetectUpdateCompleteEventArgs(int hrStatus, bool ignoreRecommendation)
419 : base(hrStatus)
420 {
421 this.IgnoreError = ignoreRecommendation;
422 }
423
424 /// <summary>
425 /// If Status is an error, then set this to true to ignore it and continue detecting.
426 /// </summary>
427 public bool IgnoreError { get; set; }
428 }
429
430 /// <summary>
431 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectRelatedBundle"/>
432 /// </summary>
433 [Serializable]
434 public class DetectRelatedBundleEventArgs : CancellableHResultEventArgs
435 {
436 /// <summary />
437 public DetectRelatedBundleEventArgs(string productCode, RelationType relationType, string bundleTag, bool perMachine, string version, RelatedOperation operation, bool missingFromCache, bool cancelRecommendation)
438 : base(cancelRecommendation)
439 {
440 this.ProductCode = productCode;
441 this.RelationType = relationType;
442 this.BundleTag = bundleTag;
443 this.PerMachine = perMachine;
444 this.Version = version;
445 this.Operation = operation;
446 this.MissingFromCache = missingFromCache;
447 }
448
449 /// <summary>
450 /// Gets the identity of the related bundle detected.
451 /// </summary>
452 public string ProductCode { get; private set; }
453
454 /// <summary>
455 /// Gets the relationship type of the related bundle.
456 /// </summary>
457 public RelationType RelationType { get; private set; }
458
459 /// <summary>
460 /// Gets the tag of the related package bundle.
461 /// </summary>
462 public string BundleTag { get; private set; }
463
464 /// <summary>
465 /// Gets whether the detected bundle is per machine.
466 /// </summary>
467 public bool PerMachine { get; private set; }
468
469 /// <summary>
470 /// Gets the version of the related bundle detected.
471 /// </summary>
472 public string Version { get; private set; }
473
474 /// <summary>
475 /// Gets the operation that will be taken on the detected bundle.
476 /// </summary>
477 public RelatedOperation Operation { get; private set; }
478
479 /// <summary>
480 /// Whether the related bundle is missing from the package cache.
481 /// </summary>
482 public bool MissingFromCache { get; set; }
483 }
484
485 /// <summary>
486 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectPackageBegin"/>
487 /// </summary>
488 [Serializable]
489 public class DetectPackageBeginEventArgs : CancellableHResultEventArgs
490 {
491 /// <summary />
492 public DetectPackageBeginEventArgs(string packageId, bool cancelRecommendation)
493 : base(cancelRecommendation)
494 {
495 this.PackageId = packageId;
496 }
497
498 /// <summary>
499 /// Gets the identity of the package to detect.
500 /// </summary>
501 public string PackageId { get; private set; }
502 }
503
504 /// <summary>
505 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectRelatedMsiPackage"/>
506 /// </summary>
507 [Serializable]
508 public class DetectRelatedMsiPackageEventArgs : CancellableHResultEventArgs
509 {
510 /// <summary />
511 public DetectRelatedMsiPackageEventArgs(string packageId, string upgradeCode, string productCode, bool perMachine, string version, RelatedOperation operation, bool cancelRecommendation)
512 : base(cancelRecommendation)
513 {
514 this.PackageId = packageId;
515 this.UpgradeCode = upgradeCode;
516 this.ProductCode = productCode;
517 this.PerMachine = perMachine;
518 this.Version = version;
519 this.Operation = operation;
520 }
521
522 /// <summary>
523 /// Gets the identity of the product's package detected.
524 /// </summary>
525 public string PackageId { get; private set; }
526
527 /// <summary>
528 /// Gets the upgrade code of the related package detected.
529 /// </summary>
530 public string UpgradeCode { get; private set; }
531
532 /// <summary>
533 /// Gets the identity of the related package detected.
534 /// </summary>
535 public string ProductCode { get; private set; }
536
537 /// <summary>
538 /// Gets whether the detected package is per machine.
539 /// </summary>
540 public bool PerMachine { get; private set; }
541
542 /// <summary>
543 /// Gets the version of the related package detected.
544 /// </summary>
545 public string Version { get; private set; }
546
547 /// <summary>
548 /// Gets the operation that will be taken on the detected package.
549 /// </summary>
550 public RelatedOperation Operation { get; private set; }
551 }
552
553 /// <summary>
554 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectPatchTarget"/>
555 /// </summary>
556 public class DetectPatchTargetEventArgs : CancellableHResultEventArgs
557 {
558 /// <summary>
559 ///
560 /// </summary>
561 /// <param name="packageId"></param>
562 /// <param name="productCode"></param>
563 /// <param name="state"></param>
564 /// <param name="cancelRecommendation"></param>
565 public DetectPatchTargetEventArgs(string packageId, string productCode, PackageState state, bool cancelRecommendation)
566 : base(cancelRecommendation)
567 {
568 this.PackageId = packageId;
569 this.ProductCode = productCode;
570 this.State = state;
571 }
572
573 /// <summary>
574 /// Gets the identity of the patch's package.
575 /// </summary>
576 public string PackageId { get; private set; }
577
578 /// <summary>
579 /// Gets the product code of the target.
580 /// </summary>
581 public string ProductCode { get; private set; }
582
583 /// <summary>
584 /// Gets the detected patch state for the target.
585 /// </summary>
586 public PackageState State { get; private set; }
587 }
588
589 /// <summary>
590 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectMsiFeature"/>
591 /// </summary>
592 public class DetectMsiFeatureEventArgs : CancellableHResultEventArgs
593 {
594 /// <summary />
595 public DetectMsiFeatureEventArgs(string packageId, string featureId, FeatureState state, bool cancelRecommendation)
596 : base(cancelRecommendation)
597 {
598 this.PackageId = packageId;
599 this.FeatureId = featureId;
600 this.State = state;
601 }
602
603 /// <summary>
604 /// Gets the identity of the feature's package detected.
605 /// </summary>
606 public string PackageId { get; private set; }
607
608 /// <summary>
609 /// Gets the identity of the feature detected.
610 /// </summary>
611 public string FeatureId { get; private set; }
612
613 /// <summary>
614 /// Gets the detected feature state.
615 /// </summary>
616 public FeatureState State { get; private set; }
617 }
618
619 /// <summary>
620 /// Additional arguments for <see cref="IDefaultBootstrapperApplication.DetectPackageComplete"/>.
621 /// </summary>
622 [Serializable]
623 public class DetectPackageCompleteEventArgs : StatusEventArgs
624 {
625 /// <summary />
626 public DetectPackageCompleteEventArgs(string packageId, int hrStatus, PackageState state, bool cached)
627 : base(hrStatus)
628 {
629 this.PackageId = packageId;
630 this.State = state;
631 this.Cached = cached;
632 }
633
634 /// <summary>
635 /// Gets the identity of the package detected.
636 /// </summary>
637 public string PackageId { get; private set; }
638
639 /// <summary>
640 /// Gets the state of the specified package.
641 /// </summary>
642 public PackageState State { get; private set; }
643
644 /// <summary>
645 /// Gets whether any part of the package is cached.
646 /// </summary>
647 public bool Cached { get; private set; }
648 }
649
650 /// <summary>
651 /// Additional arguments used when the detection phase has completed.
652 /// </summary>
653 [Serializable]
654 public class DetectCompleteEventArgs : StatusEventArgs
655 {
656 /// <summary>
657 /// Creates a new instance of the <see cref="DetectCompleteEventArgs"/> class.
658 /// </summary>
659 /// <param name="hrStatus">The return code of the operation.</param>
660 /// <param name="eligibleForCleanup"></param>
661 public DetectCompleteEventArgs(int hrStatus, bool eligibleForCleanup)
662 : base(hrStatus)
663 {
664 this.EligibleForCleanup = eligibleForCleanup;
665 }
666
667 /// <summary>
668 /// Indicates whether the engine will uninstall the bundle if shutdown without running Apply.
669 /// </summary>
670 public bool EligibleForCleanup { get; private set; }
671 }
672
673 /// <summary>
674 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanBegin"/>
675 /// </summary>
676 [Serializable]
677 public class PlanBeginEventArgs : CancellableHResultEventArgs
678 {
679 /// <summary />
680 public PlanBeginEventArgs(int packageCount, bool cancelRecommendation)
681 : base(cancelRecommendation)
682 {
683 this.PackageCount = packageCount;
684 }
685
686 /// <summary>
687 /// Gets the number of packages to plan for.
688 /// </summary>
689 public int PackageCount { get; private set; }
690 }
691
692 /// <summary>
693 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRelatedBundle"/>
694 /// </summary>
695 [Serializable]
696 public class PlanRelatedBundleEventArgs : CancellableHResultEventArgs
697 {
698 /// <summary />
699 public PlanRelatedBundleEventArgs(string bundleId, RequestState recommendedState, RequestState state, bool cancelRecommendation)
700 : base(cancelRecommendation)
701 {
702 this.BundleId = bundleId;
703 this.RecommendedState = recommendedState;
704 this.State = state;
705 }
706
707 /// <summary>
708 /// Gets the identity of the bundle to plan for.
709 /// </summary>
710 public string BundleId { get; private set; }
711
712 /// <summary>
713 /// Gets the recommended requested state for the bundle.
714 /// </summary>
715 public RequestState RecommendedState { get; private set; }
716
717 /// <summary>
718 /// Gets or sets the requested state for the bundle.
719 /// </summary>
720 public RequestState State { get; set; }
721 }
722
723 /// <summary>
724 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPackageBegin"/>
725 /// </summary>
726 [Serializable]
727 public class PlanPackageBeginEventArgs : CancellableHResultEventArgs
728 {
729 /// <summary />
730 public PlanPackageBeginEventArgs(string packageId, PackageState currentState, bool cached, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, RequestState recommendedState, BOOTSTRAPPER_CACHE_TYPE recommendedCacheType, RequestState state, BOOTSTRAPPER_CACHE_TYPE cacheType, bool cancelRecommendation)
731 : base(cancelRecommendation)
732 {
733 this.PackageId = packageId;
734 this.CurrentState = currentState;
735 this.Cached = cached;
736 this.InstallCondition = installCondition;
737 this.RecommendedState = recommendedState;
738 this.RecommendedCacheType = recommendedCacheType;
739 this.State = state;
740 this.CacheType = cacheType;
741 }
742
743 /// <summary>
744 /// Gets the identity of the package to plan for.
745 /// </summary>
746 public string PackageId { get; private set; }
747
748 /// <summary>
749 /// Gets the current state of the package.
750 /// </summary>
751 public PackageState CurrentState { get; private set; }
752
753 /// <summary>
754 /// Gets whether any part of the package is cached.
755 /// </summary>
756 public bool Cached { get; private set; }
757
758 /// <summary>
759 /// Gets the evaluated result of the package's install condition.
760 /// </summary>
761 public BOOTSTRAPPER_PACKAGE_CONDITION_RESULT InstallCondition { get; private set; }
762
763 /// <summary>
764 /// Gets the recommended requested state for the package.
765 /// </summary>
766 public RequestState RecommendedState { get; private set; }
767
768 /// <summary>
769 /// The authored cache type of the package.
770 /// </summary>
771 public BOOTSTRAPPER_CACHE_TYPE RecommendedCacheType { get; private set; }
772
773 /// <summary>
774 /// Gets or sets the requested state for the package.
775 /// </summary>
776 public RequestState State { get; set; }
777
778 /// <summary>
779 /// Gets or sets the requested cache type for the package.
780 /// </summary>
781 public BOOTSTRAPPER_CACHE_TYPE CacheType { get; set; }
782 }
783
784 /// <summary>
785 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPatchTarget"/>
786 /// </summary>
787 [Serializable]
788 public class PlanPatchTargetEventArgs : CancellableHResultEventArgs
789 {
790 /// <summary>
791 ///
792 /// </summary>
793 /// <param name="packageId"></param>
794 /// <param name="productCode"></param>
795 /// <param name="recommendedState"></param>
796 /// <param name="state"></param>
797 /// <param name="cancelRecommendation"></param>
798 public PlanPatchTargetEventArgs(string packageId, string productCode, RequestState recommendedState, RequestState state, bool cancelRecommendation)
799 : base(cancelRecommendation)
800 {
801 this.PackageId = packageId;
802 this.ProductCode = productCode;
803 this.RecommendedState = recommendedState;
804 this.State = state;
805 }
806
807 /// <summary>
808 /// Gets the identity of the patch's package.
809 /// </summary>
810 public string PackageId { get; private set; }
811
812 /// <summary>
813 /// Gets the product code of the target.
814 /// </summary>
815 public string ProductCode { get; private set; }
816
817 /// <summary>
818 /// Gets the recommended state of the patch to use by planning for the target.
819 /// </summary>
820 public RequestState RecommendedState { get; private set; }
821
822 /// <summary>
823 /// Gets or sets the state of the patch to use by planning for the target.
824 /// </summary>
825 public RequestState State { get; set; }
826 }
827
828 /// <summary>
829 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanMsiFeature"/>
830 /// </summary>
831 [Serializable]
832 public class PlanMsiFeatureEventArgs : CancellableHResultEventArgs
833 {
834 /// <summary />
835 public PlanMsiFeatureEventArgs(string packageId, string featureId, FeatureState recommendedState, FeatureState state, bool cancelRecommendation)
836 : base(cancelRecommendation)
837 {
838 this.PackageId = packageId;
839 this.FeatureId = featureId;
840 this.RecommendedState = recommendedState;
841 this.State = state;
842 }
843
844 /// <summary>
845 /// Gets the identity of the feature's package to plan.
846 /// </summary>
847 public string PackageId { get; private set; }
848
849 /// <summary>
850 /// Gets the identity of the feature to plan.
851 /// </summary>
852 public string FeatureId { get; private set; }
853
854 /// <summary>
855 /// Gets the recommended feature state to use by planning.
856 /// </summary>
857 public FeatureState RecommendedState { get; private set; }
858
859 /// <summary>
860 /// Gets or sets the feature state to use by planning.
861 /// </summary>
862 public FeatureState State { get; set; }
863 }
864
865 /// <summary>
866 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanMsiPackage"/>
867 /// </summary>
868 [Serializable]
869 public class PlanMsiPackageEventArgs : CancellableHResultEventArgs
870 {
871 /// <summary />
872 public PlanMsiPackageEventArgs(string packageId, bool shouldExecute, ActionState action, bool cancelRecommendation, BURN_MSI_PROPERTY actionMsiProperty, INSTALLUILEVEL uiLevel, bool disableExternalUiHandler)
873 : base(cancelRecommendation)
874 {
875 this.PackageId = packageId;
876 this.ShouldExecute = shouldExecute;
877 this.Action = action;
878 this.ActionMsiProperty = actionMsiProperty;
879 this.UiLevel = uiLevel;
880 this.DisableExternalUiHandler = disableExternalUiHandler;
881 }
882
883 /// <summary>
884 /// Gets identity of the package planned for.
885 /// </summary>
886 public string PackageId { get; private set; }
887
888 /// <summary>
889 /// Gets whether the package is planned to execute or roll back.
890 /// </summary>
891 public bool ShouldExecute { get; private set; }
892
893 /// <summary>
894 /// Gets the action planned for the package.
895 /// </summary>
896 public ActionState Action { get; private set; }
897
898 /// <summary>
899 /// Gets or sets the requested MSI property to add.
900 /// </summary>
901 public BURN_MSI_PROPERTY ActionMsiProperty { get; set; }
902
903 /// <summary>
904 /// Gets or sets the requested internal UI level.
905 /// </summary>
906 public INSTALLUILEVEL UiLevel { get; set; }
907
908 /// <summary>
909 /// Gets or sets whether Burn is requested to set up an external UI handler.
910 /// </summary>
911 public bool DisableExternalUiHandler { get; set; }
912 }
913
914 /// <summary>
915 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPackageComplete"/>
916 /// </summary>
917 [Serializable]
918 public class PlanPackageCompleteEventArgs : StatusEventArgs
919 {
920 /// <summary>
921 ///
922 /// </summary>
923 /// <param name="packageId"></param>
924 /// <param name="hrStatus"></param>
925 /// <param name="requested"></param>
926 public PlanPackageCompleteEventArgs(string packageId, int hrStatus, RequestState requested)
927 : base(hrStatus)
928 {
929 this.PackageId = packageId;
930 this.Requested = requested;
931 }
932
933 /// <summary>
934 /// Gets the identity of the package planned for.
935 /// </summary>
936 public string PackageId { get; private set; }
937
938 /// <summary>
939 /// Gets the requested state for the package.
940 /// </summary>
941 public RequestState Requested { get; private set; }
942 }
943
944 /// <summary>
945 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlannedPackage"/>
946 /// </summary>
947 [Serializable]
948 public class PlannedPackageEventArgs : HResultEventArgs
949 {
950 /// <summary />
951 public PlannedPackageEventArgs(string packageId, ActionState execute, ActionState rollback, bool cache, bool uncache)
952 {
953 this.PackageId = packageId;
954 this.Execute = execute;
955 this.Rollback = rollback;
956 this.Cache = cache;
957 this.Uncache = uncache;
958 }
959
960 /// <summary>
961 /// Gets the identity of the package planned for.
962 /// </summary>
963 public string PackageId { get; private set; }
964
965 /// <summary>
966 /// Gets the planned execution action.
967 /// </summary>
968 public ActionState Execute { get; private set; }
969
970 /// <summary>
971 /// Gets the planned rollback action.
972 /// </summary>
973 public ActionState Rollback { get; private set; }
974
975 /// <summary>
976 /// Gets whether the package will be cached.
977 /// </summary>
978 public bool Cache { get; private set; }
979
980 /// <summary>
981 /// Gets whether the package will be removed from the package cache.
982 /// </summary>
983 public bool Uncache { get; private set; }
984 }
985
986 /// <summary>
987 /// Additional arguments used when the engine has completed planning the installation.
988 /// </summary>
989 [Serializable]
990 public class PlanCompleteEventArgs : StatusEventArgs
991 {
992 /// <summary>
993 /// Creates a new instance of the <see cref="PlanCompleteEventArgs"/> class.
994 /// </summary>
995 /// <param name="hrStatus">The return code of the operation.</param>
996 public PlanCompleteEventArgs(int hrStatus)
997 : base(hrStatus)
998 {
999 }
1000 }
1001
1002 /// <summary>
1003 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanForwardCompatibleBundle"/>
1004 /// </summary>
1005 [Serializable]
1006 public class PlanForwardCompatibleBundleEventArgs : CancellableHResultEventArgs
1007 {
1008 /// <summary />
1009 public PlanForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, string version, bool recommendedIgnoreBundle, bool cancelRecommendation, bool ignoreBundle)
1010 : base(cancelRecommendation)
1011 {
1012 this.BundleId = bundleId;
1013 this.RelationType = relationType;
1014 this.BundleTag = bundleTag;
1015 this.PerMachine = perMachine;
1016 this.Version = version;
1017 this.RecommendedIgnoreBundle = recommendedIgnoreBundle;
1018 this.IgnoreBundle = ignoreBundle;
1019 }
1020
1021 /// <summary>
1022 /// Gets the identity of the forward compatible bundle detected.
1023 /// </summary>
1024 public string BundleId { get; private set; }
1025
1026 /// <summary>
1027 /// Gets the relationship type of the forward compatible bundle.
1028 /// </summary>
1029 public RelationType RelationType { get; private set; }
1030
1031 /// <summary>
1032 /// Gets the tag of the forward compatible bundle.
1033 /// </summary>
1034 public string BundleTag { get; private set; }
1035
1036 /// <summary>
1037 /// Gets whether the forward compatible bundle is per machine.
1038 /// </summary>
1039 public bool PerMachine { get; private set; }
1040
1041 /// <summary>
1042 /// Gets the version of the forward compatible bundle.
1043 /// </summary>
1044 public string Version { get; private set; }
1045
1046 /// <summary>
1047 /// Gets the recommendation of whether the engine should use the forward compatible bundle.
1048 /// </summary>
1049 public bool RecommendedIgnoreBundle { get; set; }
1050
1051 /// <summary>
1052 /// Gets or sets whether the engine will use the forward compatible bundle.
1053 /// </summary>
1054 public bool IgnoreBundle { get; set; }
1055 }
1056
1057 /// <summary>
1058 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyBegin"/>
1059 /// </summary>
1060 [Serializable]
1061 public class ApplyBeginEventArgs : CancellableHResultEventArgs
1062 {
1063 /// <summary />
1064 public ApplyBeginEventArgs(int phaseCount, bool cancelRecommendation)
1065 : base(cancelRecommendation)
1066 {
1067 this.PhaseCount = phaseCount;
1068 }
1069
1070 /// <summary>
1071 /// Gets the number of phases that the engine will go through in apply.
1072 /// There are currently two possible phases: cache and execute.
1073 /// </summary>
1074 public int PhaseCount { get; private set; }
1075 }
1076
1077 /// <summary>
1078 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ElevateBegin"/>
1079 /// </summary>
1080 [Serializable]
1081 public class ElevateBeginEventArgs : CancellableHResultEventArgs
1082 {
1083 /// <summary />
1084 public ElevateBeginEventArgs(bool cancelRecommendation)
1085 : base(cancelRecommendation)
1086 {
1087 }
1088 }
1089
1090 /// <summary>
1091 /// Additional arguments used when the engine has completed starting the elevated process.
1092 /// </summary>
1093 [Serializable]
1094 public class ElevateCompleteEventArgs : StatusEventArgs
1095 {
1096 /// <summary>
1097 /// Creates a new instance of the <see cref="ElevateCompleteEventArgs"/> class.
1098 /// </summary>
1099 /// <param name="hrStatus">The return code of the operation.</param>
1100 public ElevateCompleteEventArgs(int hrStatus)
1101 : base(hrStatus)
1102 {
1103 }
1104 }
1105
1106 /// <summary>
1107 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Progress"/>
1108 /// </summary>
1109 [Serializable]
1110 public class ProgressEventArgs : CancellableHResultEventArgs
1111 {
1112 /// <summary />
1113 public ProgressEventArgs(int progressPercentage, int overallPercentage, bool cancelRecommendation)
1114 : base(cancelRecommendation)
1115 {
1116 this.ProgressPercentage = progressPercentage;
1117 this.OverallPercentage = overallPercentage;
1118 }
1119
1120 /// <summary>
1121 /// Gets the percentage from 0 to 100 completed for a package.
1122 /// </summary>
1123 public int ProgressPercentage { get; private set; }
1124
1125 /// <summary>
1126 /// Gets the percentage from 0 to 100 completed for the bundle.
1127 /// </summary>
1128 public int OverallPercentage { get; private set; }
1129 }
1130
1131 /// <summary>
1132 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Error"/>
1133 /// </summary>
1134 [Serializable]
1135 public class ErrorEventArgs : ResultEventArgs
1136 {
1137 /// <summary />
1138 public ErrorEventArgs(ErrorType errorType, string packageId, int errorCode, string errorMessage, int dwUIHint, string[] data, Result recommendation, Result result)
1139 : base(recommendation, result)
1140 {
1141 this.ErrorType = errorType;
1142 this.PackageId = packageId;
1143 this.ErrorCode = errorCode;
1144 this.ErrorMessage = errorMessage;
1145 this.UIHint = dwUIHint;
1146 this.Data = new ReadOnlyCollection<string>(data ?? new string[] { });
1147 }
1148
1149 /// <summary>
1150 /// Gets the type of error that occurred.
1151 /// </summary>
1152 public ErrorType ErrorType { get; private set; }
1153
1154 /// <summary>
1155 /// Gets the identity of the package that yielded the error.
1156 /// </summary>
1157 public string PackageId { get; private set; }
1158
1159 /// <summary>
1160 /// Gets the error code.
1161 /// </summary>
1162 public int ErrorCode { get; private set; }
1163
1164 /// <summary>
1165 /// Gets the error message.
1166 /// </summary>
1167 public string ErrorMessage { get; private set; }
1168
1169 /// <summary>
1170 /// Gets the recommended display flags for an error dialog.
1171 /// </summary>
1172 public int UIHint { get; private set; }
1173
1174 /// <summary>
1175 /// Gets the extended data for the error.
1176 /// </summary>
1177 public IList<string> Data { get; private set; }
1178 }
1179
1180 /// <summary>
1181 /// Event arguments for <see cref="IDefaultBootstrapperApplication.RegisterBegin"/>
1182 /// </summary>
1183 [Serializable]
1184 public class RegisterBeginEventArgs : CancellableHResultEventArgs
1185 {
1186 /// <summary />
1187 public RegisterBeginEventArgs(bool cancelRecommendation)
1188 : base(cancelRecommendation)
1189 {
1190 }
1191 }
1192
1193 /// <summary>
1194 /// Additional arguments used when the engine has completed registering the location and visilibity of the bundle.
1195 /// </summary>
1196 [Serializable]
1197 public class RegisterCompleteEventArgs : StatusEventArgs
1198 {
1199 /// <summary>
1200 /// Creates a new instance of the <see cref="RegisterCompleteEventArgs"/> class.
1201 /// </summary>
1202 /// <param name="hrStatus">The return code of the operation.</param>
1203 public RegisterCompleteEventArgs(int hrStatus)
1204 : base(hrStatus)
1205 {
1206 }
1207 }
1208
1209 /// <summary>
1210 /// Event arguments for <see cref="IDefaultBootstrapperApplication.UnregisterBegin"/>
1211 /// </summary>
1212 [Serializable]
1213 public class UnregisterBeginEventArgs : HResultEventArgs
1214 {
1215 /// <summary>
1216 ///
1217 /// </summary>
1218 /// <param name="keepRegistration"></param>
1219 /// <param name="forceKeepRegistration"></param>
1220 public UnregisterBeginEventArgs(bool keepRegistration, bool forceKeepRegistration)
1221 {
1222 this.KeepRegistration = keepRegistration;
1223 this.ForceKeepRegistration = forceKeepRegistration;
1224 }
1225
1226 /// <summary>
1227 /// Indicates whether the engine will uninstall the bundle.
1228 /// </summary>
1229 public bool ForceKeepRegistration { get; set; }
1230
1231 /// <summary>
1232 /// If <see cref="KeepRegistration"/> is FALSE, then this can be set to TRUE to make the engine keep the bundle installed.
1233 /// </summary>
1234 public bool KeepRegistration { get; private set; }
1235 }
1236
1237 /// <summary>
1238 /// Event arguments for <see cref="IDefaultBootstrapperApplication.UnregisterComplete"/>
1239 /// </summary>
1240 [Serializable]
1241 public class UnregisterCompleteEventArgs : StatusEventArgs
1242 {
1243 /// <summary>
1244 ///
1245 /// </summary>
1246 /// <param name="hrStatus"></param>
1247 public UnregisterCompleteEventArgs(int hrStatus)
1248 : base(hrStatus)
1249 {
1250 }
1251 }
1252
1253 /// <summary>
1254 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheBegin"/>
1255 /// </summary>
1256 [Serializable]
1257 public class CacheBeginEventArgs : CancellableHResultEventArgs
1258 {
1259 /// <summary />
1260 public CacheBeginEventArgs(bool cancelRecommendation)
1261 : base(cancelRecommendation)
1262 {
1263 }
1264 }
1265
1266 /// <summary>
1267 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireBegin"/>.
1268 /// </summary>
1269 [Serializable]
1270 public class CacheAcquireBeginEventArgs : CancellableActionEventArgs<CacheOperation>
1271 {
1272 /// <summary />
1273 public CacheAcquireBeginEventArgs(string packageOrContainerId, string payloadId, string source, string downloadUrl, string payloadContainerId, CacheOperation recommendation, CacheOperation action, bool cancelRecommendation)
1274 : base(cancelRecommendation, recommendation, action)
1275 {
1276 this.PackageOrContainerId = packageOrContainerId;
1277 this.PayloadId = payloadId;
1278 this.Source = source;
1279 this.DownloadUrl = downloadUrl;
1280 this.PayloadContainerId = payloadContainerId;
1281 }
1282
1283 /// <summary>
1284 /// Gets the identifier of the container or package.
1285 /// </summary>
1286 public string PackageOrContainerId { get; private set; }
1287
1288 /// <summary>
1289 /// Gets the identifier of the payload (if acquiring a payload).
1290 /// </summary>
1291 public string PayloadId { get; private set; }
1292
1293 /// <summary>
1294 /// Gets the source of the container or payload.
1295 /// </summary>
1296 public string Source { get; private set; }
1297
1298 /// <summary>
1299 /// Gets the optional URL to download container or payload.
1300 /// </summary>
1301 public string DownloadUrl { get; private set; }
1302
1303 /// <summary>
1304 /// Gets the optional identity of the container that contains the payload being acquired.
1305 /// </summary>
1306 public string PayloadContainerId { get; private set; }
1307 }
1308
1309 /// <summary>
1310 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireProgress"/>.
1311 /// </summary>
1312 [Serializable]
1313 public class CacheAcquireProgressEventArgs : CacheProgressBaseEventArgs
1314 {
1315 /// <summary />
1316 public CacheAcquireProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
1317 : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
1318 {
1319 }
1320 }
1321
1322 /// <summary>
1323 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>.
1324 /// </summary>
1325 [Serializable]
1326 public class CacheAcquireCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION>
1327 {
1328 /// <summary />
1329 public CacheAcquireCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action)
1330 : base(hrStatus, recommendation, action)
1331 {
1332 this.PackageOrContainerId = packageOrContainerId;
1333 this.PayloadId = payloadId;
1334 }
1335
1336 /// <summary>
1337 /// Gets the identifier of the container or package.
1338 /// </summary>
1339 public string PackageOrContainerId { get; private set; }
1340
1341 /// <summary>
1342 /// Gets the identifier of the payload (if acquiring a payload).
1343 /// </summary>
1344 public string PayloadId { get; private set; }
1345 }
1346
1347 /// <summary>
1348 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheVerifyBegin"/>.
1349 /// </summary>
1350 [Serializable]
1351 public class CacheVerifyBeginEventArgs : CancellableHResultEventArgs
1352 {
1353 /// <summary />
1354 public CacheVerifyBeginEventArgs(string packageOrContainerId, string payloadId, bool cancelRecommendation)
1355 : base(cancelRecommendation)
1356 {
1357 this.PackageOrContainerId = packageOrContainerId;
1358 this.PayloadId = payloadId;
1359 }
1360
1361 /// <summary>
1362 /// Gets the identifier of the container or package.
1363 /// </summary>
1364 public string PackageOrContainerId { get; private set; }
1365
1366 /// <summary>
1367 /// Gets the identifier of the payload.
1368 /// </summary>
1369 public string PayloadId { get; private set; }
1370 }
1371
1372 /// <summary>
1373 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheVerifyProgress"/>.
1374 /// </summary>
1375 [Serializable]
1376 public class CacheVerifyProgressEventArgs : CacheProgressBaseEventArgs
1377 {
1378 /// <summary />
1379 public CacheVerifyProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, CacheVerifyStep verifyStep, bool cancelRecommendation)
1380 : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
1381 {
1382 this.Step = verifyStep;
1383 }
1384
1385 /// <summary>
1386 /// Gets the current verification step.
1387 /// </summary>
1388 public CacheVerifyStep Step { get; private set; }
1389 }
1390
1391 /// <summary>
1392 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheVerifyComplete"/>
1393 /// </summary>
1394 [Serializable]
1395 public class CacheVerifyCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION>
1396 {
1397 /// <summary />
1398 public CacheVerifyCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action)
1399 : base(hrStatus, recommendation, action)
1400 {
1401 this.PackageOrContainerId = packageOrContainerId;
1402 this.PayloadId = payloadId;
1403 }
1404
1405 /// <summary>
1406 /// Gets the identifier of the container or package.
1407 /// </summary>
1408 public string PackageOrContainerId { get; private set; }
1409
1410 /// <summary>
1411 /// Gets the identifier of the payload.
1412 /// </summary>
1413 public string PayloadId { get; private set; }
1414 }
1415
1416 /// <summary>
1417 /// Additional arguments used after the engine has cached the installation sources.
1418 /// </summary>
1419 [Serializable]
1420 public class CacheCompleteEventArgs : StatusEventArgs
1421 {
1422 /// <summary>
1423 /// Creates a new instance of the <see cref="CacheCompleteEventArgs"/> class.
1424 /// </summary>
1425 /// <param name="hrStatus">The return code of the operation.</param>
1426 public CacheCompleteEventArgs(int hrStatus)
1427 : base(hrStatus)
1428 {
1429 }
1430 }
1431
1432 /// <summary>
1433 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteBegin"/>
1434 /// </summary>
1435 [Serializable]
1436 public class ExecuteBeginEventArgs : CancellableHResultEventArgs
1437 {
1438 /// <summary />
1439 public ExecuteBeginEventArgs(int packageCount, bool cancelRecommendation)
1440 : base(cancelRecommendation)
1441 {
1442 this.PackageCount = packageCount;
1443 }
1444
1445 /// <summary>
1446 /// Gets the number of packages to act on.
1447 /// </summary>
1448 public int PackageCount { get; private set; }
1449 }
1450
1451 /// <summary>
1452 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePackageBegin"/>
1453 /// </summary>
1454 [Serializable]
1455 public class ExecutePackageBeginEventArgs : CancellableHResultEventArgs
1456 {
1457 /// <summary />
1458 public ExecutePackageBeginEventArgs(string packageId, bool shouldExecute, ActionState action, INSTALLUILEVEL uiLevel, bool disableExternalUiHandler, bool cancelRecommendation)
1459 : base(cancelRecommendation)
1460 {
1461 this.PackageId = packageId;
1462 this.ShouldExecute = shouldExecute;
1463 this.Action = action;
1464 this.UiLevel = uiLevel;
1465 this.DisableExternalUiHandler = disableExternalUiHandler;
1466 }
1467
1468 /// <summary>
1469 /// Gets the identity of the package to act on.
1470 /// </summary>
1471 public string PackageId { get; private set; }
1472
1473 /// <summary>
1474 /// Gets whether the package is being executed or rolled back.
1475 /// </summary>
1476 public bool ShouldExecute { get; private set; }
1477
1478 /// <summary>
1479 /// Gets the action about to be executed.
1480 /// </summary>
1481 public ActionState Action { get; private set; }
1482
1483 /// <summary>
1484 /// Gets the internal UI level (if this is an MSI or MSP package).
1485 /// </summary>
1486 public INSTALLUILEVEL UiLevel { get; private set; }
1487
1488 /// <summary>
1489 /// Gets whether Burn will set up an external UI handler (if this is an MSI or MSP package).
1490 /// </summary>
1491 public bool DisableExternalUiHandler { get; private set; }
1492 }
1493
1494 /// <summary>
1495 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePatchTarget"/>
1496 /// </summary>
1497 [Serializable]
1498 public class ExecutePatchTargetEventArgs : CancellableHResultEventArgs
1499 {
1500 /// <summary />
1501 public ExecutePatchTargetEventArgs(string packageId, string targetProductCode, bool cancelRecommendation)
1502 : base(cancelRecommendation)
1503 {
1504 this.PackageId = packageId;
1505 this.TargetProductCode = targetProductCode;
1506 }
1507
1508 /// <summary>
1509 /// Gets the identity of the package to act on.
1510 /// </summary>
1511 public string PackageId { get; private set; }
1512
1513 /// <summary>
1514 /// Gets the product code being targeted.
1515 /// </summary>
1516 public string TargetProductCode { get; private set; }
1517 }
1518
1519 /// <summary>
1520 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteMsiMessage"/>
1521 /// </summary>
1522 [Serializable]
1523 public class ExecuteMsiMessageEventArgs : ResultEventArgs
1524 {
1525 /// <summary />
1526 public ExecuteMsiMessageEventArgs(string packageId, InstallMessage messageType, int dwUIHint, string message, string[] data, Result recommendation, Result result)
1527 : base(recommendation, result)
1528 {
1529 this.PackageId = packageId;
1530 this.MessageType = messageType;
1531 this.UIHint = dwUIHint;
1532 this.Message = message;
1533 this.Data = new ReadOnlyCollection<string>(data ?? new string[] { });
1534 }
1535
1536 /// <summary>
1537 /// Gets the identity of the package that yielded this message.
1538 /// </summary>
1539 public string PackageId { get; private set; }
1540
1541 /// <summary>
1542 /// Gets the type of this message.
1543 /// </summary>
1544 public InstallMessage MessageType { get; private set; }
1545
1546 /// <summary>
1547 /// Gets the recommended display flags for this message.
1548 /// </summary>
1549 public int UIHint { get; private set; }
1550
1551 /// <summary>
1552 /// Gets the message.
1553 /// </summary>
1554 public string Message { get; private set; }
1555
1556 /// <summary>
1557 /// Gets the extended data for the message.
1558 /// </summary>
1559 public IList<string> Data { get; private set; }
1560 }
1561
1562 /// <summary>
1563 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteFilesInUse"/>
1564 /// </summary>
1565 [Serializable]
1566 public class ExecuteFilesInUseEventArgs : ResultEventArgs
1567 {
1568 /// <summary />
1569 public ExecuteFilesInUseEventArgs(string packageId, string[] files, Result recommendation, Result result)
1570 : base(recommendation, result)
1571 {
1572 this.PackageId = packageId;
1573 this.Files = new ReadOnlyCollection<string>(files ?? new string[] { });
1574 }
1575
1576 /// <summary>
1577 /// Gets the identity of the package that yielded the files in use message.
1578 /// </summary>
1579 public string PackageId { get; private set; }
1580
1581 /// <summary>
1582 /// Gets the list of files in use.
1583 /// </summary>
1584 public IList<string> Files { get; private set; }
1585 }
1586
1587 /// <summary>
1588 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>
1589 /// Additional arguments used when the engine has completed installing a specific package.
1590 /// </summary>
1591 [Serializable]
1592 public class ExecutePackageCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION>
1593 {
1594 /// <summary />
1595 public ExecutePackageCompleteEventArgs(string packageId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION action)
1596 : base(hrStatus, recommendation, action)
1597 {
1598 this.PackageId = packageId;
1599 this.Restart = restart;
1600 }
1601
1602 /// <summary>
1603 /// Gets the identity of the package that was acted on.
1604 /// </summary>
1605 public string PackageId { get; private set; }
1606
1607 /// <summary>
1608 /// Gets the package restart state after being applied.
1609 /// </summary>
1610 public ApplyRestart Restart { get; private set; }
1611 }
1612
1613 /// <summary>
1614 /// Additional arguments used when the engine has completed installing packages.
1615 /// </summary>
1616 [Serializable]
1617 public class ExecuteCompleteEventArgs : StatusEventArgs
1618 {
1619 /// <summary>
1620 /// Creates a new instance of the <see cref="ExecuteCompleteEventArgs"/> class.
1621 /// </summary>
1622 /// <param name="hrStatus">The return code of the operation.</param>
1623 public ExecuteCompleteEventArgs(int hrStatus)
1624 : base(hrStatus)
1625 {
1626 }
1627 }
1628
1629 /// <summary>
1630 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyComplete"/>
1631 /// </summary>
1632 [Serializable]
1633 public class ApplyCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_APPLYCOMPLETE_ACTION>
1634 {
1635 /// <summary />
1636 public ApplyCompleteEventArgs(int hrStatus, ApplyRestart restart, BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation, BOOTSTRAPPER_APPLYCOMPLETE_ACTION action)
1637 : base(hrStatus, recommendation, action)
1638 {
1639 this.Restart = restart;
1640 }
1641
1642 /// <summary>
1643 /// Gets the apply restart state when complete.
1644 /// </summary>
1645 public ApplyRestart Restart { get; private set; }
1646 }
1647
1648 /// <summary>
1649 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>.
1650 /// </summary>
1651 [Serializable]
1652 public class CacheAcquireResolvingEventArgs : CancellableActionEventArgs<CacheResolveOperation>
1653 {
1654 /// <summary />
1655 public CacheAcquireResolvingEventArgs(string packageOrContainerId, string payloadId, string[] searchPaths, bool foundLocal, int recommendedSearchPath, string downloadUrl, string payloadContainerId, CacheResolveOperation recommendation, int chosenSearchPath, CacheResolveOperation action, bool cancel)
1656 : base(cancel, recommendation, action)
1657 {
1658 this.PackageOrContainerId = packageOrContainerId;
1659 this.PayloadId = payloadId;
1660 this.SearchPaths = searchPaths;
1661 this.FoundLocal = foundLocal;
1662 this.RecommendedSearchPath = recommendedSearchPath;
1663 this.DownloadUrl = downloadUrl;
1664 this.PayloadContainerId = payloadContainerId;
1665 this.ChosenSearchPath = chosenSearchPath;
1666 }
1667
1668 /// <summary>
1669 /// Gets the identity of the package or container that is being acquired.
1670 /// </summary>
1671 public string PackageOrContainerId { get; private set; }
1672
1673 /// <summary>
1674 /// Gets the identity of the payload that is being acquired.
1675 /// </summary>
1676 public string PayloadId { get; private set; }
1677
1678 /// <summary>
1679 /// Gets the search paths used for source resolution.
1680 /// </summary>
1681 public string[] SearchPaths { get; private set; }
1682
1683 /// <summary>
1684 /// Gets whether <see cref="RecommendedSearchPath"/> indicates that a file was found at that search path.
1685 /// </summary>
1686 public bool FoundLocal { get; private set; }
1687
1688 /// <summary>
1689 /// When <see cref="FoundLocal"/> is true, the index to <see cref="SearchPaths"/> for the recommended local file.
1690 /// </summary>
1691 public int RecommendedSearchPath { get; private set; }
1692
1693 /// <summary>
1694 /// Gets the optional URL to download container or payload.
1695 /// </summary>
1696 public string DownloadUrl { get; private set; }
1697
1698 /// <summary>
1699 /// Gets the optional identity of the container that contains the payload being acquired.
1700 /// </summary>
1701 public string PayloadContainerId { get; private set; }
1702
1703 /// <summary>
1704 /// Gets or sets the index to <see cref="SearchPaths"/> to use when <see cref="CancellableActionEventArgs{T}.Action"/> is set to <see cref="CacheOperation.Copy"/>.
1705 /// </summary>
1706 public int ChosenSearchPath { get; set; }
1707 }
1708
1709 /// <summary>
1710 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePackageBegin"/>
1711 /// </summary>
1712 [Serializable]
1713 public class CachePackageBeginEventArgs : CancellableHResultEventArgs
1714 {
1715 /// <summary />
1716 public CachePackageBeginEventArgs(string packageId, int cachePayloads, long packageCacheSize, bool cancelRecommendation)
1717 : base(cancelRecommendation)
1718 {
1719 this.PackageId = packageId;
1720 this.CachePayloads = cachePayloads;
1721 this.PackageCacheSize = packageCacheSize;
1722 }
1723
1724 /// <summary>
1725 /// Gets the identity of the package that is being cached.
1726 /// </summary>
1727 public string PackageId { get; private set; }
1728
1729 /// <summary>
1730 /// Gets number of payloads to be cached.
1731 /// </summary>
1732 public long CachePayloads { get; private set; }
1733
1734 /// <summary>
1735 /// Gets the size on disk required by the specific package.
1736 /// </summary>
1737 public long PackageCacheSize { get; private set; }
1738 }
1739
1740 /// <summary>
1741 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePackageComplete"/>
1742 /// </summary>
1743 [Serializable]
1744 public class CachePackageCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION>
1745 {
1746 /// <summary />
1747 public CachePackageCompleteEventArgs(string packageId, int hrStatus, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action)
1748 : base(hrStatus, recommendation, action)
1749 {
1750 this.PackageId = packageId;
1751 }
1752
1753 /// <summary>
1754 /// Gets the identity of the package that was cached.
1755 /// </summary>
1756 public string PackageId { get; private set; }
1757 }
1758
1759 /// <summary>
1760 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteProgress"/>
1761 /// </summary>
1762 [Serializable]
1763 public class ExecuteProgressEventArgs : CancellableHResultEventArgs
1764 {
1765 /// <summary />
1766 public ExecuteProgressEventArgs(string packageId, int progressPercentage, int overallPercentage, bool cancelRecommendation)
1767 : base(cancelRecommendation)
1768 {
1769 this.PackageId = packageId;
1770 this.ProgressPercentage = progressPercentage;
1771 this.OverallPercentage = overallPercentage;
1772 }
1773
1774 /// <summary>
1775 /// Gets the identity of the package that was executed.
1776 /// </summary>
1777 public string PackageId { get; private set; }
1778
1779 /// <summary>
1780 /// Gets the percentage from 0 to 100 of the execution progress for a single payload.
1781 /// </summary>
1782 public int ProgressPercentage { get; private set; }
1783
1784 /// <summary>
1785 /// Gets the percentage from 0 to 100 of the execution progress for all payloads.
1786 /// </summary>
1787 public int OverallPercentage { get; private set; }
1788 }
1789
1790 /// <summary>
1791 /// Additional arguments passed by the engine before it tries to launch the preapproved executable.
1792 /// </summary>
1793 [Serializable]
1794 public class LaunchApprovedExeBeginEventArgs : CancellableHResultEventArgs
1795 {
1796 /// <summary>
1797 ///
1798 /// </summary>
1799 /// <param name="cancelRecommendation"></param>
1800 public LaunchApprovedExeBeginEventArgs(bool cancelRecommendation)
1801 : base(cancelRecommendation)
1802 {
1803 }
1804 }
1805
1806 /// <summary>
1807 /// Additional arguments passed by the engine after it finished trying to launch the preapproved executable.
1808 /// </summary>
1809 [Serializable]
1810 public class LaunchApprovedExeCompleteEventArgs : StatusEventArgs
1811 {
1812 private int processId;
1813
1814 /// <summary>
1815 ///
1816 /// </summary>
1817 /// <param name="hrStatus"></param>
1818 /// <param name="processId"></param>
1819 public LaunchApprovedExeCompleteEventArgs(int hrStatus, int processId)
1820 : base(hrStatus)
1821 {
1822 this.processId = processId;
1823 }
1824
1825 /// <summary>
1826 /// Gets the ProcessId of the process that was launched.
1827 /// This is only valid if the status reports success.
1828 /// </summary>
1829 public int ProcessId
1830 {
1831 get { return this.processId; }
1832 }
1833 }
1834
1835 /// <summary>
1836 /// Additional arguments passed by the engine before beginning an MSI transaction.
1837 /// </summary>
1838 [Serializable]
1839 public class BeginMsiTransactionBeginEventArgs : CancellableHResultEventArgs
1840 {
1841 private string transactionId;
1842
1843 /// <summary>
1844 ///
1845 /// </summary>
1846 /// <param name="transactionId"></param>
1847 /// <param name="cancelRecommendation"></param>
1848 public BeginMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation)
1849 : base(cancelRecommendation)
1850 {
1851 this.transactionId = transactionId;
1852 }
1853
1854 /// <summary>
1855 /// Gets the MSI transaction Id.
1856 /// </summary>
1857 public string TransactionId
1858 {
1859 get { return this.transactionId; }
1860 }
1861 }
1862
1863 /// <summary>
1864 /// Additional arguments passed by the engine after beginning an MSI transaction.
1865 /// </summary>
1866 [Serializable]
1867 public class BeginMsiTransactionCompleteEventArgs : StatusEventArgs
1868 {
1869 private string transactionId;
1870
1871 /// <summary>
1872 ///
1873 /// </summary>
1874 /// <param name="transactionId"></param>
1875 /// <param name="hrStatus"></param>
1876 public BeginMsiTransactionCompleteEventArgs(string transactionId, int hrStatus)
1877 : base(hrStatus)
1878 {
1879 this.transactionId = transactionId;
1880 }
1881
1882 /// <summary>
1883 /// Gets the MSI transaction Id.
1884 /// </summary>
1885 public string TransactionId
1886 {
1887 get { return this.transactionId; }
1888 }
1889 }
1890
1891 /// <summary>
1892 /// Additional arguments passed by the engine before committing an MSI transaction.
1893 /// </summary>
1894 [Serializable]
1895 public class CommitMsiTransactionBeginEventArgs : CancellableHResultEventArgs
1896 {
1897 private string transactionId;
1898
1899 /// <summary>
1900 ///
1901 /// </summary>
1902 /// <param name="transactionId"></param>
1903 /// <param name="cancelRecommendation"></param>
1904 public CommitMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation)
1905 : base(cancelRecommendation)
1906 {
1907 this.transactionId = transactionId;
1908 }
1909
1910 /// <summary>
1911 /// Gets the MSI transaction Id.
1912 /// </summary>
1913 public string TransactionId
1914 {
1915 get { return this.transactionId; }
1916 }
1917 }
1918
1919 /// <summary>
1920 /// Additional arguments passed by the engine after committing an MSI transaction.
1921 /// </summary>
1922 [Serializable]
1923 public class CommitMsiTransactionCompleteEventArgs : StatusEventArgs
1924 {
1925 private string transactionId;
1926
1927 /// <summary>
1928 ///
1929 /// </summary>
1930 /// <param name="transactionId"></param>
1931 /// <param name="hrStatus"></param>
1932 public CommitMsiTransactionCompleteEventArgs(string transactionId, int hrStatus)
1933 : base(hrStatus)
1934 {
1935 this.transactionId = transactionId;
1936 }
1937
1938 /// <summary>
1939 /// Gets the MSI transaction Id.
1940 /// </summary>
1941 public string TransactionId
1942 {
1943 get { return this.transactionId; }
1944 }
1945 }
1946
1947 /// <summary>
1948 /// Additional arguments passed by the engine before rolling back an MSI transaction.
1949 /// </summary>
1950 [Serializable]
1951 public class RollbackMsiTransactionBeginEventArgs : HResultEventArgs
1952 {
1953 private string transactionId;
1954
1955 /// <summary>
1956 ///
1957 /// </summary>
1958 /// <param name="transactionId"></param>
1959 public RollbackMsiTransactionBeginEventArgs(string transactionId)
1960 {
1961 this.transactionId = transactionId;
1962 }
1963
1964 /// <summary>
1965 /// Gets the MSI transaction Id.
1966 /// </summary>
1967 public string TransactionId
1968 {
1969 get { return this.transactionId; }
1970 }
1971 }
1972
1973 /// <summary>
1974 /// Additional arguments passed by the engine after rolling back an MSI transaction.
1975 /// </summary>
1976 [Serializable]
1977 public class RollbackMsiTransactionCompleteEventArgs : StatusEventArgs
1978 {
1979 private string transactionId;
1980
1981 /// <summary>
1982 ///
1983 /// </summary>
1984 /// <param name="transactionId"></param>
1985 /// <param name="hrStatus"></param>
1986 public RollbackMsiTransactionCompleteEventArgs(string transactionId, int hrStatus)
1987 : base(hrStatus)
1988 {
1989 this.transactionId = transactionId;
1990 }
1991
1992 /// <summary>
1993 /// Gets the MSI transaction Id.
1994 /// </summary>
1995 public string TransactionId
1996 {
1997 get { return this.transactionId; }
1998 }
1999 }
2000
2001 /// <summary>
2002 /// Additional arguments passed by the engine before pausing Windows automatic updates.
2003 /// </summary>
2004 [Serializable]
2005 public class PauseAutomaticUpdatesBeginEventArgs : HResultEventArgs
2006 {
2007 /// <summary>
2008 ///
2009 /// </summary>
2010 public PauseAutomaticUpdatesBeginEventArgs()
2011 {
2012 }
2013 }
2014
2015 /// <summary>
2016 /// Additional arguments passed by the engine after pausing Windows automatic updates.
2017 /// </summary>
2018 [Serializable]
2019 public class PauseAutomaticUpdatesCompleteEventArgs : StatusEventArgs
2020 {
2021 /// <summary>
2022 ///
2023 /// </summary>
2024 /// <param name="hrStatus"></param>
2025 public PauseAutomaticUpdatesCompleteEventArgs(int hrStatus)
2026 : base(hrStatus)
2027 {
2028 }
2029 }
2030
2031 /// <summary>
2032 /// Additional arguments passed by the engine before taking a system restore point.
2033 /// </summary>
2034 [Serializable]
2035 public class SystemRestorePointBeginEventArgs : HResultEventArgs
2036 {
2037 /// <summary>
2038 ///
2039 /// </summary>
2040 public SystemRestorePointBeginEventArgs()
2041 {
2042 }
2043 }
2044
2045 /// <summary>
2046 /// Additional arguments passed by the engine after taking a system restore point.
2047 /// </summary>
2048 [Serializable]
2049 public class SystemRestorePointCompleteEventArgs : StatusEventArgs
2050 {
2051 /// <summary>
2052 ///
2053 /// </summary>
2054 /// <param name="hrStatus"></param>
2055 public SystemRestorePointCompleteEventArgs(int hrStatus)
2056 : base(hrStatus)
2057 {
2058 }
2059 }
2060
2061 /// <summary>
2062 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyBegin"/>.
2063 /// </summary>
2064 [Serializable]
2065 public class CacheContainerOrPayloadVerifyBeginEventArgs : CancellableHResultEventArgs
2066 {
2067 /// <summary />
2068 public CacheContainerOrPayloadVerifyBeginEventArgs(string packageOrContainerId, string payloadId, bool cancelRecommendation)
2069 : base(cancelRecommendation)
2070 {
2071 this.PackageOrContainerId = packageOrContainerId;
2072 this.PayloadId = payloadId;
2073 }
2074
2075 /// <summary>
2076 /// Gets the identifier of the container or package.
2077 /// </summary>
2078 public string PackageOrContainerId { get; private set; }
2079
2080 /// <summary>
2081 /// Gets the identifier of the payload.
2082 /// </summary>
2083 public string PayloadId { get; private set; }
2084 }
2085
2086 /// <summary>
2087 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyProgress"/>.
2088 /// </summary>
2089 [Serializable]
2090 public class CacheContainerOrPayloadVerifyProgressEventArgs : CacheProgressBaseEventArgs
2091 {
2092 /// <summary />
2093 public CacheContainerOrPayloadVerifyProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
2094 : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
2095 {
2096 }
2097 }
2098
2099 /// <summary>
2100 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyComplete"/>
2101 /// </summary>
2102 [Serializable]
2103 public class CacheContainerOrPayloadVerifyCompleteEventArgs : StatusEventArgs
2104 {
2105 /// <summary />
2106 public CacheContainerOrPayloadVerifyCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus)
2107 : base(hrStatus)
2108 {
2109 this.PackageOrContainerId = packageOrContainerId;
2110 this.PayloadId = payloadId;
2111 }
2112
2113 /// <summary>
2114 /// Gets the identifier of the container or package.
2115 /// </summary>
2116 public string PackageOrContainerId { get; private set; }
2117
2118 /// <summary>
2119 /// Gets the identifier of the payload.
2120 /// </summary>
2121 public string PayloadId { get; private set; }
2122 }
2123
2124 /// <summary>
2125 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractBegin"/>.
2126 /// </summary>
2127 [Serializable]
2128 public class CachePayloadExtractBeginEventArgs : CancellableHResultEventArgs
2129 {
2130 /// <summary />
2131 public CachePayloadExtractBeginEventArgs(string containerId, string payloadId, bool cancelRecommendation)
2132 : base(cancelRecommendation)
2133 {
2134 this.ContainerId = containerId;
2135 this.PayloadId = payloadId;
2136 }
2137
2138 /// <summary>
2139 /// Gets the identifier of the container.
2140 /// </summary>
2141 public string ContainerId { get; private set; }
2142
2143 /// <summary>
2144 /// Gets the identifier of the payload.
2145 /// </summary>
2146 public string PayloadId { get; private set; }
2147 }
2148
2149 /// <summary>
2150 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractProgress"/>.
2151 /// </summary>
2152 [Serializable]
2153 public class CachePayloadExtractProgressEventArgs : CacheProgressBaseEventArgs
2154 {
2155 /// <summary />
2156 public CachePayloadExtractProgressEventArgs(string containerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
2157 : base(containerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
2158 {
2159 }
2160 }
2161
2162 /// <summary>
2163 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractComplete"/>
2164 /// </summary>
2165 [Serializable]
2166 public class CachePayloadExtractCompleteEventArgs : StatusEventArgs
2167 {
2168 /// <summary />
2169 public CachePayloadExtractCompleteEventArgs(string containerId, string payloadId, int hrStatus)
2170 : base(hrStatus)
2171 {
2172 this.ContainerId = containerId;
2173 this.PayloadId = payloadId;
2174 }
2175
2176 /// <summary>
2177 /// Gets the identifier of the container.
2178 /// </summary>
2179 public string ContainerId { get; private set; }
2180
2181 /// <summary>
2182 /// Gets the identifier of the payload.
2183 /// </summary>
2184 public string PayloadId { get; private set; }
2185 }
2186}
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs
new file mode 100644
index 00000000..530fb1a9
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplication.cs
@@ -0,0 +1,1917 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// Allows customization of the bootstrapper application.
10 /// </summary>
11 [ComImport]
12 [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
13 [Guid("53C31D56-49C0-426B-AB06-099D717C67FE")]
14 public interface IBootstrapperApplication
15 {
16 /// <summary>
17 /// Low level method that is called directly from the engine.
18 /// </summary>
19 [PreserveSig]
20 [return: MarshalAs(UnmanagedType.I4)]
21 int BAProc(
22 int message,
23 IntPtr pvArgs,
24 IntPtr pvResults,
25 IntPtr pvContext
26 );
27
28 /// <summary>
29 /// Low level method that is called directly from the engine.
30 /// </summary>
31 void BAProcFallback(
32 int message,
33 IntPtr pvArgs,
34 IntPtr pvResults,
35 ref int phr,
36 IntPtr pvContext
37 );
38
39 /// <summary>
40 /// See <see cref="IDefaultBootstrapperApplication.Startup"/>.
41 /// </summary>
42 [PreserveSig]
43 [return: MarshalAs(UnmanagedType.I4)]
44 int OnStartup();
45
46 /// <summary>
47 /// See <see cref="IDefaultBootstrapperApplication.Shutdown"/>.
48 /// </summary>
49 [PreserveSig]
50 [return: MarshalAs(UnmanagedType.I4)]
51 int OnShutdown(ref BOOTSTRAPPER_SHUTDOWN_ACTION action);
52
53 /// <summary>
54 /// See <see cref="IDefaultBootstrapperApplication.SystemShutdown"/>.
55 /// </summary>
56 /// <param name="dwEndSession"></param>
57 /// <param name="fCancel"></param>
58 /// <returns></returns>
59 [PreserveSig]
60 [return: MarshalAs(UnmanagedType.I4)]
61 int OnSystemShutdown(
62 [MarshalAs(UnmanagedType.U4)] EndSessionReasons dwEndSession,
63 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
64 );
65
66 /// <summary>
67 /// See <see cref="IDefaultBootstrapperApplication.DetectBegin"/>.
68 /// </summary>
69 [PreserveSig]
70 [return: MarshalAs(UnmanagedType.I4)]
71 int OnDetectBegin(
72 [MarshalAs(UnmanagedType.Bool)] bool fCached,
73 [MarshalAs(UnmanagedType.Bool)] bool fInstalled,
74 [MarshalAs(UnmanagedType.U4)] int cPackages,
75 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
76 );
77
78 /// <summary>
79 /// See <see cref="IDefaultBootstrapperApplication.DetectForwardCompatibleBundle"/>.
80 /// </summary>
81 /// <param name="wzBundleId"></param>
82 /// <param name="relationType"></param>
83 /// <param name="wzBundleTag"></param>
84 /// <param name="fPerMachine"></param>
85 /// <param name="wzVersion"></param>
86 /// <param name="fMissingFromCache"></param>
87 /// <param name="fCancel"></param>
88 /// <returns></returns>
89 [PreserveSig]
90 [return: MarshalAs(UnmanagedType.I4)]
91 int OnDetectForwardCompatibleBundle(
92 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
93 [MarshalAs(UnmanagedType.U4)] RelationType relationType,
94 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
95 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
96 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
97 [MarshalAs(UnmanagedType.Bool)] bool fMissingFromCache,
98 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
99 );
100
101 /// <summary>
102 /// See <see cref="IDefaultBootstrapperApplication.DetectUpdateBegin"/>.
103 /// </summary>
104 /// <param name="wzUpdateLocation"></param>
105 /// <param name="fCancel"></param>
106 /// <param name="fSkip"></param>
107 /// <returns></returns>
108 [PreserveSig]
109 [return: MarshalAs(UnmanagedType.I4)]
110 int OnDetectUpdateBegin(
111 [MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation,
112 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
113 [MarshalAs(UnmanagedType.Bool)] ref bool fSkip
114 );
115
116 /// <summary>
117 /// See <see cref="IDefaultBootstrapperApplication.DetectUpdate"/>.
118 /// </summary>
119 /// <param name="wzUpdateLocation"></param>
120 /// <param name="dw64Size"></param>
121 /// <param name="wzVersion"></param>
122 /// <param name="wzTitle"></param>
123 /// <param name="wzSummary"></param>
124 /// <param name="wzContentType"></param>
125 /// <param name="wzContent"></param>
126 /// <param name="fCancel"></param>
127 /// <param name="fStopProcessingUpdates"></param>
128 /// <returns></returns>
129 [PreserveSig]
130 [return: MarshalAs(UnmanagedType.I4)]
131 int OnDetectUpdate(
132 [MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation,
133 [MarshalAs(UnmanagedType.U8)] long dw64Size,
134 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
135 [MarshalAs(UnmanagedType.LPWStr)] string wzTitle,
136 [MarshalAs(UnmanagedType.LPWStr)] string wzSummary,
137 [MarshalAs(UnmanagedType.LPWStr)] string wzContentType,
138 [MarshalAs(UnmanagedType.LPWStr)] string wzContent,
139 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
140 [MarshalAs(UnmanagedType.Bool)] ref bool fStopProcessingUpdates
141 );
142
143 /// <summary>
144 /// See <see cref="IDefaultBootstrapperApplication.DetectUpdateComplete"/>.
145 /// </summary>
146 /// <param name="hrStatus"></param>
147 /// <param name="fIgnoreError"></param>
148 /// <returns></returns>
149 [PreserveSig]
150 [return: MarshalAs(UnmanagedType.I4)]
151 int OnDetectUpdateComplete(
152 int hrStatus,
153 [MarshalAs(UnmanagedType.Bool)] ref bool fIgnoreError
154 );
155
156 /// <summary>
157 /// See <see cref="IDefaultBootstrapperApplication.DetectRelatedBundle"/>.
158 /// </summary>
159 /// <param name="wzBundleId"></param>
160 /// <param name="relationType"></param>
161 /// <param name="wzBundleTag"></param>
162 /// <param name="fPerMachine"></param>
163 /// <param name="wzVersion"></param>
164 /// <param name="operation"></param>
165 /// <param name="fMissingFromCache"></param>
166 /// <param name="fCancel"></param>
167 /// <returns></returns>
168 [PreserveSig]
169 [return: MarshalAs(UnmanagedType.I4)]
170 int OnDetectRelatedBundle(
171 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
172 [MarshalAs(UnmanagedType.U4)] RelationType relationType,
173 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
174 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
175 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
176 [MarshalAs(UnmanagedType.U4)] RelatedOperation operation,
177 [MarshalAs(UnmanagedType.Bool)] bool fMissingFromCache,
178 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
179 );
180
181 /// <summary>
182 /// See <see cref="IDefaultBootstrapperApplication.DetectPackageBegin"/>.
183 /// </summary>
184 /// <param name="wzPackageId"></param>
185 /// <param name="fCancel"></param>
186 /// <returns></returns>
187 [PreserveSig]
188 [return: MarshalAs(UnmanagedType.I4)]
189 int OnDetectPackageBegin(
190 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
191 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
192 );
193
194 /// <summary>
195 /// See <see cref="IDefaultBootstrapperApplication.DetectRelatedMsiPackage"/>.
196 /// </summary>
197 /// <param name="wzPackageId"></param>
198 /// <param name="wzUpgradeCode"></param>
199 /// <param name="wzProductCode"></param>
200 /// <param name="fPerMachine"></param>
201 /// <param name="wzVersion"></param>
202 /// <param name="operation"></param>
203 /// <param name="fCancel"></param>
204 /// <returns></returns>
205 [PreserveSig]
206 [return: MarshalAs(UnmanagedType.I4)]
207 int OnDetectRelatedMsiPackage(
208 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
209 [MarshalAs(UnmanagedType.LPWStr)] string wzUpgradeCode,
210 [MarshalAs(UnmanagedType.LPWStr)] string wzProductCode,
211 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
212 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
213 [MarshalAs(UnmanagedType.U4)] RelatedOperation operation,
214 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
215 );
216
217 /// <summary>
218 /// See <see cref="IDefaultBootstrapperApplication.DetectPatchTarget"/>.
219 /// </summary>
220 /// <param name="wzPackageId"></param>
221 /// <param name="wzProductCode"></param>
222 /// <param name="patchState"></param>
223 /// <param name="fCancel"></param>
224 /// <returns></returns>
225 [PreserveSig]
226 [return: MarshalAs(UnmanagedType.I4)]
227 int OnDetectPatchTarget(
228 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
229 [MarshalAs(UnmanagedType.LPWStr)] string wzProductCode,
230 [MarshalAs(UnmanagedType.U4)] PackageState patchState,
231 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
232 );
233
234 /// <summary>
235 /// See <see cref="IDefaultBootstrapperApplication.DetectMsiFeature"/>.
236 /// </summary>
237 /// <param name="wzPackageId"></param>
238 /// <param name="wzFeatureId"></param>
239 /// <param name="state"></param>
240 /// <param name="fCancel"></param>
241 /// <returns></returns>
242 [PreserveSig]
243 [return: MarshalAs(UnmanagedType.I4)]
244 int OnDetectMsiFeature(
245 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
246 [MarshalAs(UnmanagedType.LPWStr)] string wzFeatureId,
247 [MarshalAs(UnmanagedType.U4)] FeatureState state,
248 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
249 );
250
251 /// <summary>
252 /// See <see cref="IDefaultBootstrapperApplication.DetectPackageComplete"/>.
253 /// </summary>
254 [PreserveSig]
255 [return: MarshalAs(UnmanagedType.I4)]
256 int OnDetectPackageComplete(
257 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
258 int hrStatus,
259 [MarshalAs(UnmanagedType.U4)] PackageState state,
260 [MarshalAs(UnmanagedType.Bool)] bool fCached
261 );
262
263 /// <summary>
264 /// See <see cref="IDefaultBootstrapperApplication.DetectComplete"/>.
265 /// </summary>
266 /// <param name="hrStatus"></param>
267 /// <param name="fEligibleForCleanup"></param>
268 /// <returns></returns>
269 [PreserveSig]
270 [return: MarshalAs(UnmanagedType.I4)]
271 int OnDetectComplete(
272 int hrStatus,
273 [MarshalAs(UnmanagedType.Bool)] bool fEligibleForCleanup
274 );
275
276 /// <summary>
277 /// See <see cref="IDefaultBootstrapperApplication.PlanBegin"/>.
278 /// </summary>
279 /// <param name="cPackages"></param>
280 /// <param name="fCancel"></param>
281 /// <returns></returns>
282 [PreserveSig]
283 [return: MarshalAs(UnmanagedType.I4)]
284 int OnPlanBegin(
285 [MarshalAs(UnmanagedType.U4)] int cPackages,
286 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
287 );
288
289 /// <summary>
290 /// See <see cref="IDefaultBootstrapperApplication.PlanRelatedBundle"/>.
291 /// </summary>
292 /// <param name="wzBundleId"></param>
293 /// <param name="recommendedState"></param>
294 /// <param name="pRequestedState"></param>
295 /// <param name="fCancel"></param>
296 /// <returns></returns>
297 [PreserveSig]
298 [return: MarshalAs(UnmanagedType.I4)]
299 int OnPlanRelatedBundle(
300 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
301 [MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
302 [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
303 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
304 );
305
306 /// <summary>
307 /// See <see cref="IDefaultBootstrapperApplication.PlanPackageBegin"/>.
308 /// </summary>
309 [PreserveSig]
310 [return: MarshalAs(UnmanagedType.I4)]
311 int OnPlanPackageBegin(
312 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
313 [MarshalAs(UnmanagedType.U4)] PackageState state,
314 [MarshalAs(UnmanagedType.Bool)] bool fCached,
315 [MarshalAs(UnmanagedType.U4)] BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition,
316 [MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
317 [MarshalAs(UnmanagedType.U4)] BOOTSTRAPPER_CACHE_TYPE recommendedCacheType,
318 [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
319 [MarshalAs(UnmanagedType.U4)] ref BOOTSTRAPPER_CACHE_TYPE pRequestedCacheType,
320 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
321 );
322
323 /// <summary>
324 /// See <see cref="IDefaultBootstrapperApplication.PlanPatchTarget"/>.
325 /// </summary>
326 /// <param name="wzPackageId"></param>
327 /// <param name="wzProductCode"></param>
328 /// <param name="recommendedState"></param>
329 /// <param name="pRequestedState"></param>
330 /// <param name="fCancel"></param>
331 /// <returns></returns>
332 [PreserveSig]
333 [return: MarshalAs(UnmanagedType.I4)]
334 int OnPlanPatchTarget(
335 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
336 [MarshalAs(UnmanagedType.LPWStr)] string wzProductCode,
337 [MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
338 [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
339 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
340 );
341
342 /// <summary>
343 /// See <see cref="IDefaultBootstrapperApplication.PlanMsiFeature"/>.
344 /// </summary>
345 /// <param name="wzPackageId"></param>
346 /// <param name="wzFeatureId"></param>
347 /// <param name="recommendedState"></param>
348 /// <param name="pRequestedState"></param>
349 /// <param name="fCancel"></param>
350 /// <returns></returns>
351 [PreserveSig]
352 [return: MarshalAs(UnmanagedType.I4)]
353 int OnPlanMsiFeature(
354 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
355 [MarshalAs(UnmanagedType.LPWStr)] string wzFeatureId,
356 [MarshalAs(UnmanagedType.U4)] FeatureState recommendedState,
357 [MarshalAs(UnmanagedType.U4)] ref FeatureState pRequestedState,
358 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
359 );
360
361 /// <summary>
362 /// See <see cref="IDefaultBootstrapperApplication.PlanMsiPackage"/>.
363 /// </summary>
364 /// <param name="wzPackageId"></param>
365 /// <param name="fExecute"></param>
366 /// <param name="action"></param>
367 /// <param name="fCancel"></param>
368 /// <param name="actionMsiProperty"></param>
369 /// <param name="uiLevel"></param>
370 /// <param name="fDisableExternalUiHandler"></param>
371 /// <returns></returns>
372 [PreserveSig]
373 [return: MarshalAs(UnmanagedType.I4)]
374 int OnPlanMsiPackage(
375 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
376 [MarshalAs(UnmanagedType.Bool)] bool fExecute,
377 [MarshalAs(UnmanagedType.U4)] ActionState action,
378 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
379 [MarshalAs(UnmanagedType.U4)] ref BURN_MSI_PROPERTY actionMsiProperty,
380 [MarshalAs(UnmanagedType.U4)] ref INSTALLUILEVEL uiLevel,
381 [MarshalAs(UnmanagedType.Bool)] ref bool fDisableExternalUiHandler
382 );
383
384 /// <summary>
385 /// See <see cref="IDefaultBootstrapperApplication.PlanPackageComplete"/>.
386 /// </summary>
387 /// <param name="wzPackageId"></param>
388 /// <param name="hrStatus"></param>
389 /// <param name="requested"></param>
390 /// <returns></returns>
391 [PreserveSig]
392 [return: MarshalAs(UnmanagedType.I4)]
393 int OnPlanPackageComplete(
394 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
395 int hrStatus,
396 [MarshalAs(UnmanagedType.U4)] RequestState requested
397 );
398
399 /// <summary>
400 /// See <see cref="IDefaultBootstrapperApplication.PlannedPackage"/>.
401 /// </summary>
402 [PreserveSig]
403 [return: MarshalAs(UnmanagedType.I4)]
404 int OnPlannedPackage(
405 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
406 [MarshalAs(UnmanagedType.U4)] ActionState execute,
407 [MarshalAs(UnmanagedType.U4)] ActionState rollback,
408 [MarshalAs(UnmanagedType.Bool)] bool fPlannedCache,
409 [MarshalAs(UnmanagedType.Bool)] bool fPlannedUncache
410 );
411
412 /// <summary>
413 /// See <see cref="IDefaultBootstrapperApplication.PlanComplete"/>.
414 /// </summary>
415 /// <param name="hrStatus"></param>
416 /// <returns></returns>
417 [PreserveSig]
418 [return: MarshalAs(UnmanagedType.I4)]
419 int OnPlanComplete(
420 int hrStatus
421 );
422
423 /// <summary>
424 /// See <see cref="IDefaultBootstrapperApplication.ApplyBegin"/>.
425 /// </summary>
426 /// <param name="dwPhaseCount"></param>
427 /// <param name="fCancel"></param>
428 /// <returns></returns>
429 [PreserveSig]
430 [return: MarshalAs(UnmanagedType.I4)]
431 int OnApplyBegin(
432 [MarshalAs(UnmanagedType.U4)] int dwPhaseCount,
433 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
434 );
435
436 /// <summary>
437 /// See <see cref="IDefaultBootstrapperApplication.ElevateBegin"/>.
438 /// </summary>
439 /// <param name="fCancel"></param>
440 /// <returns></returns>
441 [PreserveSig]
442 [return: MarshalAs(UnmanagedType.I4)]
443 int OnElevateBegin(
444 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
445 );
446
447 /// <summary>
448 /// See <see cref="IDefaultBootstrapperApplication.ElevateComplete"/>.
449 /// </summary>
450 /// <param name="hrStatus"></param>
451 /// <returns></returns>
452 [PreserveSig]
453 [return: MarshalAs(UnmanagedType.I4)]
454 int OnElevateComplete(
455 int hrStatus
456 );
457
458 /// <summary>
459 /// See <see cref="IDefaultBootstrapperApplication.Progress"/>.
460 /// </summary>
461 /// <param name="dwProgressPercentage"></param>
462 /// <param name="dwOverallPercentage"></param>
463 /// <param name="fCancel"></param>
464 /// <returns></returns>
465 [PreserveSig]
466 [return: MarshalAs(UnmanagedType.I4)]
467 int OnProgress(
468 [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage,
469 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
470 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
471 );
472
473 /// <summary>
474 /// See <see cref="IDefaultBootstrapperApplication.Error"/>.
475 /// </summary>
476 /// <param name="errorType"></param>
477 /// <param name="wzPackageId"></param>
478 /// <param name="dwCode"></param>
479 /// <param name="wzError"></param>
480 /// <param name="dwUIHint"></param>
481 /// <param name="cData"></param>
482 /// <param name="rgwzData"></param>
483 /// <param name="nRecommendation"></param>
484 /// <param name="pResult"></param>
485 /// <returns></returns>
486 [PreserveSig]
487 [return: MarshalAs(UnmanagedType.I4)]
488 int OnError(
489 [MarshalAs(UnmanagedType.U4)] ErrorType errorType,
490 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
491 [MarshalAs(UnmanagedType.U4)] int dwCode,
492 [MarshalAs(UnmanagedType.LPWStr)] string wzError,
493 [MarshalAs(UnmanagedType.I4)] int dwUIHint,
494 [MarshalAs(UnmanagedType.U4)] int cData,
495 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 5, ArraySubType = UnmanagedType.LPWStr), In] string[] rgwzData,
496 [MarshalAs(UnmanagedType.I4)] Result nRecommendation,
497 [MarshalAs(UnmanagedType.I4)] ref Result pResult
498 );
499
500 /// <summary>
501 /// See <see cref="IDefaultBootstrapperApplication.RegisterBegin"/>.
502 /// </summary>
503 /// <param name="fCancel"></param>
504 /// <returns></returns>
505 [PreserveSig]
506 [return: MarshalAs(UnmanagedType.I4)]
507 int OnRegisterBegin(
508 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
509 );
510
511 /// <summary>
512 /// See <see cref="IDefaultBootstrapperApplication.RegisterComplete"/>.
513 /// </summary>
514 /// <param name="hrStatus"></param>
515 /// <returns></returns>
516 [PreserveSig]
517 [return: MarshalAs(UnmanagedType.I4)]
518 int OnRegisterComplete(
519 int hrStatus
520 );
521
522 /// <summary>
523 /// See <see cref="IDefaultBootstrapperApplication.CacheBegin"/>.
524 /// </summary>
525 /// <param name="fCancel"></param>
526 /// <returns></returns>
527 [PreserveSig]
528 [return: MarshalAs(UnmanagedType.I4)]
529 int OnCacheBegin(
530 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
531 );
532
533 /// <summary>
534 /// See <see cref="IDefaultBootstrapperApplication.CachePackageBegin"/>.
535 /// </summary>
536 /// <param name="wzPackageId"></param>
537 /// <param name="cCachePayloads"></param>
538 /// <param name="dw64PackageCacheSize"></param>
539 /// <param name="fCancel"></param>
540 /// <returns></returns>
541 [PreserveSig]
542 [return: MarshalAs(UnmanagedType.I4)]
543 int OnCachePackageBegin(
544 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
545 [MarshalAs(UnmanagedType.U4)] int cCachePayloads,
546 [MarshalAs(UnmanagedType.U8)] long dw64PackageCacheSize,
547 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
548 );
549
550 /// <summary>
551 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireBegin"/>.
552 /// </summary>
553 [PreserveSig]
554 [return: MarshalAs(UnmanagedType.I4)]
555 int OnCacheAcquireBegin(
556 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
557 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
558 [MarshalAs(UnmanagedType.LPWStr)] string wzSource,
559 [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadUrl,
560 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadContainerId,
561 [MarshalAs(UnmanagedType.U4)] CacheOperation recommendation,
562 [MarshalAs(UnmanagedType.I4)] ref CacheOperation action,
563 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
564 );
565
566 /// <summary>
567 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireProgress"/>.
568 /// </summary>
569 [PreserveSig]
570 [return: MarshalAs(UnmanagedType.I4)]
571 int OnCacheAcquireProgress(
572 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
573 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
574 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
575 [MarshalAs(UnmanagedType.U8)] long dw64Total,
576 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
577 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
578 );
579
580 /// <summary>
581 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>.
582 /// </summary>
583 [PreserveSig]
584 [return: MarshalAs(UnmanagedType.I4)]
585 int OnCacheAcquireResolving(
586 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
587 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
588 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3, ArraySubType = UnmanagedType.LPWStr), In] string[] searchPaths,
589 [MarshalAs(UnmanagedType.U4)] int cSearchPaths,
590 [MarshalAs(UnmanagedType.Bool)] bool fFoundLocal,
591 [MarshalAs(UnmanagedType.U4)] int dwRecommendedSearchPath,
592 [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadUrl,
593 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadContainerId,
594 [MarshalAs(UnmanagedType.I4)] CacheResolveOperation recommendation,
595 [MarshalAs(UnmanagedType.U4)] ref int dwChosenSearchPath,
596 [MarshalAs(UnmanagedType.I4)] ref CacheResolveOperation action,
597 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
598 );
599
600 /// <summary>
601 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>.
602 /// </summary>
603 [PreserveSig]
604 [return: MarshalAs(UnmanagedType.I4)]
605 int OnCacheAcquireComplete(
606 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
607 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
608 int hrStatus,
609 BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation,
610 ref BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION pAction
611 );
612
613 /// <summary>
614 /// See <see cref="IDefaultBootstrapperApplication.CacheVerifyBegin"/>.
615 /// </summary>
616 [PreserveSig]
617 [return: MarshalAs(UnmanagedType.I4)]
618 int OnCacheVerifyBegin(
619 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
620 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
621 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
622 );
623
624 /// <summary>
625 /// See <see cref="IDefaultBootstrapperApplication.CacheVerifyProgress"/>.
626 /// </summary>
627 [PreserveSig]
628 [return: MarshalAs(UnmanagedType.I4)]
629 int OnCacheVerifyProgress(
630 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
631 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
632 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
633 [MarshalAs(UnmanagedType.U8)] long dw64Total,
634 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
635 [MarshalAs(UnmanagedType.I4)] CacheVerifyStep verifyStep,
636 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
637 );
638
639 /// <summary>
640 /// See <see cref="IDefaultBootstrapperApplication.CacheVerifyComplete"/>.
641 /// </summary>
642 [PreserveSig]
643 [return: MarshalAs(UnmanagedType.I4)]
644 int OnCacheVerifyComplete(
645 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
646 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
647 int hrStatus,
648 BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation,
649 ref BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action
650 );
651
652 /// <summary>
653 /// See <see cref="IDefaultBootstrapperApplication.CachePackageComplete"/>.
654 /// </summary>
655 /// <param name="wzPackageId"></param>
656 /// <param name="hrStatus"></param>
657 /// <param name="recommendation"></param>
658 /// <param name="action"></param>
659 /// <returns></returns>
660 [PreserveSig]
661 [return: MarshalAs(UnmanagedType.I4)]
662 int OnCachePackageComplete(
663 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
664 int hrStatus,
665 BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation,
666 ref BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action
667 );
668
669 /// <summary>
670 /// See <see cref="IDefaultBootstrapperApplication.CacheComplete"/>.
671 /// </summary>
672 /// <param name="hrStatus"></param>
673 /// <returns></returns>
674 [PreserveSig]
675 [return: MarshalAs(UnmanagedType.I4)]
676 int OnCacheComplete(
677 int hrStatus
678 );
679
680 /// <summary>
681 /// See <see cref="IDefaultBootstrapperApplication.ExecuteBegin"/>.
682 /// </summary>
683 /// <param name="cExecutingPackages"></param>
684 /// <param name="fCancel"></param>
685 /// <returns></returns>
686 [PreserveSig]
687 [return: MarshalAs(UnmanagedType.I4)]
688 int OnExecuteBegin(
689 [MarshalAs(UnmanagedType.U4)] int cExecutingPackages,
690 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
691 );
692
693 /// <summary>
694 /// See <see cref="IDefaultBootstrapperApplication.ExecutePackageBegin"/>.
695 /// </summary>
696 /// <param name="wzPackageId"></param>
697 /// <param name="fExecute"></param>
698 /// <param name="action"></param>
699 /// <param name="uiLevel"></param>
700 /// <param name="fDisableExternalUiHandler"></param>
701 /// <param name="fCancel"></param>
702 /// <returns></returns>
703 [PreserveSig]
704 [return: MarshalAs(UnmanagedType.I4)]
705 int OnExecutePackageBegin(
706 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
707 [MarshalAs(UnmanagedType.Bool)] bool fExecute,
708 [MarshalAs(UnmanagedType.U4)] ActionState action,
709 [MarshalAs(UnmanagedType.U4)] INSTALLUILEVEL uiLevel,
710 [MarshalAs(UnmanagedType.Bool)] bool fDisableExternalUiHandler,
711 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
712 );
713
714 /// <summary>
715 /// See <see cref="IDefaultBootstrapperApplication.ExecutePatchTarget"/>.
716 /// </summary>
717 /// <param name="wzPackageId"></param>
718 /// <param name="wzTargetProductCode"></param>
719 /// <param name="fCancel"></param>
720 /// <returns></returns>
721 [PreserveSig]
722 [return: MarshalAs(UnmanagedType.I4)]
723 int OnExecutePatchTarget(
724 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
725 [MarshalAs(UnmanagedType.LPWStr)] string wzTargetProductCode,
726 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
727 );
728
729 /// <summary>
730 /// See <see cref="IDefaultBootstrapperApplication.ExecuteProgress"/>.
731 /// </summary>
732 /// <param name="wzPackageId"></param>
733 /// <param name="dwProgressPercentage"></param>
734 /// <param name="dwOverallPercentage"></param>
735 /// <param name="fCancel"></param>
736 /// <returns></returns>
737 [PreserveSig]
738 [return: MarshalAs(UnmanagedType.I4)]
739 int OnExecuteProgress(
740 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
741 [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage,
742 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
743 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
744 );
745
746 /// <summary>
747 /// See <see cref="IDefaultBootstrapperApplication.ExecuteMsiMessage"/>.
748 /// </summary>
749 /// <param name="wzPackageId"></param>
750 /// <param name="messageType"></param>
751 /// <param name="dwUIHint"></param>
752 /// <param name="wzMessage"></param>
753 /// <param name="cData"></param>
754 /// <param name="rgwzData"></param>
755 /// <param name="nRecommendation"></param>
756 /// <param name="pResult"></param>
757 /// <returns></returns>
758 [PreserveSig]
759 [return: MarshalAs(UnmanagedType.I4)]
760 int OnExecuteMsiMessage(
761 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
762 [MarshalAs(UnmanagedType.U4)] InstallMessage messageType,
763 [MarshalAs(UnmanagedType.I4)] int dwUIHint,
764 [MarshalAs(UnmanagedType.LPWStr)] string wzMessage,
765 [MarshalAs(UnmanagedType.U4)] int cData,
766 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.LPWStr), In] string[] rgwzData,
767 [MarshalAs(UnmanagedType.I4)] Result nRecommendation,
768 [MarshalAs(UnmanagedType.I4)] ref Result pResult
769 );
770
771 /// <summary>
772 /// See <see cref="IDefaultBootstrapperApplication.ExecuteFilesInUse"/>.
773 /// </summary>
774 /// <param name="wzPackageId"></param>
775 /// <param name="cFiles"></param>
776 /// <param name="rgwzFiles"></param>
777 /// <param name="nRecommendation"></param>
778 /// <param name="pResult"></param>
779 /// <returns></returns>
780 [PreserveSig]
781 [return: MarshalAs(UnmanagedType.I4)]
782 int OnExecuteFilesInUse(
783 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
784 [MarshalAs(UnmanagedType.U4)] int cFiles,
785 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.LPWStr), In] string[] rgwzFiles,
786 [MarshalAs(UnmanagedType.I4)] Result nRecommendation,
787 [MarshalAs(UnmanagedType.I4)] ref Result pResult
788 );
789
790 /// <summary>
791 /// See <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
792 /// </summary>
793 /// <param name="wzPackageId"></param>
794 /// <param name="hrStatus"></param>
795 /// <param name="restart"></param>
796 /// <param name="recommendation"></param>
797 /// <param name="pAction"></param>
798 /// <returns></returns>
799 [PreserveSig]
800 [return: MarshalAs(UnmanagedType.I4)]
801 int OnExecutePackageComplete(
802 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
803 int hrStatus,
804 [MarshalAs(UnmanagedType.U4)] ApplyRestart restart,
805 [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation,
806 [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION pAction
807 );
808
809 /// <summary>
810 /// See <see cref="IDefaultBootstrapperApplication.ExecuteComplete"/>.
811 /// </summary>
812 /// <param name="hrStatus"></param>
813 /// <returns></returns>
814 [PreserveSig]
815 [return: MarshalAs(UnmanagedType.I4)]
816 int OnExecuteComplete(
817 int hrStatus
818 );
819
820 /// <summary>
821 /// See <see cref="IDefaultBootstrapperApplication.UnregisterBegin"/>.
822 /// </summary>
823 /// <param name="fKeepRegistration"></param>
824 /// <param name="fForceKeepRegistration"></param>
825 /// <returns></returns>
826 [PreserveSig]
827 [return: MarshalAs(UnmanagedType.I4)]
828 int OnUnregisterBegin(
829 [MarshalAs(UnmanagedType.Bool)] bool fKeepRegistration,
830 [MarshalAs(UnmanagedType.Bool)] ref bool fForceKeepRegistration
831 );
832
833 /// <summary>
834 /// See <see cref="IDefaultBootstrapperApplication.UnregisterComplete"/>.
835 /// </summary>
836 /// <param name="hrStatus"></param>
837 /// <returns></returns>
838 [PreserveSig]
839 [return: MarshalAs(UnmanagedType.I4)]
840 int OnUnregisterComplete(
841 int hrStatus
842 );
843
844 /// <summary>
845 /// See <see cref="IDefaultBootstrapperApplication.ApplyComplete"/>.
846 /// </summary>
847 /// <param name="hrStatus"></param>
848 /// <param name="restart"></param>
849 /// <param name="recommendation"></param>
850 /// <param name="pAction"></param>
851 /// <returns></returns>
852 [PreserveSig]
853 [return: MarshalAs(UnmanagedType.I4)]
854 int OnApplyComplete(
855 int hrStatus,
856 [MarshalAs(UnmanagedType.U4)] ApplyRestart restart,
857 [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation,
858 [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_APPLYCOMPLETE_ACTION pAction
859 );
860
861 /// <summary>
862 /// See <see cref="IDefaultBootstrapperApplication.LaunchApprovedExeBegin"/>.
863 /// </summary>
864 /// <param name="fCancel"></param>
865 /// <returns></returns>
866 [PreserveSig]
867 [return: MarshalAs(UnmanagedType.I4)]
868 int OnLaunchApprovedExeBegin(
869 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
870 );
871
872 /// <summary>
873 /// See <see cref="IDefaultBootstrapperApplication.LaunchApprovedExeComplete"/>.
874 /// </summary>
875 /// <param name="hrStatus"></param>
876 /// <param name="processId"></param>
877 /// <returns></returns>
878 [PreserveSig]
879 [return: MarshalAs(UnmanagedType.I4)]
880 int OnLaunchApprovedExeComplete(
881 int hrStatus,
882 int processId
883 );
884
885 /// <summary>
886 /// See <see cref="IDefaultBootstrapperApplication.BeginMsiTransactionBegin"/>.
887 /// </summary>
888 /// <param name="wzTransactionId"></param>
889 /// <param name="fCancel"></param>
890 /// <returns></returns>
891 [PreserveSig]
892 [return: MarshalAs(UnmanagedType.I4)]
893 int OnBeginMsiTransactionBegin(
894 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
895 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
896 );
897
898 /// <summary>
899 /// See <see cref="IDefaultBootstrapperApplication.BeginMsiTransactionComplete"/>.
900 /// </summary>
901 /// <param name="wzTransactionId"></param>
902 /// <param name="hrStatus"></param>
903 /// <returns></returns>
904 [PreserveSig]
905 [return: MarshalAs(UnmanagedType.I4)]
906 int OnBeginMsiTransactionComplete(
907 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
908 int hrStatus
909 );
910
911 /// <summary>
912 /// See <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionBegin"/>.
913 /// </summary>
914 /// <param name="wzTransactionId"></param>
915 /// <param name="fCancel"></param>
916 /// <returns></returns>
917 [PreserveSig]
918 [return: MarshalAs(UnmanagedType.I4)]
919 int OnCommitMsiTransactionBegin(
920 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
921 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
922 );
923
924 /// <summary>
925 /// See <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionComplete"/>.
926 /// </summary>
927 /// <param name="wzTransactionId"></param>
928 /// <param name="hrStatus"></param>
929 /// <returns></returns>
930 [PreserveSig]
931 [return: MarshalAs(UnmanagedType.I4)]
932 int OnCommitMsiTransactionComplete(
933 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
934 int hrStatus
935 );
936
937 /// <summary>
938 /// See <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionBegin"/>.
939 /// </summary>
940 /// <param name="wzTransactionId"></param>
941 /// <returns></returns>
942 [PreserveSig]
943 [return: MarshalAs(UnmanagedType.I4)]
944 int OnRollbackMsiTransactionBegin(
945 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId
946 );
947
948 /// <summary>
949 /// See <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionComplete"/>.
950 /// </summary>
951 /// <param name="wzTransactionId"></param>
952 /// <param name="hrStatus"></param>
953 /// <returns></returns>
954 [PreserveSig]
955 [return: MarshalAs(UnmanagedType.I4)]
956 int OnRollbackMsiTransactionComplete(
957 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
958 int hrStatus
959 );
960
961 /// <summary>
962 /// See <see cref="IDefaultBootstrapperApplication.PauseAutomaticUpdatesBegin"/>.
963 /// </summary>
964 /// <returns></returns>
965 [PreserveSig]
966 [return: MarshalAs(UnmanagedType.I4)]
967 int OnPauseAutomaticUpdatesBegin(
968 );
969
970 /// <summary>
971 /// See <see cref="IDefaultBootstrapperApplication.PauseAutomaticUpdatesComplete"/>.
972 /// </summary>
973 /// <param name="hrStatus"></param>
974 /// <returns></returns>
975 [PreserveSig]
976 [return: MarshalAs(UnmanagedType.I4)]
977 int OnPauseAutomaticUpdatesComplete(
978 int hrStatus
979 );
980
981 /// <summary>
982 /// See <see cref="IDefaultBootstrapperApplication.SystemRestorePointBegin"/>.
983 /// </summary>
984 /// <returns></returns>
985 [PreserveSig]
986 [return: MarshalAs(UnmanagedType.I4)]
987 int OnSystemRestorePointBegin(
988 );
989
990 /// <summary>
991 /// See <see cref="IDefaultBootstrapperApplication.SystemRestorePointComplete"/>.
992 /// </summary>
993 /// <param name="hrStatus"></param>
994 /// <returns></returns>
995 [PreserveSig]
996 [return: MarshalAs(UnmanagedType.I4)]
997 int OnSystemRestorePointComplete(
998 int hrStatus
999 );
1000
1001 /// <summary>
1002 /// See <see cref="IDefaultBootstrapperApplication.PlanForwardCompatibleBundle"/>.
1003 /// </summary>
1004 /// <param name="wzBundleId"></param>
1005 /// <param name="relationType"></param>
1006 /// <param name="wzBundleTag"></param>
1007 /// <param name="fPerMachine"></param>
1008 /// <param name="wzVersion"></param>
1009 /// <param name="fRecommendedIgnoreBundle"></param>
1010 /// <param name="fCancel"></param>
1011 /// <param name="fIgnoreBundle"></param>
1012 /// <returns></returns>
1013 [PreserveSig]
1014 [return: MarshalAs(UnmanagedType.I4)]
1015 int OnPlanForwardCompatibleBundle(
1016 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
1017 [MarshalAs(UnmanagedType.U4)] RelationType relationType,
1018 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
1019 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
1020 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
1021 [MarshalAs(UnmanagedType.Bool)] bool fRecommendedIgnoreBundle,
1022 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
1023 [MarshalAs(UnmanagedType.Bool)] ref bool fIgnoreBundle
1024 );
1025
1026 /// <summary>
1027 /// See <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyBegin"/>.
1028 /// </summary>
1029 [PreserveSig]
1030 [return: MarshalAs(UnmanagedType.I4)]
1031 int OnCacheContainerOrPayloadVerifyBegin(
1032 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
1033 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
1034 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
1035 );
1036
1037 /// <summary>
1038 /// See <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyProgress"/>.
1039 /// </summary>
1040 [PreserveSig]
1041 [return: MarshalAs(UnmanagedType.I4)]
1042 int OnCacheContainerOrPayloadVerifyProgress(
1043 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
1044 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
1045 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
1046 [MarshalAs(UnmanagedType.U8)] long dw64Total,
1047 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
1048 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
1049 );
1050
1051 /// <summary>
1052 /// See <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyComplete"/>.
1053 /// </summary>
1054 [PreserveSig]
1055 [return: MarshalAs(UnmanagedType.I4)]
1056 int OnCacheContainerOrPayloadVerifyComplete(
1057 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
1058 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
1059 int hrStatus
1060 );
1061
1062 /// <summary>
1063 /// See <see cref="IDefaultBootstrapperApplication.CachePayloadExtractBegin"/>.
1064 /// </summary>
1065 [PreserveSig]
1066 [return: MarshalAs(UnmanagedType.I4)]
1067 int OnCachePayloadExtractBegin(
1068 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
1069 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
1070 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
1071 );
1072
1073 /// <summary>
1074 /// See <see cref="IDefaultBootstrapperApplication.CachePayloadExtractProgress"/>.
1075 /// </summary>
1076 [PreserveSig]
1077 [return: MarshalAs(UnmanagedType.I4)]
1078 int OnCachePayloadExtractProgress(
1079 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
1080 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
1081 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
1082 [MarshalAs(UnmanagedType.U8)] long dw64Total,
1083 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
1084 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
1085 );
1086
1087 /// <summary>
1088 /// See <see cref="IDefaultBootstrapperApplication.CachePayloadExtractComplete"/>.
1089 /// </summary>
1090 [PreserveSig]
1091 [return: MarshalAs(UnmanagedType.I4)]
1092 int OnCachePayloadExtractComplete(
1093 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
1094 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
1095 int hrStatus
1096 );
1097 }
1098
1099 /// <summary>
1100 /// The display level for the BA.
1101 /// </summary>
1102 public enum Display
1103 {
1104 /// <summary>
1105 ///
1106 /// </summary>
1107 Unknown,
1108
1109 /// <summary>
1110 ///
1111 /// </summary>
1112 Embedded,
1113
1114 /// <summary>
1115 ///
1116 /// </summary>
1117 None,
1118
1119 /// <summary>
1120 ///
1121 /// </summary>
1122 Passive,
1123
1124 /// <summary>
1125 ///
1126 /// </summary>
1127 Full,
1128 }
1129
1130 /// <summary>
1131 /// Messages from Windows Installer (msi.h).
1132 /// </summary>
1133 public enum InstallMessage
1134 {
1135 /// <summary>
1136 /// premature termination, possibly fatal OOM
1137 /// </summary>
1138 FatalExit,
1139
1140 /// <summary>
1141 /// formatted error message
1142 /// </summary>
1143 Error = 0x01000000,
1144
1145 /// <summary>
1146 /// formatted warning message
1147 /// </summary>
1148 Warning = 0x02000000,
1149
1150 /// <summary>
1151 /// user request message
1152 /// </summary>
1153 User = 0x03000000,
1154
1155 /// <summary>
1156 /// informative message for log
1157 /// </summary>
1158 Info = 0x04000000,
1159
1160 /// <summary>
1161 /// list of files in use that need to be replaced
1162 /// </summary>
1163 FilesInUse = 0x05000000,
1164
1165 /// <summary>
1166 /// request to determine a valid source location
1167 /// </summary>
1168 ResolveSource = 0x06000000,
1169
1170 /// <summary>
1171 /// insufficient disk space message
1172 /// </summary>
1173 OutOfDiskSpace = 0x07000000,
1174
1175 /// <summary>
1176 /// start of action: action name &amp; description
1177 /// </summary>
1178 ActionStart = 0x08000000,
1179
1180 /// <summary>
1181 /// formatted data associated with individual action item
1182 /// </summary>
1183 ActionData = 0x09000000,
1184
1185 /// <summary>
1186 /// progress gauge info: units so far, total
1187 /// </summary>
1188 Progress = 0x0a000000,
1189
1190 /// <summary>
1191 /// product info for dialog: language Id, dialog caption
1192 /// </summary>
1193 CommonData = 0x0b000000,
1194
1195 /// <summary>
1196 /// sent prior to UI initialization, no string data
1197 /// </summary>
1198 Initialize = 0x0c000000,
1199
1200 /// <summary>
1201 /// sent after UI termination, no string data
1202 /// </summary>
1203 Terminate = 0x0d000000,
1204
1205 /// <summary>
1206 /// sent prior to display or authored dialog or wizard
1207 /// </summary>
1208 ShowDialog = 0x0e000000,
1209
1210 /// <summary>
1211 /// log only, to log performance number like action time
1212 /// </summary>
1213 Performance = 0x0f000000,
1214
1215 /// <summary>
1216 /// the list of apps that the user can request Restart Manager to shut down and restart
1217 /// </summary>
1218 RMFilesInUse = 0x19000000,
1219
1220 /// <summary>
1221 /// sent prior to server-side install of a product
1222 /// </summary>
1223 InstallStart = 0x1a000000,
1224
1225 /// <summary>
1226 /// sent after server-side install
1227 /// </summary>
1228 InstallEnd = 0x1B000000,
1229 }
1230
1231 /// <summary>
1232 /// The action to perform when a reboot is necessary.
1233 /// </summary>
1234 public enum Restart
1235 {
1236 /// <summary>
1237 ///
1238 /// </summary>
1239 Unknown,
1240
1241 /// <summary>
1242 ///
1243 /// </summary>
1244 Never,
1245
1246 /// <summary>
1247 ///
1248 /// </summary>
1249 Prompt,
1250
1251 /// <summary>
1252 ///
1253 /// </summary>
1254 Automatic,
1255
1256 /// <summary>
1257 ///
1258 /// </summary>
1259 Always,
1260 }
1261
1262 /// <summary>
1263 /// Result codes (based on Dialog Box Command IDs from WinUser.h).
1264 /// </summary>
1265 public enum Result
1266 {
1267 /// <summary>
1268 ///
1269 /// </summary>
1270 Error = -1,
1271
1272 /// <summary>
1273 ///
1274 /// </summary>
1275 None,
1276
1277 /// <summary>
1278 ///
1279 /// </summary>
1280 Ok,
1281
1282 /// <summary>
1283 ///
1284 /// </summary>
1285 Cancel,
1286
1287 /// <summary>
1288 ///
1289 /// </summary>
1290 Abort,
1291
1292 /// <summary>
1293 ///
1294 /// </summary>
1295 Retry,
1296
1297 /// <summary>
1298 ///
1299 /// </summary>
1300 Ignore,
1301
1302 /// <summary>
1303 ///
1304 /// </summary>
1305 Yes,
1306
1307 /// <summary>
1308 ///
1309 /// </summary>
1310 No,
1311
1312 /// <summary>
1313 /// /
1314 /// </summary>
1315 Close,
1316
1317 /// <summary>
1318 ///
1319 /// </summary>
1320 Help,
1321
1322 /// <summary>
1323 ///
1324 /// </summary>
1325 TryAgain,
1326
1327 /// <summary>
1328 ///
1329 /// </summary>
1330 Continue,
1331 }
1332
1333 /// <summary>
1334 /// Describes why a bundle or packaged is being resumed.
1335 /// </summary>
1336 public enum ResumeType
1337 {
1338 /// <summary>
1339 ///
1340 /// </summary>
1341 None,
1342
1343 /// <summary>
1344 /// Resume information exists but is invalid.
1345 /// </summary>
1346 Invalid,
1347
1348 /// <summary>
1349 /// The bundle was re-launched after an unexpected interruption.
1350 /// </summary>
1351 Interrupted,
1352
1353 /// <summary>
1354 /// A reboot is pending.
1355 /// </summary>
1356 RebootPending,
1357
1358 /// <summary>
1359 /// The bundle was re-launched after a reboot.
1360 /// </summary>
1361 Reboot,
1362
1363 /// <summary>
1364 /// The bundle was re-launched after being suspended.
1365 /// </summary>
1366 Suspend,
1367
1368 /// <summary>
1369 /// The bundle was launched from Add/Remove Programs.
1370 /// </summary>
1371 Arp,
1372 }
1373
1374 /// <summary>
1375 /// Indicates what caused the error.
1376 /// </summary>
1377 public enum ErrorType
1378 {
1379 /// <summary>
1380 /// The error occurred trying to elevate.
1381 /// </summary>
1382 Elevate,
1383
1384 /// <summary>
1385 /// The error came from the Windows Installer.
1386 /// </summary>
1387 WindowsInstaller,
1388
1389 /// <summary>
1390 /// The error came from an EXE Package.
1391 /// </summary>
1392 ExePackage,
1393
1394 /// <summary>
1395 /// The error came while trying to authenticate with an HTTP server.
1396 /// </summary>
1397 HttpServerAuthentication,
1398
1399 /// <summary>
1400 /// The error came while trying to authenticate with an HTTP proxy.
1401 /// </summary>
1402 HttpProxyAuthentication,
1403
1404 /// <summary>
1405 /// The error occurred during apply.
1406 /// </summary>
1407 Apply,
1408 };
1409
1410 /// <summary>
1411 /// The calculated operation for the related bundle.
1412 /// </summary>
1413 public enum RelatedOperation
1414 {
1415 /// <summary>
1416 ///
1417 /// </summary>
1418 None,
1419
1420 /// <summary>
1421 /// The related bundle or package will be downgraded.
1422 /// </summary>
1423 Downgrade,
1424
1425 /// <summary>
1426 /// The related package will be upgraded as a minor revision.
1427 /// </summary>
1428 MinorUpdate,
1429
1430 /// <summary>
1431 /// The related bundle or package will be upgraded as a major revision.
1432 /// </summary>
1433 MajorUpgrade,
1434
1435 /// <summary>
1436 /// The related bundle will be removed.
1437 /// </summary>
1438 Remove,
1439
1440 /// <summary>
1441 /// The related bundle will be installed.
1442 /// </summary>
1443 Install,
1444
1445 /// <summary>
1446 /// The related bundle will be repaired.
1447 /// </summary>
1448 Repair,
1449 };
1450
1451 /// <summary>
1452 /// The cache operation used to acquire a container or payload.
1453 /// </summary>
1454 public enum CacheOperation
1455 {
1456 /// <summary>
1457 /// There is no source available.
1458 /// </summary>
1459 None,
1460
1461 /// <summary>
1462 /// Copy the payload or container from the chosen local source.
1463 /// </summary>
1464 Copy,
1465
1466 /// <summary>
1467 /// Download the payload or container using the download URL.
1468 /// </summary>
1469 Download,
1470
1471 /// <summary>
1472 /// Extract the payload from the container.
1473 /// </summary>
1474 Extract,
1475 }
1476
1477 /// <summary>
1478 /// The source to be used to acquire a container or payload.
1479 /// </summary>
1480 public enum CacheResolveOperation
1481 {
1482 /// <summary>
1483 /// There is no source available.
1484 /// </summary>
1485 None,
1486
1487 /// <summary>
1488 /// Copy the payload or container from the chosen local source.
1489 /// </summary>
1490 Local,
1491
1492 /// <summary>
1493 /// Download the payload or container from the download URL.
1494 /// </summary>
1495 Download,
1496
1497 /// <summary>
1498 /// Extract the payload from the container.
1499 /// </summary>
1500 Container,
1501
1502 /// <summary>
1503 /// Look again for the payload or container locally.
1504 /// </summary>
1505 Retry,
1506 }
1507
1508 /// <summary>
1509 /// The current step when verifying a container or payload.
1510 /// </summary>
1511 public enum CacheVerifyStep
1512 {
1513 /// <summary>
1514 /// Copying or moving the file from the working path to the unverified path.
1515 /// Not used during Layout.
1516 /// </summary>
1517 Stage,
1518 /// <summary>
1519 /// Hashing the file.
1520 /// </summary>
1521 Hash,
1522 /// <summary>
1523 /// Copying or moving the file to the final location.
1524 /// </summary>
1525 Finalize,
1526 }
1527
1528 /// <summary>
1529 /// The restart state after a package or all packages were applied.
1530 /// </summary>
1531 public enum ApplyRestart
1532 {
1533 /// <summary>
1534 /// Package or chain does not require a restart.
1535 /// </summary>
1536 None,
1537
1538 /// <summary>
1539 /// Package or chain requires a restart but it has not been initiated yet.
1540 /// </summary>
1541 RestartRequired,
1542
1543 /// <summary>
1544 /// Package or chain has already initiated the restart.
1545 /// </summary>
1546 RestartInitiated
1547 }
1548
1549 /// <summary>
1550 /// The relation type for related bundles.
1551 /// </summary>
1552 public enum RelationType
1553 {
1554 /// <summary>
1555 ///
1556 /// </summary>
1557 None,
1558
1559 /// <summary>
1560 ///
1561 /// </summary>
1562 Detect,
1563
1564 /// <summary>
1565 ///
1566 /// </summary>
1567 Upgrade,
1568
1569 /// <summary>
1570 ///
1571 /// </summary>
1572 Addon,
1573
1574 /// <summary>
1575 ///
1576 /// </summary>
1577 Patch,
1578
1579 /// <summary>
1580 ///
1581 /// </summary>
1582 Dependent,
1583
1584 /// <summary>
1585 ///
1586 /// </summary>
1587 Update,
1588 }
1589
1590 /// <summary>
1591 /// One or more reasons why the application is requested to be closed or is being closed.
1592 /// </summary>
1593 [Flags]
1594 public enum EndSessionReasons
1595 {
1596 /// <summary>
1597 /// The system is shutting down or restarting (it is not possible to determine which event is occurring).
1598 /// </summary>
1599 Unknown,
1600
1601 /// <summary>
1602 /// The application is using a file that must be replaced, the system is being serviced, or system resources are exhausted.
1603 /// </summary>
1604 CloseApplication,
1605
1606 /// <summary>
1607 /// The application is forced to shut down.
1608 /// </summary>
1609 Critical = 0x40000000,
1610
1611 /// <summary>
1612 /// The user is logging off.
1613 /// </summary>
1614 Logoff = unchecked((int)0x80000000)
1615 }
1616
1617 /// <summary>
1618 /// The available actions for <see cref="IDefaultBootstrapperApplication.ApplyComplete"/>.
1619 /// </summary>
1620 public enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION
1621 {
1622 /// <summary>
1623 ///
1624 /// </summary>
1625 None,
1626
1627 /// <summary>
1628 /// Instructs the engine to restart.
1629 /// The engine will not launch again after the machine is rebooted.
1630 /// Ignored if reboot was already initiated by <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
1631 /// </summary>
1632 Restart,
1633 }
1634
1635 /// <summary>
1636 /// The cache strategy to be used for the package.
1637 /// </summary>
1638 public enum BOOTSTRAPPER_CACHE_TYPE
1639 {
1640 /// <summary>
1641 /// The package will be cached in order to securely run the package, but will always be cleaned from the cache at the end.
1642 /// </summary>
1643 Remove,
1644
1645 /// <summary>
1646 /// The package will be cached in order to run the package, and then kept in the cache until the package is uninstalled.
1647 /// </summary>
1648 Keep,
1649
1650 /// <summary>
1651 /// The package will always be cached and stay in the cache, unless the package and bundle are both being uninstalled.
1652 /// </summary>
1653 Force,
1654 }
1655
1656 /// <summary>
1657 /// The available actions for <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>.
1658 /// </summary>
1659 public enum BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION
1660 {
1661 /// <summary>
1662 ///
1663 /// </summary>
1664 None,
1665
1666 /// <summary>
1667 /// Instructs the engine to try the acquisition of the payload again.
1668 /// Ignored if hrStatus is a success.
1669 /// </summary>
1670 Retry,
1671 }
1672
1673 /// <summary>
1674 /// The available actions for <see cref="IDefaultBootstrapperApplication.CachePackageComplete"/>.
1675 /// </summary>
1676 public enum BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION
1677 {
1678 /// <summary>
1679 ///
1680 /// </summary>
1681 None,
1682
1683 /// <summary>
1684 /// Instructs the engine to ignore non-vital package failures and continue with the caching.
1685 /// Ignored if hrStatus is a success or the package is vital.
1686 /// </summary>
1687 Ignore,
1688
1689 /// <summary>
1690 /// Instructs the engine to try the acquisition and verification of the package again.
1691 /// Ignored if hrStatus is a success.
1692 /// </summary>
1693 Retry,
1694 }
1695
1696 /// <summary>
1697 /// The available actions for <see cref="IDefaultBootstrapperApplication.CacheVerifyComplete"/>.
1698 /// </summary>
1699 public enum BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION
1700 {
1701 /// <summary>
1702 ///
1703 /// </summary>
1704 None,
1705
1706 /// <summary>
1707 /// Ignored if hrStatus is a success.
1708 /// </summary>
1709 RetryVerification,
1710
1711 /// <summary>
1712 /// Ignored if hrStatus is a success.
1713 /// </summary>
1714 RetryAcquisition,
1715 }
1716
1717 /// <summary>
1718 /// The available actions for <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
1719 /// </summary>
1720 public enum BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION
1721 {
1722 /// <summary>
1723 ///
1724 /// </summary>
1725 None,
1726
1727 /// <summary>
1728 /// Instructs the engine to ignore non-vital package failures and continue with the install.
1729 /// Ignored if hrStatus is a success or the package is vital.
1730 /// </summary>
1731 Ignore,
1732
1733 /// <summary>
1734 /// Instructs the engine to try the execution of the package again.
1735 /// Ignored if hrStatus is a success.
1736 /// </summary>
1737 Retry,
1738
1739 /// <summary>
1740 /// Instructs the engine to stop processing the chain and restart.
1741 /// The engine will launch again after the machine is restarted.
1742 /// </summary>
1743 Restart,
1744
1745 /// <summary>
1746 /// Instructs the engine to stop processing the chain and suspend the current state.
1747 /// </summary>
1748 Suspend,
1749 }
1750
1751 /// <summary>
1752 /// The result of evaluating a condition from a package.
1753 /// </summary>
1754 public enum BOOTSTRAPPER_PACKAGE_CONDITION_RESULT
1755 {
1756 /// <summary>
1757 /// No condition was authored.
1758 /// </summary>
1759 Default,
1760
1761 /// <summary>
1762 /// Evaluated to false.
1763 /// </summary>
1764 False,
1765
1766 /// <summary>
1767 /// Evaluated to true.
1768 /// </summary>
1769 True,
1770 }
1771
1772 /// <summary>
1773 /// The available actions for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>.
1774 /// </summary>
1775 public enum BOOTSTRAPPER_RESOLVESOURCE_ACTION
1776 {
1777 /// <summary>
1778 /// Instructs the engine that the source can't be found.
1779 /// </summary>
1780 None,
1781
1782 /// <summary>
1783 /// Instructs the engine to try the local source again.
1784 /// </summary>
1785 Retry,
1786
1787 /// <summary>
1788 /// Instructs the engine to try the download source.
1789 /// </summary>
1790 Download,
1791 }
1792
1793 /// <summary>
1794 /// The available actions for <see cref="IDefaultBootstrapperApplication.Shutdown"/>.
1795 /// </summary>
1796 public enum BOOTSTRAPPER_SHUTDOWN_ACTION
1797 {
1798 /// <summary>
1799 ///
1800 /// </summary>
1801 None,
1802
1803 /// <summary>
1804 /// Instructs the engine to restart.
1805 /// The engine will not launch again after the machine is rebooted.
1806 /// Ignored if reboot was already initiated by <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
1807 /// </summary>
1808 Restart,
1809
1810 /// <summary>
1811 /// Instructs the engine to unload the bootstrapper application and
1812 /// restart the engine which will load the bootstrapper application again.
1813 /// Typically used to switch from a native bootstrapper application to a managed one.
1814 /// </summary>
1815 ReloadBootstrapper,
1816
1817 /// <summary>
1818 /// Opts out of the engine behavior of trying to uninstall itself when no non-permanent packages are installed.
1819 /// </summary>
1820 SkipCleanup,
1821 }
1822
1823 /// <summary>
1824 /// The property Burn will add so the MSI can know the planned action for the package.
1825 /// </summary>
1826 public enum BURN_MSI_PROPERTY
1827 {
1828 /// <summary>
1829 /// No property will be added.
1830 /// </summary>
1831 None,
1832
1833 /// <summary>
1834 /// Add BURNMSIINSTALL=1
1835 /// </summary>
1836 Install,
1837
1838 /// <summary>
1839 /// Add BURNMSIMODFIY=1
1840 /// </summary>
1841 Modify,
1842
1843 /// <summary>
1844 /// Add BURNMSIREPAIR=1
1845 /// </summary>
1846 Repair,
1847
1848 /// <summary>
1849 /// Add BURNMSIUNINSTALL=1
1850 /// </summary>
1851 Uninstall,
1852 }
1853
1854 /// <summary>
1855 /// From msi.h
1856 /// https://docs.microsoft.com/en-us/windows/win32/api/msi/nf-msi-msisetinternalui
1857 /// </summary>
1858 [Flags]
1859 public enum INSTALLUILEVEL
1860 {
1861 /// <summary>
1862 /// UI level is unchanged
1863 /// </summary>
1864 NoChange = 0,
1865
1866 /// <summary>
1867 /// default UI is used
1868 /// </summary>
1869 Default = 1,
1870
1871 /// <summary>
1872 /// completely silent installation
1873 /// </summary>
1874 None = 2,
1875
1876 /// <summary>
1877 /// simple progress and error handling
1878 /// </summary>
1879 Basic = 3,
1880
1881 /// <summary>
1882 /// authored UI, wizard dialogs suppressed
1883 /// </summary>
1884 Reduced = 4,
1885
1886 /// <summary>
1887 /// authored UI with wizards, progress, errors
1888 /// </summary>
1889 Full = 5,
1890
1891 /// <summary>
1892 /// display success/failure dialog at end of install
1893 /// </summary>
1894 EndDialog = 0x80,
1895
1896 /// <summary>
1897 /// display only progress dialog
1898 /// </summary>
1899 ProgressOnly = 0x40,
1900
1901 /// <summary>
1902 /// do not display the cancel button in basic UI
1903 /// </summary>
1904 HideCancel = 0x20,
1905
1906 /// <summary>
1907 /// force display of source resolution even if quiet
1908 /// </summary>
1909 SourceResOnly = 0x100,
1910
1911 /// <summary>
1912 /// show UAC prompt even if quiet
1913 /// Can only be used if on Windows Installer 5.0 or later
1914 /// </summary>
1915 UacOnly = 0x200,
1916 }
1917}
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationData.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationData.cs
new file mode 100644
index 00000000..23a1c8a3
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationData.cs
@@ -0,0 +1,22 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System.IO;
6
7 /// <summary>
8 /// Interface for BootstrapperApplicationData.xml.
9 /// </summary>
10 public interface IBootstrapperApplicationData
11 {
12 /// <summary>
13 /// The BootstrapperApplicationData.xml file.
14 /// </summary>
15 FileInfo BADataFile { get; }
16
17 /// <summary>
18 /// The BA manifest.
19 /// </summary>
20 IBundleInfo Bundle { get; }
21 }
22} \ No newline at end of file
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..0f9193d0
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperApplicationFactory.cs
@@ -0,0 +1,66 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.CodeDom.Compiler;
7 using System.Runtime.InteropServices;
8
9 /// <summary>
10 /// Interface used by WixToolset.Mba.Host to dynamically load the BA.
11 /// </summary>
12 [ComVisible(true)]
13 [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
14 [Guid("2965A12F-AC7B-43A0-85DF-E4B2168478A4")]
15 [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
16 public interface IBootstrapperApplicationFactory
17 {
18 /// <summary>
19 /// Low level method called by the native host.
20 /// </summary>
21 /// <param name="pArgs"></param>
22 /// <param name="pResults"></param>
23 void Create(
24 IntPtr pArgs,
25 IntPtr pResults
26 );
27 }
28
29 [Serializable]
30 [StructLayout(LayoutKind.Sequential)]
31 [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
32 internal struct Command
33 {
34 // Strings must be declared as pointers so that Marshaling doesn't free them.
35 [MarshalAs(UnmanagedType.I4)] internal int cbSize;
36 [MarshalAs(UnmanagedType.U4)] private readonly LaunchAction action;
37 [MarshalAs(UnmanagedType.U4)] private readonly Display display;
38 [MarshalAs(UnmanagedType.U4)] private readonly Restart restart;
39 private readonly IntPtr wzCommandLine;
40 [MarshalAs(UnmanagedType.I4)] private readonly int nCmdShow;
41 [MarshalAs(UnmanagedType.U4)] private readonly ResumeType resume;
42 private readonly IntPtr hwndSplashScreen;
43 [MarshalAs(UnmanagedType.I4)] private readonly RelationType relation;
44 [MarshalAs(UnmanagedType.Bool)] private readonly bool passthrough;
45 private readonly IntPtr wzLayoutDirectory;
46 private readonly IntPtr wzBootstrapperWorkingFolder;
47 private readonly IntPtr wzBootstrapperApplicationDataPath;
48
49 public IBootstrapperCommand GetBootstrapperCommand()
50 {
51 return new BootstrapperCommand(
52 this.action,
53 this.display,
54 this.restart,
55 Marshal.PtrToStringUni(this.wzCommandLine),
56 this.nCmdShow,
57 this.resume,
58 this.hwndSplashScreen,
59 this.relation,
60 this.passthrough,
61 Marshal.PtrToStringUni(this.wzLayoutDirectory),
62 Marshal.PtrToStringUni(this.wzBootstrapperWorkingFolder),
63 Marshal.PtrToStringUni(this.wzBootstrapperApplicationDataPath));
64 }
65 }
66}
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperCommand.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperCommand.cs
new file mode 100644
index 00000000..e861813f
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperCommand.cs
@@ -0,0 +1,76 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6
7 /// <summary>
8 /// Command information passed from the engine for the BA to perform.
9 /// </summary>
10 public interface IBootstrapperCommand
11 {
12 /// <summary>
13 /// Gets the action for the BA to perform.
14 /// </summary>
15 LaunchAction Action { get; }
16
17 /// <summary>
18 /// Gets the display level for the BA.
19 /// </summary>
20 Display Display { get; }
21
22 /// <summary>
23 /// Gets the action to perform if a reboot is required.
24 /// </summary>
25 Restart Restart { get; }
26
27 /// <summary>
28 /// Gets the command line arguments as a string array.
29 /// </summary>
30 /// <returns>
31 /// Array of command line arguments not handled by the engine.
32 /// </returns>
33 /// <exception type="Win32Exception">The command line could not be parsed into an array.</exception>
34 string[] CommandLineArgs { get; }
35
36 /// <summary>
37 /// Hint for the initial visibility of the window.
38 /// </summary>
39 int CmdShow { get; }
40
41 /// <summary>
42 /// Gets the method of how the engine was resumed from a previous installation step.
43 /// </summary>
44 ResumeType Resume { get; }
45
46 /// <summary>
47 /// Gets the handle to the splash screen window. If no splash screen was displayed this value will be IntPtr.Zero.
48 /// </summary>
49 IntPtr SplashScreen { get; }
50
51 /// <summary>
52 /// If this was run from a related bundle, specifies the relation type.
53 /// </summary>
54 RelationType Relation { get; }
55
56 /// <summary>
57 /// If this was run from a backward compatible bundle.
58 /// </summary>
59 bool Passthrough { get; }
60
61 /// <summary>
62 /// Gets layout directory.
63 /// </summary>
64 string LayoutDirectory { get; }
65
66 /// <summary>
67 /// Gets bootstrapper working folder.
68 /// </summary>
69 string BootstrapperWorkingFolder { get; }
70
71 /// <summary>
72 /// Gets path to BootstrapperApplicationData.xml.
73 /// </summary>
74 string BootstrapperApplicationDataPath { get; }
75 }
76}
diff --git a/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs b/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs
new file mode 100644
index 00000000..4e19bf0f
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IBootstrapperEngine.cs
@@ -0,0 +1,536 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.CodeDom.Compiler;
7 using System.Runtime.InteropServices;
8 using System.Text;
9
10 /// <summary>
11 /// Allows calls into the bootstrapper engine.
12 /// </summary>
13 [ComImport]
14 [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
15 [Guid("6480D616-27A0-44D7-905B-81512C29C2FB")]
16 [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
17 public interface IBootstrapperEngine
18 {
19 /// <summary>
20 /// See <see cref="IEngine.PackageCount"/>.
21 /// </summary>
22 /// <param name="pcPackages"></param>
23 void GetPackageCount(
24 [MarshalAs(UnmanagedType.U4)] out int pcPackages
25 );
26
27 /// <summary>
28 /// See <see cref="IEngine.GetVariableNumeric(string)"/>.
29 /// </summary>
30 /// <param name="wzVariable"></param>
31 /// <param name="pllValue"></param>
32 /// <returns></returns>
33 [PreserveSig]
34 int GetVariableNumeric(
35 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
36 out long pllValue
37 );
38
39 /// <summary>
40 /// See <see cref="IEngine.GetVariableString(string)"/>.
41 /// </summary>
42 [PreserveSig]
43 int GetVariableString(
44 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
45 IntPtr wzValue,
46 ref IntPtr pcchValue
47 );
48
49 /// <summary>
50 /// See <see cref="IEngine.GetVariableVersion(string)"/>.
51 /// </summary>
52 [PreserveSig]
53 int GetVariableVersion(
54 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
55 IntPtr wzValue,
56 ref IntPtr pcchValue
57 );
58
59 /// <summary>
60 /// See <see cref="IEngine.FormatString(string)"/>.
61 /// </summary>
62 [PreserveSig]
63 int FormatString(
64 [MarshalAs(UnmanagedType.LPWStr)] string wzIn,
65 [MarshalAs(UnmanagedType.LPWStr), Out] StringBuilder wzOut,
66 ref IntPtr pcchOut
67 );
68
69 /// <summary>
70 /// See <see cref="IEngine.EscapeString(string)"/>.
71 /// </summary>
72 [PreserveSig]
73 int EscapeString(
74 [MarshalAs(UnmanagedType.LPWStr)] string wzIn,
75 [MarshalAs(UnmanagedType.LPWStr), Out] StringBuilder wzOut,
76 ref IntPtr pcchOut
77 );
78
79 /// <summary>
80 /// See <see cref="IEngine.EvaluateCondition(string)"/>.
81 /// </summary>
82 /// <param name="wzCondition"></param>
83 /// <param name="pf"></param>
84 void EvaluateCondition(
85 [MarshalAs(UnmanagedType.LPWStr)] string wzCondition,
86 [MarshalAs(UnmanagedType.Bool)] out bool pf
87 );
88
89 /// <summary>
90 /// See <see cref="IEngine.Log(LogLevel, string)"/>.
91 /// </summary>
92 /// <param name="level"></param>
93 /// <param name="wzMessage"></param>
94 void Log(
95 [MarshalAs(UnmanagedType.U4)] LogLevel level,
96 [MarshalAs(UnmanagedType.LPWStr)] string wzMessage
97 );
98
99 /// <summary>
100 /// See <see cref="IEngine.SendEmbeddedError(int, string, int)"/>.
101 /// </summary>
102 /// <param name="dwErrorCode"></param>
103 /// <param name="wzMessage"></param>
104 /// <param name="dwUIHint"></param>
105 /// <param name="pnResult"></param>
106 void SendEmbeddedError(
107 [MarshalAs(UnmanagedType.U4)] int dwErrorCode,
108 [MarshalAs(UnmanagedType.LPWStr)] string wzMessage,
109 [MarshalAs(UnmanagedType.U4)] int dwUIHint,
110 [MarshalAs(UnmanagedType.I4)] out int pnResult
111 );
112
113 /// <summary>
114 /// See <see cref="IEngine.SendEmbeddedProgress(int, int)"/>.
115 /// </summary>
116 /// <param name="dwProgressPercentage"></param>
117 /// <param name="dwOverallProgressPercentage"></param>
118 /// <param name="pnResult"></param>
119 void SendEmbeddedProgress(
120 [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage,
121 [MarshalAs(UnmanagedType.U4)] int dwOverallProgressPercentage,
122 [MarshalAs(UnmanagedType.I4)] out int pnResult
123 );
124
125 /// <summary>
126 /// See <see cref="IEngine.SetUpdate(string, string, long, UpdateHashType, byte[])"/>.
127 /// </summary>
128 /// <param name="wzLocalSource"></param>
129 /// <param name="wzDownloadSource"></param>
130 /// <param name="qwValue"></param>
131 /// <param name="hashType"></param>
132 /// <param name="rgbHash"></param>
133 /// <param name="cbHash"></param>
134 void SetUpdate(
135 [MarshalAs(UnmanagedType.LPWStr)] string wzLocalSource,
136 [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadSource,
137 [MarshalAs(UnmanagedType.U8)] long qwValue,
138 [MarshalAs(UnmanagedType.U4)] UpdateHashType hashType,
139 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=4)] byte[] rgbHash,
140 [MarshalAs(UnmanagedType.U4)] int cbHash
141 );
142
143 /// <summary>
144 /// See <see cref="IEngine.SetLocalSource(string, string, string)"/>.
145 /// </summary>
146 /// <param name="wzPackageOrContainerId"></param>
147 /// <param name="wzPayloadId"></param>
148 /// <param name="wzPath"></param>
149 void SetLocalSource(
150 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
151 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
152 [MarshalAs(UnmanagedType.LPWStr)] string wzPath
153 );
154
155 /// <summary>
156 /// See <see cref="IEngine.SetDownloadSource(string, string, string, string, string)"/>.
157 /// </summary>
158 /// <param name="wzPackageOrContainerId"></param>
159 /// <param name="wzPayloadId"></param>
160 /// <param name="wzUrl"></param>
161 /// <param name="wzUser"></param>
162 /// <param name="wzPassword"></param>
163 void SetDownloadSource(
164 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
165 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
166 [MarshalAs(UnmanagedType.LPWStr)] string wzUrl,
167 [MarshalAs(UnmanagedType.LPWStr)] string wzUser,
168 [MarshalAs(UnmanagedType.LPWStr)] string wzPassword
169 );
170
171 /// <summary>
172 /// See <see cref="IEngine.SetVariableNumeric(string, long)"/>.
173 /// </summary>
174 /// <param name="wzVariable"></param>
175 /// <param name="llValue"></param>
176 void SetVariableNumeric(
177 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
178 long llValue
179 );
180
181 /// <summary>
182 /// See <see cref="IEngine.SetVariableString(string, string, bool)"/>.
183 /// </summary>
184 /// <param name="wzVariable"></param>
185 /// <param name="wzValue"></param>
186 /// <param name="fFormatted"></param>
187 void SetVariableString(
188 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
189 IntPtr wzValue,
190 [MarshalAs(UnmanagedType.Bool)] bool fFormatted
191 );
192
193 /// <summary>
194 /// See <see cref="IEngine.SetVariableVersion(string, string)"/>.
195 /// </summary>
196 /// <param name="wzVariable"></param>
197 /// <param name="wzValue"></param>
198 void SetVariableVersion(
199 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
200 IntPtr wzValue
201 );
202
203 /// <summary>
204 /// See <see cref="IEngine.CloseSplashScreen"/>.
205 /// </summary>
206 void CloseSplashScreen();
207
208 /// <summary>
209 /// See <see cref="IEngine.Detect(IntPtr)"/>.
210 /// </summary>
211 /// <param name="hwndParent"></param>
212 void Detect(
213 IntPtr hwndParent
214 );
215
216 /// <summary>
217 /// See <see cref="IEngine.Plan(LaunchAction)"/>.
218 /// </summary>
219 /// <param name="action"></param>
220 void Plan(
221 [MarshalAs(UnmanagedType.U4)] LaunchAction action
222 );
223
224 /// <summary>
225 /// See <see cref="IEngine.Elevate(IntPtr)"/>.
226 /// </summary>
227 /// <param name="hwndParent"></param>
228 /// <returns></returns>
229 [PreserveSig]
230 int Elevate(
231 IntPtr hwndParent
232 );
233
234 /// <summary>
235 /// See <see cref="IEngine.Apply(IntPtr)"/>.
236 /// </summary>
237 /// <param name="hwndParent"></param>
238 void Apply(
239 IntPtr hwndParent
240 );
241
242 /// <summary>
243 /// See <see cref="IEngine.Quit(int)"/>.
244 /// </summary>
245 /// <param name="dwExitCode"></param>
246 void Quit(
247 [MarshalAs(UnmanagedType.U4)] int dwExitCode
248 );
249
250 /// <summary>
251 /// See <see cref="IEngine.LaunchApprovedExe(IntPtr, string, string, int)"/>.
252 /// </summary>
253 /// <param name="hwndParent"></param>
254 /// <param name="wzApprovedExeForElevationId"></param>
255 /// <param name="wzArguments"></param>
256 /// <param name="dwWaitForInputIdleTimeout"></param>
257 void LaunchApprovedExe(
258 IntPtr hwndParent,
259 [MarshalAs(UnmanagedType.LPWStr)] string wzApprovedExeForElevationId,
260 [MarshalAs(UnmanagedType.LPWStr)] string wzArguments,
261 [MarshalAs(UnmanagedType.U4)] int dwWaitForInputIdleTimeout
262 );
263
264 /// <summary>
265 /// Sets the URL to the update feed.
266 /// </summary>
267 /// <param name="url">URL of the update feed.</param>
268 void SetUpdateSource(
269 [MarshalAs(UnmanagedType.LPWStr)] string url
270 );
271
272 /// <summary>
273 /// See <see cref="IEngine.CompareVersions(string, string)"/>.
274 /// </summary>
275 /// <param name="wzVersion1"></param>
276 /// <param name="wzVersion2"></param>
277 /// <param name="pnResult"></param>
278 void CompareVersions(
279 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion1,
280 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion2,
281 [MarshalAs(UnmanagedType.I4)] out int pnResult
282 );
283 }
284
285 /// <summary>
286 /// The installation action for the bundle or current package.
287 /// </summary>
288 public enum ActionState
289 {
290 /// <summary>
291 ///
292 /// </summary>
293 None,
294
295 /// <summary>
296 ///
297 /// </summary>
298 Uninstall,
299
300 /// <summary>
301 ///
302 /// </summary>
303 Install,
304
305 /// <summary>
306 ///
307 /// </summary>
308 Modify,
309
310 /// <summary>
311 ///
312 /// </summary>
313 Mend,
314
315 /// <summary>
316 ///
317 /// </summary>
318 Repair,
319
320 /// <summary>
321 ///
322 /// </summary>
323 MinorUpgrade,
324 }
325
326 /// <summary>
327 /// The action for the BA to perform.
328 /// </summary>
329 public enum LaunchAction
330 {
331 /// <summary>
332 ///
333 /// </summary>
334 Unknown,
335
336 /// <summary>
337 ///
338 /// </summary>
339 Help,
340
341 /// <summary>
342 ///
343 /// </summary>
344 Layout,
345
346 /// <summary>
347 ///
348 /// </summary>
349 Uninstall,
350
351 /// <summary>
352 ///
353 /// </summary>
354 Cache,
355
356 /// <summary>
357 ///
358 /// </summary>
359 Install,
360
361 /// <summary>
362 ///
363 /// </summary>
364 Modify,
365
366 /// <summary>
367 ///
368 /// </summary>
369 Repair,
370
371 /// <summary>
372 ///
373 /// </summary>
374 UpdateReplace,
375
376 /// <summary>
377 ///
378 /// </summary>
379 UpdateReplaceEmbedded,
380 }
381
382 /// <summary>
383 /// The message log level.
384 /// </summary>
385 public enum LogLevel
386 {
387 /// <summary>
388 /// No logging level (generic).
389 /// </summary>
390 None,
391
392 /// <summary>
393 /// User messages.
394 /// </summary>
395 Standard,
396
397 /// <summary>
398 /// Verbose messages.
399 /// </summary>
400 Verbose,
401
402 /// <summary>
403 /// Messages for debugging.
404 /// </summary>
405 Debug,
406
407 /// <summary>
408 /// Error messages.
409 /// </summary>
410 Error,
411 }
412
413 /// <summary>
414 /// Type of hash used for update bundle.
415 /// </summary>
416 public enum UpdateHashType
417 {
418 /// <summary>
419 /// No hash provided.
420 /// </summary>
421 None,
422
423 /// <summary>
424 /// SHA-1 based hash provided.
425 /// </summary>
426 Sha1,
427 }
428
429 /// <summary>
430 /// Describes the state of an installation package.
431 /// </summary>
432 public enum PackageState
433 {
434 /// <summary>
435 ///
436 /// </summary>
437 Unknown,
438
439 /// <summary>
440 ///
441 /// </summary>
442 Obsolete,
443
444 /// <summary>
445 ///
446 /// </summary>
447 Absent,
448
449 /// <summary>
450 ///
451 /// </summary>
452 Cached,
453
454 /// <summary>
455 ///
456 /// </summary>
457 Present,
458
459 /// <summary>
460 ///
461 /// </summary>
462 Superseded,
463 }
464
465 /// <summary>
466 /// Indicates the state desired for an installation package.
467 /// </summary>
468 public enum RequestState
469 {
470 /// <summary>
471 ///
472 /// </summary>
473 None,
474
475 /// <summary>
476 /// /
477 /// </summary>
478 ForceAbsent,
479
480 /// <summary>
481 ///
482 /// </summary>
483 Absent,
484
485 /// <summary>
486 ///
487 /// </summary>
488 Cache,
489
490 /// <summary>
491 ///
492 /// </summary>
493 Present,
494
495 /// <summary>
496 ///
497 /// </summary>
498 Mend,
499
500 /// <summary>
501 ///
502 /// </summary>
503 Repair,
504 }
505
506 /// <summary>
507 /// Indicates the state of a feature.
508 /// </summary>
509 public enum FeatureState
510 {
511 /// <summary>
512 ///
513 /// </summary>
514 Unknown,
515
516 /// <summary>
517 ///
518 /// </summary>
519 Absent,
520
521 /// <summary>
522 ///
523 /// </summary>
524 Advertised,
525
526 /// <summary>
527 ///
528 /// </summary>
529 Local,
530
531 /// <summary>
532 ///
533 /// </summary>
534 Source,
535 }
536}
diff --git a/src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs b/src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs
new file mode 100644
index 00000000..f4a82f36
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IBundleInfo.cs
@@ -0,0 +1,39 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System.Collections.Generic;
6
7 /// <summary>
8 /// BA manifest data.
9 /// </summary>
10 public interface IBundleInfo
11 {
12 /// <summary>
13 ///
14 /// </summary>
15 string LogVariable { get; }
16
17 /// <summary>
18 ///
19 /// </summary>
20 string Name { get; }
21
22 /// <summary>
23 ///
24 /// </summary>
25 IDictionary<string, IPackageInfo> Packages { get; }
26
27 /// <summary>
28 ///
29 /// </summary>
30 bool PerMachine { get; }
31
32 /// <summary>
33 /// Adds a related bundle as a package.
34 /// </summary>
35 /// <param name="e"></param>
36 /// <returns>The created <see cref="IPackageInfo"/>.</returns>
37 IPackageInfo AddRelatedBundleAsPackage(DetectRelatedBundleEventArgs e);
38 }
39} \ No newline at end of file
diff --git a/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs
new file mode 100644
index 00000000..a295f6c0
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IDefaultBootstrapperApplication.cs
@@ -0,0 +1,387 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6
7 /// <summary>
8 /// Interface for built-in implementation of <see cref="IBootstrapperApplication"/>.
9 /// </summary>
10 public interface IDefaultBootstrapperApplication : IBootstrapperApplication
11 {
12 /// <summary>
13 /// Fired when the engine has begun installing the bundle.
14 /// </summary>
15 event EventHandler<ApplyBeginEventArgs> ApplyBegin;
16
17 /// <summary>
18 /// Fired when the engine has completed installing the bundle.
19 /// </summary>
20 event EventHandler<ApplyCompleteEventArgs> ApplyComplete;
21
22 /// <summary>
23 /// Fired when the engine is about to begin an MSI transaction.
24 /// </summary>
25 event EventHandler<BeginMsiTransactionBeginEventArgs> BeginMsiTransactionBegin;
26
27 /// <summary>
28 /// Fired when the engine has completed beginning an MSI transaction.
29 /// </summary>
30 event EventHandler<BeginMsiTransactionCompleteEventArgs> BeginMsiTransactionComplete;
31
32 /// <summary>
33 /// Fired when the engine has begun acquiring the payload or container.
34 /// The BA can change the source using <see cref="IEngine.SetLocalSource(string, string, string)"/>
35 /// or <see cref="IEngine.SetDownloadSource(string, string, string, string, string)"/>.
36 /// </summary>
37 event EventHandler<CacheAcquireBeginEventArgs> CacheAcquireBegin;
38
39 /// <summary>
40 /// Fired when the engine has completed the acquisition of the payload or container.
41 /// The BA can change the source using <see cref="IEngine.SetLocalSource(string, string, string)"/>
42 /// or <see cref="IEngine.SetDownloadSource(string, string, string, string, string)"/>.
43 /// </summary>
44 event EventHandler<CacheAcquireCompleteEventArgs> CacheAcquireComplete;
45
46 /// <summary>
47 /// Fired when the engine has progress acquiring the payload or container.
48 /// </summary>
49 event EventHandler<CacheAcquireProgressEventArgs> CacheAcquireProgress;
50
51 /// <summary>
52 /// Fired by the engine to allow the BA to override the acquisition action.
53 /// </summary>
54 event EventHandler<CacheAcquireResolvingEventArgs> CacheAcquireResolving;
55
56 /// <summary>
57 /// Fired when the engine has begun caching the installation sources.
58 /// </summary>
59 event EventHandler<CacheBeginEventArgs> CacheBegin;
60
61 /// <summary>
62 /// Fired after the engine has cached the installation sources.
63 /// </summary>
64 event EventHandler<CacheCompleteEventArgs> CacheComplete;
65
66 /// <summary>
67 /// Fired when the engine begins the verification of the payload or container that was already in the package cache.
68 /// </summary>
69 event EventHandler<CacheContainerOrPayloadVerifyBeginEventArgs> CacheContainerOrPayloadVerifyBegin;
70
71 /// <summary>
72 /// Fired when the engine has completed the verification of the payload or container that was already in the package cache.
73 /// </summary>
74 event EventHandler<CacheContainerOrPayloadVerifyCompleteEventArgs> CacheContainerOrPayloadVerifyComplete;
75
76 /// <summary>
77 /// Fired when the engine has progress verifying the payload or container that was already in the package cache.
78 /// </summary>
79 event EventHandler<CacheContainerOrPayloadVerifyProgressEventArgs> CacheContainerOrPayloadVerifyProgress;
80
81 /// <summary>
82 /// Fired when the engine has begun caching a specific package.
83 /// </summary>
84 event EventHandler<CachePackageBeginEventArgs> CachePackageBegin;
85
86 /// <summary>
87 /// Fired when the engine has completed caching a specific package.
88 /// </summary>
89 event EventHandler<CachePackageCompleteEventArgs> CachePackageComplete;
90
91 /// <summary>
92 /// Fired when the engine begins the extraction of the payload from the container.
93 /// </summary>
94 event EventHandler<CachePayloadExtractBeginEventArgs> CachePayloadExtractBegin;
95
96 /// <summary>
97 /// Fired when the engine has completed the extraction of the payload from the container.
98 /// </summary>
99 event EventHandler<CachePayloadExtractCompleteEventArgs> CachePayloadExtractComplete;
100
101 /// <summary>
102 /// Fired when the engine has progress extracting the payload from the container.
103 /// </summary>
104 event EventHandler<CachePayloadExtractProgressEventArgs> CachePayloadExtractProgress;
105
106 /// <summary>
107 /// Fired when the engine begins the verification of the acquired payload or container.
108 /// </summary>
109 event EventHandler<CacheVerifyBeginEventArgs> CacheVerifyBegin;
110
111 /// <summary>
112 /// Fired when the engine has completed the verification of the acquired payload or container.
113 /// </summary>
114 event EventHandler<CacheVerifyCompleteEventArgs> CacheVerifyComplete;
115
116 /// <summary>
117 /// Fired when the engine has progress verifying the payload or container.
118 /// </summary>
119 event EventHandler<CacheVerifyProgressEventArgs> CacheVerifyProgress;
120
121 /// <summary>
122 /// Fired when the engine is about to commit an MSI transaction.
123 /// </summary>
124 event EventHandler<CommitMsiTransactionBeginEventArgs> CommitMsiTransactionBegin;
125
126 /// <summary>
127 /// Fired when the engine has completed comitting an MSI transaction.
128 /// </summary>
129 event EventHandler<CommitMsiTransactionCompleteEventArgs> CommitMsiTransactionComplete;
130
131 /// <summary>
132 /// Fired when the overall detection phase has begun.
133 /// </summary>
134 event EventHandler<DetectBeginEventArgs> DetectBegin;
135
136 /// <summary>
137 /// Fired when the detection phase has completed.
138 /// </summary>
139 event EventHandler<DetectCompleteEventArgs> DetectComplete;
140
141 /// <summary>
142 /// Fired when a forward compatible bundle is detected.
143 /// </summary>
144 event EventHandler<DetectForwardCompatibleBundleEventArgs> DetectForwardCompatibleBundle;
145
146 /// <summary>
147 /// Fired when a feature in an MSI package has been detected.
148 /// </summary>
149 event EventHandler<DetectMsiFeatureEventArgs> DetectMsiFeature;
150
151 /// <summary>
152 /// Fired when the detection for a specific package has begun.
153 /// </summary>
154 event EventHandler<DetectPackageBeginEventArgs> DetectPackageBegin;
155
156 /// <summary>
157 /// Fired when the detection for a specific package has completed.
158 /// </summary>
159 event EventHandler<DetectPackageCompleteEventArgs> DetectPackageComplete;
160
161 /// <summary>
162 /// Fired when the engine detects a target product for an MSP package.
163 /// </summary>
164 event EventHandler<DetectPatchTargetEventArgs> DetectPatchTarget;
165
166 /// <summary>
167 /// Fired when a related bundle has been detected for a bundle.
168 /// </summary>
169 event EventHandler<DetectRelatedBundleEventArgs> DetectRelatedBundle;
170
171 /// <summary>
172 /// Fired when a related MSI package has been detected for a package.
173 /// </summary>
174 event EventHandler<DetectRelatedMsiPackageEventArgs> DetectRelatedMsiPackage;
175
176 /// <summary>
177 /// Fired when the update detection has found a potential update candidate.
178 /// </summary>
179 event EventHandler<DetectUpdateEventArgs> DetectUpdate;
180
181 /// <summary>
182 /// Fired when the update detection phase has begun.
183 /// </summary>
184 event EventHandler<DetectUpdateBeginEventArgs> DetectUpdateBegin;
185
186 /// <summary>
187 /// Fired when the update detection phase has completed.
188 /// </summary>
189 event EventHandler<DetectUpdateCompleteEventArgs> DetectUpdateComplete;
190
191 /// <summary>
192 /// Fired when the engine is about to start the elevated process.
193 /// </summary>
194 event EventHandler<ElevateBeginEventArgs> ElevateBegin;
195
196 /// <summary>
197 /// Fired when the engine has completed starting the elevated process.
198 /// </summary>
199 event EventHandler<ElevateCompleteEventArgs> ElevateComplete;
200
201 /// <summary>
202 /// Fired when the engine has encountered an error.
203 /// </summary>
204 event EventHandler<ErrorEventArgs> Error;
205
206 /// <summary>
207 /// Fired when the engine has begun installing packages.
208 /// </summary>
209 event EventHandler<ExecuteBeginEventArgs> ExecuteBegin;
210
211 /// <summary>
212 /// Fired when the engine has completed installing packages.
213 /// </summary>
214 event EventHandler<ExecuteCompleteEventArgs> ExecuteComplete;
215
216 /// <summary>
217 /// Fired when a package sends a files in use installation message.
218 /// </summary>
219 event EventHandler<ExecuteFilesInUseEventArgs> ExecuteFilesInUse;
220
221 /// <summary>
222 /// Fired when Windows Installer sends an installation message.
223 /// </summary>
224 event EventHandler<ExecuteMsiMessageEventArgs> ExecuteMsiMessage;
225
226 /// <summary>
227 /// Fired when the engine has begun installing a specific package.
228 /// </summary>
229 event EventHandler<ExecutePackageBeginEventArgs> ExecutePackageBegin;
230
231 /// <summary>
232 /// Fired when the engine has completed installing a specific package.
233 /// </summary>
234 event EventHandler<ExecutePackageCompleteEventArgs> ExecutePackageComplete;
235
236 /// <summary>
237 /// Fired when the engine executes one or more patches targeting a product.
238 /// </summary>
239 event EventHandler<ExecutePatchTargetEventArgs> ExecutePatchTarget;
240
241 /// <summary>
242 /// Fired by the engine while executing a package.
243 /// </summary>
244 event EventHandler<ExecuteProgressEventArgs> ExecuteProgress;
245
246 /// <summary>
247 /// Fired when the engine is about to launch the preapproved executable.
248 /// </summary>
249 event EventHandler<LaunchApprovedExeBeginEventArgs> LaunchApprovedExeBegin;
250
251 /// <summary>
252 /// Fired when the engine has completed launching the preapproved executable.
253 /// </summary>
254 event EventHandler<LaunchApprovedExeCompleteEventArgs> LaunchApprovedExeComplete;
255
256 /// <summary>
257 /// Fired when the engine is about to pause Windows automatic updates.
258 /// </summary>
259 event EventHandler<PauseAutomaticUpdatesBeginEventArgs> PauseAutomaticUpdatesBegin;
260
261 /// <summary>
262 /// Fired when the engine has completed pausing Windows automatic updates.
263 /// </summary>
264 event EventHandler<PauseAutomaticUpdatesCompleteEventArgs> PauseAutomaticUpdatesComplete;
265
266 /// <summary>
267 /// Fired when the engine has begun planning the installation.
268 /// </summary>
269 event EventHandler<PlanBeginEventArgs> PlanBegin;
270
271 /// <summary>
272 /// Fired when the engine has completed planning the installation.
273 /// </summary>
274 event EventHandler<PlanCompleteEventArgs> PlanComplete;
275
276 /// <summary>
277 /// Fired when the engine is about to plan a forward compatible bundle.
278 /// </summary>
279 event EventHandler<PlanForwardCompatibleBundleEventArgs> PlanForwardCompatibleBundle;
280
281 /// <summary>
282 /// Fired when the engine has completed planning a package.
283 /// </summary>
284 event EventHandler<PlannedPackageEventArgs> PlannedPackage;
285
286 /// <summary>
287 /// Fired when the engine is about to plan a feature in an MSI package.
288 /// </summary>
289 event EventHandler<PlanMsiFeatureEventArgs> PlanMsiFeature;
290
291 /// <summary>
292 /// Fired when the engine is planning an MSI or MSP package.
293 /// </summary>
294 event EventHandler<PlanMsiPackageEventArgs> PlanMsiPackage;
295
296 /// <summary>
297 /// Fired when the engine has begun getting the BA's input for planning a package.
298 /// </summary>
299 event EventHandler<PlanPackageBeginEventArgs> PlanPackageBegin;
300
301 /// <summary>
302 /// Fired when the engine has completed getting the BA's input for planning a package.
303 /// </summary>
304 event EventHandler<PlanPackageCompleteEventArgs> PlanPackageComplete;
305
306 /// <summary>
307 /// Fired when the engine is about to plan a target of an MSP package.
308 /// </summary>
309 event EventHandler<PlanPatchTargetEventArgs> PlanPatchTarget;
310
311 /// <summary>
312 /// Fired when the engine has begun planning for a related bundle.
313 /// </summary>
314 event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle;
315
316 /// <summary>
317 /// Fired when the engine has changed progress for the bundle installation.
318 /// </summary>
319 event EventHandler<ProgressEventArgs> Progress;
320
321 /// <summary>
322 /// Fired when the engine has begun registering the location and visibility of the bundle.
323 /// </summary>
324 event EventHandler<RegisterBeginEventArgs> RegisterBegin;
325
326 /// <summary>
327 /// Fired when the engine has completed registering the location and visibility of the bundle.
328 /// </summary>
329 event EventHandler<RegisterCompleteEventArgs> RegisterComplete;
330
331 /// <summary>
332 /// Fired when the engine is about to rollback an MSI transaction.
333 /// </summary>
334 event EventHandler<RollbackMsiTransactionBeginEventArgs> RollbackMsiTransactionBegin;
335
336 /// <summary>
337 /// Fired when the engine has completed rolling back an MSI transaction.
338 /// </summary>
339 event EventHandler<RollbackMsiTransactionCompleteEventArgs> RollbackMsiTransactionComplete;
340
341 /// <summary>
342 /// Fired when the engine is shutting down the bootstrapper application.
343 /// </summary>
344 event EventHandler<ShutdownEventArgs> Shutdown;
345
346 /// <summary>
347 /// Fired when the engine is starting up the bootstrapper application.
348 /// </summary>
349 event EventHandler<StartupEventArgs> Startup;
350
351 /// <summary>
352 /// Fired when the engine is about to take a system restore point.
353 /// </summary>
354 event EventHandler<SystemRestorePointBeginEventArgs> SystemRestorePointBegin;
355
356 /// <summary>
357 /// Fired when the engine has completed taking a system restore point.
358 /// </summary>
359 event EventHandler<SystemRestorePointCompleteEventArgs> SystemRestorePointComplete;
360
361 /// <summary>
362 /// Fired when the system is shutting down or user is logging off.
363 /// </summary>
364 /// <remarks>
365 /// <para>To prevent shutting down or logging off, set <see cref="CancellableHResultEventArgs.Cancel"/> to
366 /// true; otherwise, set it to false.</para>
367 /// <para>By default setup will prevent shutting down or logging off between
368 /// <see cref="IDefaultBootstrapperApplication.ApplyBegin"/> and <see cref="IDefaultBootstrapperApplication.ApplyComplete"/>.
369 /// Derivatives can change this behavior by handling <see cref="IDefaultBootstrapperApplication.SystemShutdown"/>.</para>
370 /// <para>If <see cref="SystemShutdownEventArgs.Reasons"/> contains <see cref="EndSessionReasons.Critical"/>
371 /// the bootstrapper cannot prevent the shutdown and only has a few seconds to save state or perform any other
372 /// critical operations before being closed by the operating system.</para>
373 /// <para>This event may be fired on a different thread.</para>
374 /// </remarks>
375 event EventHandler<SystemShutdownEventArgs> SystemShutdown;
376
377 /// <summary>
378 /// Fired when the engine unregisters the bundle.
379 /// </summary>
380 event EventHandler<UnregisterBeginEventArgs> UnregisterBegin;
381
382 /// <summary>
383 /// Fired when the engine unregistration is complete.
384 /// </summary>
385 event EventHandler<UnregisterCompleteEventArgs> UnregisterComplete;
386 }
387} \ No newline at end of file
diff --git a/src/api/burn/WixToolset.Mba.Core/IEngine.cs b/src/api/burn/WixToolset.Mba.Core/IEngine.cs
new file mode 100644
index 00000000..3e636961
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IEngine.cs
@@ -0,0 +1,222 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.ComponentModel;
7 using System.Security;
8
9 /// <summary>
10 /// High level abstraction over the <see cref="IBootstrapperEngine"/> interface.
11 /// </summary>
12 public interface IEngine
13 {
14 /// <summary>
15 /// Gets the number of packages in the bundle.
16 /// </summary>
17 int PackageCount { get; }
18
19 /// <summary>
20 /// Install the packages.
21 /// </summary>
22 /// <param name="hwndParent">The parent window for the installation user interface.</param>
23 void Apply(IntPtr hwndParent);
24
25 /// <summary>
26 /// Close the splash screen if it is still open. Does nothing if the splash screen is not or
27 /// never was opened.
28 /// </summary>
29 void CloseSplashScreen();
30
31 /// <returns>0 if equal, 1 if version1 &gt; version2, -1 if version1 &lt; version2</returns>
32 int CompareVersions(string version1, string version2);
33
34 /// <summary>
35 /// Checks if a variable exists in the engine.
36 /// </summary>
37 /// <param name="name">The name of the variable.</param>
38 /// <returns>Whether the variable exists.</returns>
39 bool ContainsVariable(string name);
40
41 /// <summary>
42 /// Determine if all installation conditions are fulfilled.
43 /// </summary>
44 void Detect();
45
46 /// <summary>
47 /// Determine if all installation conditions are fulfilled.
48 /// </summary>
49 /// <param name="hwndParent">The parent window for the installation user interface.</param>
50 void Detect(IntPtr hwndParent);
51
52 /// <summary>
53 /// Elevate the install.
54 /// </summary>
55 /// <param name="hwndParent">The parent window of the elevation dialog.</param>
56 /// <returns>true if elevation succeeded; otherwise, false if the user cancelled.</returns>
57 /// <exception cref="Win32Exception">A Win32 error occurred.</exception>
58 bool Elevate(IntPtr hwndParent);
59
60 /// <summary>
61 /// Escapes the input string.
62 /// </summary>
63 /// <param name="input">The string to escape.</param>
64 /// <returns>The escaped string.</returns>
65 /// <exception cref="Win32Exception">A Win32 error occurred.</exception>
66 string EscapeString(string input);
67
68 /// <summary>
69 /// Evaluates the <paramref name="condition"/> string.
70 /// </summary>
71 /// <param name="condition">The string representing the condition to evaluate.</param>
72 /// <returns>Whether the condition evaluated to true or false.</returns>
73 bool EvaluateCondition(string condition);
74
75 /// <summary>
76 /// Formats the input string.
77 /// </summary>
78 /// <param name="format">The string to format.</param>
79 /// <returns>The formatted string.</returns>
80 /// <exception cref="Win32Exception">A Win32 error occurred.</exception>
81 string FormatString(string format);
82
83 /// <summary>
84 /// Gets numeric variables for the engine.
85 /// </summary>
86 /// <param name="name">The name of the variable.</param>
87 long GetVariableNumeric(string name);
88
89 /// <summary>
90 /// Gets string variables for the engine using SecureStrings.
91 /// </summary>
92 /// <param name="name">The name of the variable.</param>
93 SecureString GetVariableSecureString(string name);
94
95 /// <summary>
96 /// Gets string variables for the engine.
97 /// </summary>
98 /// <param name="name">The name of the variable.</param>
99 string GetVariableString(string name);
100
101 /// <summary>
102 /// Gets <see cref="Version"/> variables for the engine.
103 /// </summary>
104 /// <param name="name">The name of the variable.</param>
105 string GetVariableVersion(string name);
106
107 /// <summary>
108 /// Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.
109 /// </summary>
110 /// <param name="hwndParent">The parent window of the elevation dialog (if the engine hasn't elevated yet).</param>
111 /// <param name="approvedExeForElevationId">Id of the ApprovedExeForElevation element specified when the bundle was authored.</param>
112 /// <param name="arguments">Optional arguments.</param>
113 void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments);
114
115 /// <summary>
116 /// Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.
117 /// </summary>
118 /// <param name="hwndParent">The parent window of the elevation dialog (if the engine hasn't elevated yet).</param>
119 /// <param name="approvedExeForElevationId">Id of the ApprovedExeForElevation element specified when the bundle was authored.</param>
120 /// <param name="arguments">Optional arguments.</param>
121 /// <param name="waitForInputIdleTimeout">Timeout in milliseconds. When set to something other than zero, the engine will call WaitForInputIdle for the new process with this timeout before calling OnLaunchApprovedExeComplete.</param>
122 void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout);
123
124 /// <summary>
125 /// Logs the <paramref name="message"/>.
126 /// </summary>
127 /// <param name="level">The logging level.</param>
128 /// <param name="message">The message to log.</param>
129 void Log(LogLevel level, string message);
130
131 /// <summary>
132 /// Determine the installation sequencing and costing.
133 /// </summary>
134 /// <param name="action">The action to perform when planning.</param>
135 void Plan(LaunchAction action);
136
137 /// <summary>
138 /// Set the update information for a bundle.
139 /// </summary>
140 /// <param name="localSource">Optional local source path for the update. Default is "update\[OriginalNameOfBundle].exe".</param>
141 /// <param name="downloadSource">Optional download source for the update.</param>
142 /// <param name="size">Size of the expected update.</param>
143 /// <param name="hashType">Type of the hash expected on the update.</param>
144 /// <param name="hash">Optional hash expected for the update.</param>
145 void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, byte[] hash);
146
147 /// <summary>
148 /// Sets the URL to the update feed.
149 /// </summary>
150 /// <param name="url">URL of the update feed.</param>
151 void SetUpdateSource(string url);
152
153 /// <summary>
154 /// Set the local source for a package or container.
155 /// </summary>
156 /// <param name="packageOrContainerId">The id that uniquely identifies the package or container.</param>
157 /// <param name="payloadId">The id that uniquely identifies the payload.</param>
158 /// <param name="path">The new source path.</param>
159 void SetLocalSource(string packageOrContainerId, string payloadId, string path);
160
161 /// <summary>
162 /// Set the new download URL for a package or container.
163 /// </summary>
164 /// <param name="packageOrContainerId">The id that uniquely identifies the package or container.</param>
165 /// <param name="payloadId">The id that uniquely identifies the payload.</param>
166 /// <param name="url">The new url.</param>
167 /// <param name="user">The user name for proxy authentication.</param>
168 /// <param name="password">The password for proxy authentication.</param>
169 void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password);
170
171 /// <summary>
172 /// Sets numeric variables for the engine.
173 /// </summary>
174 /// <param name="name">The name of the variable.</param>
175 /// <param name="value">The value to set.</param>
176 void SetVariableNumeric(string name, long value);
177
178 /// <summary>
179 /// Sets string variables for the engine using SecureStrings.
180 /// </summary>
181 /// <param name="name">The name of the variable.</param>
182 /// <param name="value">The value to set.</param>
183 /// <param name="formatted">False if the value is a literal string.</param>
184 void SetVariableString(string name, SecureString value, bool formatted);
185
186 /// <summary>
187 /// Sets string variables for the engine.
188 /// </summary>
189 /// <param name="name">The name of the variable.</param>
190 /// <param name="value">The value to set.</param>
191 /// <param name="formatted">False if the value is a literal string.</param>
192 void SetVariableString(string name, string value, bool formatted);
193
194 /// <summary>
195 /// Sets version variables for the engine.
196 /// </summary>
197 /// <param name="name">The name of the variable.</param>
198 /// <param name="value">The value to set.</param>
199 void SetVariableVersion(string name, string value);
200
201 /// <summary>
202 /// Sends error message when embedded.
203 /// </summary>
204 /// <param name="errorCode">Error code.</param>
205 /// <param name="message">Error message.</param>
206 /// <param name="uiHint">UI buttons to show on error dialog.</param>
207 int SendEmbeddedError(int errorCode, string message, int uiHint);
208
209 /// <summary>
210 /// Sends progress percentages when embedded.
211 /// </summary>
212 /// <param name="progressPercentage">Percentage completed thus far.</param>
213 /// <param name="overallPercentage">Overall percentage completed.</param>
214 int SendEmbeddedProgress(int progressPercentage, int overallPercentage);
215
216 /// <summary>
217 /// Shuts down the engine.
218 /// </summary>
219 /// <param name="exitCode">Exit code indicating reason for shut down.</param>
220 void Quit(int exitCode);
221 }
222}
diff --git a/src/api/burn/WixToolset.Mba.Core/IPackageInfo.cs b/src/api/burn/WixToolset.Mba.Core/IPackageInfo.cs
new file mode 100644
index 00000000..a1d99b10
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/IPackageInfo.cs
@@ -0,0 +1,90 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 /// <summary>
6 /// Package information from the BA manifest.
7 /// </summary>
8 public interface IPackageInfo
9 {
10 /// <summary>
11 ///
12 /// </summary>
13 BOOTSTRAPPER_CACHE_TYPE CacheType { get; }
14
15 /// <summary>
16 /// Place for the BA to store it's own custom data for this package.
17 /// </summary>
18 object CustomData { get; set; }
19
20 /// <summary>
21 ///
22 /// </summary>
23 string Description { get; }
24
25 /// <summary>
26 ///
27 /// </summary>
28 string DisplayInternalUICondition { get; }
29
30 /// <summary>
31 ///
32 /// </summary>
33 string DisplayName { get; }
34
35 /// <summary>
36 ///
37 /// </summary>
38 string Id { get; }
39
40 /// <summary>
41 ///
42 /// </summary>
43 string InstallCondition { get; }
44
45 /// <summary>
46 ///
47 /// </summary>
48 bool Permanent { get; }
49
50 /// <summary>
51 ///
52 /// </summary>
53 bool PrereqPackage { get; }
54
55 /// <summary>
56 ///
57 /// </summary>
58 string PrereqLicenseFile { get; }
59
60 /// <summary>
61 ///
62 /// </summary>
63 string PrereqLicenseUrl { get; }
64
65 /// <summary>
66 ///
67 /// </summary>
68 string ProductCode { get; }
69
70 /// <summary>
71 ///
72 /// </summary>
73 PackageType Type { get; }
74
75 /// <summary>
76 ///
77 /// </summary>
78 string UpgradeCode { get; }
79
80 /// <summary>
81 ///
82 /// </summary>
83 string Version { get; }
84
85 /// <summary>
86 ///
87 /// </summary>
88 bool Vital { get; }
89 }
90} \ No newline at end of file
diff --git a/src/api/burn/WixToolset.Mba.Core/NativeMethods.cs b/src/api/burn/WixToolset.Mba.Core/NativeMethods.cs
new file mode 100644
index 00000000..adb2256e
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/NativeMethods.cs
@@ -0,0 +1,37 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// Contains native constants, functions, and structures for this assembly.
10 /// </summary>
11 internal static class NativeMethods
12 {
13 #region Error Constants
14 internal const int S_OK = 0;
15 internal const int E_MOREDATA = unchecked((int)0x800700ea);
16 internal const int E_INSUFFICIENT_BUFFER = unchecked((int)0x8007007a);
17 internal const int E_CANCELLED = unchecked((int)0x800704c7);
18 internal const int E_ALREADYINITIALIZED = unchecked((int)0x800704df);
19 internal const int E_NOTFOUND = unchecked((int)0x80070490);
20 internal const int E_NOTIMPL = unchecked((int)0x80004001);
21 internal const int E_UNEXPECTED = unchecked((int)0x8000ffff);
22 #endregion
23
24 #region Functions
25 [DllImport("shell32.dll", ExactSpelling = true, SetLastError = true)]
26 internal static extern IntPtr CommandLineToArgvW(
27 [MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine,
28 out int pNumArgs
29 );
30
31 [DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)]
32 internal static extern IntPtr LocalFree(
33 IntPtr hMem
34 );
35 #endregion
36 }
37}
diff --git a/src/api/burn/WixToolset.Mba.Core/PackageInfo.cs b/src/api/burn/WixToolset.Mba.Core/PackageInfo.cs
new file mode 100644
index 00000000..567a7cdd
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/PackageInfo.cs
@@ -0,0 +1,317 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Xml;
8 using System.Xml.XPath;
9
10 /// <summary>
11 ///
12 /// </summary>
13 public enum PackageType
14 {
15 /// <summary>
16 ///
17 /// </summary>
18 Unknown,
19
20 /// <summary>
21 ///
22 /// </summary>
23 Exe,
24
25 /// <summary>
26 ///
27 /// </summary>
28 Msi,
29
30 /// <summary>
31 ///
32 /// </summary>
33 Msp,
34
35 /// <summary>
36 ///
37 /// </summary>
38 Msu,
39
40 /// <summary>
41 ///
42 /// </summary>
43 UpgradeBundle,
44
45 /// <summary>
46 ///
47 /// </summary>
48 AddonBundle,
49
50 /// <summary>
51 ///
52 /// </summary>
53 PatchBundle,
54 }
55
56 /// <summary>
57 /// Default implementation of <see cref="IPackageInfo"/>.
58 /// </summary>
59 public class PackageInfo : IPackageInfo
60 {
61 /// <inheritdoc/>
62 public string Id { get; internal set; }
63
64 /// <inheritdoc/>
65 public string DisplayName { get; internal set; }
66
67 /// <inheritdoc/>
68 public string Description { get; internal set; }
69
70 /// <inheritdoc/>
71 public PackageType Type { get; internal set; }
72
73 /// <inheritdoc/>
74 public bool Permanent { get; internal set; }
75
76 /// <inheritdoc/>
77 public bool Vital { get; internal set; }
78
79 /// <inheritdoc/>
80 public string DisplayInternalUICondition { get; internal set; }
81
82 /// <inheritdoc/>
83 public string ProductCode { get; internal set; }
84
85 /// <inheritdoc/>
86 public string UpgradeCode { get; internal set; }
87
88 /// <inheritdoc/>
89 public string Version { get; internal set; }
90
91 /// <inheritdoc/>
92 public string InstallCondition { get; internal set; }
93
94 /// <inheritdoc/>
95 public BOOTSTRAPPER_CACHE_TYPE CacheType { get; internal set; }
96
97 /// <inheritdoc/>
98 public bool PrereqPackage { get; internal set; }
99
100 /// <inheritdoc/>
101 public string PrereqLicenseFile { get; internal set; }
102
103 /// <inheritdoc/>
104 public string PrereqLicenseUrl { get; internal set; }
105
106 /// <inheritdoc/>
107 public object CustomData { get; set; }
108
109 internal PackageInfo() { }
110
111 /// <summary>
112 ///
113 /// </summary>
114 /// <param name="root"></param>
115 /// <returns></returns>
116 public static IDictionary<string, IPackageInfo> ParsePackagesFromXml(XPathNavigator root)
117 {
118 var packagesById = new Dictionary<string, IPackageInfo>();
119 XmlNamespaceManager namespaceManager = new XmlNamespaceManager(root.NameTable);
120 namespaceManager.AddNamespace("p", BootstrapperApplicationData.XMLNamespace);
121 XPathNodeIterator nodes = root.Select("/p:BootstrapperApplicationData/p:WixPackageProperties", namespaceManager);
122
123 foreach (XPathNavigator node in nodes)
124 {
125 var package = new PackageInfo();
126
127 string id = BootstrapperApplicationData.GetAttribute(node, "Package");
128 if (id == null)
129 {
130 throw new Exception("Failed to get package identifier for package.");
131 }
132 package.Id = id;
133
134 package.DisplayName = BootstrapperApplicationData.GetAttribute(node, "DisplayName");
135
136 package.Description = BootstrapperApplicationData.GetAttribute(node, "Description");
137
138 PackageType? packageType = GetPackageTypeAttribute(node, "PackageType");
139 if (!packageType.HasValue)
140 {
141 throw new Exception("Failed to get package type for package.");
142 }
143 package.Type = packageType.Value;
144
145 bool? permanent = BootstrapperApplicationData.GetYesNoAttribute(node, "Permanent");
146 if (!permanent.HasValue)
147 {
148 throw new Exception("Failed to get permanent settings for package.");
149 }
150 package.Permanent = permanent.Value;
151
152 bool? vital = BootstrapperApplicationData.GetYesNoAttribute(node, "Vital");
153 if (!vital.HasValue)
154 {
155 throw new Exception("Failed to get vital setting for package.");
156 }
157 package.Vital = vital.Value;
158
159 package.ProductCode = BootstrapperApplicationData.GetAttribute(node, "ProductCode");
160
161 package.UpgradeCode = BootstrapperApplicationData.GetAttribute(node, "UpgradeCode");
162
163 package.Version = BootstrapperApplicationData.GetAttribute(node, "Version");
164
165 package.InstallCondition = BootstrapperApplicationData.GetAttribute(node, "InstallCondition");
166
167 packagesById.Add(package.Id, package);
168 }
169
170 ParseBalPackageInfoFromXml(root, namespaceManager, packagesById);
171 return packagesById;
172 }
173
174 /// <summary>
175 ///
176 /// </summary>
177 /// <param name="node"></param>
178 /// <param name="attributeName"></param>
179 /// <returns></returns>
180 public static BOOTSTRAPPER_CACHE_TYPE? GetCacheTypeAttribute(XPathNavigator node, string attributeName)
181 {
182 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName);
183
184 if (attributeValue == null)
185 {
186 return null;
187 }
188
189 if (attributeValue.Equals("keep", StringComparison.InvariantCulture))
190 {
191 return BOOTSTRAPPER_CACHE_TYPE.Keep;
192 }
193 else if (attributeValue.Equals("force", StringComparison.InvariantCulture))
194 {
195 return BOOTSTRAPPER_CACHE_TYPE.Force;
196 }
197 else
198 {
199 return BOOTSTRAPPER_CACHE_TYPE.Remove;
200 }
201 }
202
203 /// <summary>
204 ///
205 /// </summary>
206 /// <param name="node"></param>
207 /// <param name="attributeName"></param>
208 /// <returns></returns>
209 public static PackageType? GetPackageTypeAttribute(XPathNavigator node, string attributeName)
210 {
211 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName);
212
213 if (attributeValue == null)
214 {
215 return null;
216 }
217
218 if (attributeValue.Equals("Exe", StringComparison.InvariantCulture))
219 {
220 return PackageType.Exe;
221 }
222 else if (attributeValue.Equals("Msi", StringComparison.InvariantCulture))
223 {
224 return PackageType.Msi;
225 }
226 else if (attributeValue.Equals("Msp", StringComparison.InvariantCulture))
227 {
228 return PackageType.Msp;
229 }
230 else if (attributeValue.Equals("Msu", StringComparison.InvariantCulture))
231 {
232 return PackageType.Msu;
233 }
234 else
235 {
236 return PackageType.Unknown;
237 }
238 }
239
240 /// <summary>
241 ///
242 /// </summary>
243 /// <param name="id"></param>
244 /// <param name="relationType"></param>
245 /// <param name="perMachine"></param>
246 /// <param name="version"></param>
247 /// <returns></returns>
248 public static IPackageInfo GetRelatedBundleAsPackage(string id, RelationType relationType, bool perMachine, string version)
249 {
250 PackageInfo package = new PackageInfo();
251 package.Id = id;
252 package.Version = version;
253
254 switch (relationType)
255 {
256 case RelationType.Addon:
257 package.Type = PackageType.AddonBundle;
258 break;
259 case RelationType.Patch:
260 package.Type = PackageType.PatchBundle;
261 break;
262 case RelationType.Upgrade:
263 package.Type = PackageType.UpgradeBundle;
264 break;
265 default:
266 throw new Exception(string.Format("Unknown related bundle type: {0}", relationType));
267 }
268
269 return package;
270 }
271
272 internal static void ParseBalPackageInfoFromXml(XPathNavigator root, XmlNamespaceManager namespaceManager, Dictionary<string, IPackageInfo> packagesById)
273 {
274 XPathNodeIterator nodes = root.Select("/p:BootstrapperApplicationData/p:WixBalPackageInfo", namespaceManager);
275
276 foreach (XPathNavigator node in nodes)
277 {
278 string id = BootstrapperApplicationData.GetAttribute(node, "PackageId");
279 if (id == null)
280 {
281 throw new Exception("Failed to get package identifier for WixBalPackageInfo.");
282 }
283
284 if (!packagesById.TryGetValue(id, out var ipackage))
285 {
286 throw new Exception(string.Format("Failed to find package specified in WixBalPackageInfo: {0}", id));
287 }
288
289 var package = (PackageInfo)ipackage;
290
291 package.DisplayInternalUICondition = BootstrapperApplicationData.GetAttribute(node, "DisplayInternalUICondition");
292 }
293
294 nodes = root.Select("/p:BootstrapperApplicationData/p:WixMbaPrereqInformation", namespaceManager);
295
296 foreach (XPathNavigator node in nodes)
297 {
298 string id = BootstrapperApplicationData.GetAttribute(node, "PackageId");
299 if (id == null)
300 {
301 throw new Exception("Failed to get package identifier for WixMbaPrereqInformation.");
302 }
303
304 if (!packagesById.TryGetValue(id, out var ipackage))
305 {
306 throw new Exception(string.Format("Failed to find package specified in WixMbaPrereqInformation: {0}", id));
307 }
308
309 var package = (PackageInfo)ipackage;
310
311 package.PrereqPackage = true;
312 package.PrereqLicenseFile = BootstrapperApplicationData.GetAttribute(node, "LicenseFile");
313 package.PrereqLicenseUrl = BootstrapperApplicationData.GetAttribute(node, "LicenseUrl");
314 }
315 }
316 }
317}
diff --git a/src/api/burn/WixToolset.Mba.Core/VerUtil.cs b/src/api/burn/WixToolset.Mba.Core/VerUtil.cs
new file mode 100644
index 00000000..81c5b716
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/VerUtil.cs
@@ -0,0 +1,145 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7 using System.Text;
8
9 /// <summary>
10 /// Managed wrapper for verutil.
11 /// </summary>
12 public static class VerUtil
13 {
14 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
15 internal static extern int VerCompareParsedVersions(
16 VersionHandle pVersion1,
17 VersionHandle pVersion2
18 );
19
20 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
21 internal static extern int VerCompareStringVersions(
22 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion1,
23 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion2,
24 [MarshalAs(UnmanagedType.Bool)] bool fStrict
25 );
26
27 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
28 internal static extern VersionHandle VerCopyVersion(
29 VersionHandle pSource
30 );
31
32 [DllImport("mbanative.dll", ExactSpelling = true)]
33 internal static extern void VerFreeVersion(
34 IntPtr pVersion
35 );
36
37 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
38 internal static extern VersionHandle VerParseVersion(
39 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
40 [MarshalAs(UnmanagedType.U4)] uint cchValue,
41 [MarshalAs(UnmanagedType.Bool)] bool fStrict
42 );
43
44 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
45 internal static extern VersionHandle VerVersionFromQword(
46 [MarshalAs(UnmanagedType.I8)] long qwVersion
47 );
48
49 [StructLayout(LayoutKind.Sequential)]
50 internal struct VersionReleaseLabelStruct
51 {
52 public bool fNumeric;
53 public uint dwValue;
54 public IntPtr cchLabelOffset;
55 public int cchLabel;
56 }
57
58 [StructLayout(LayoutKind.Sequential)]
59 internal struct VersionStruct
60 {
61 public IntPtr sczVersion;
62 public uint dwMajor;
63 public uint dwMinor;
64 public uint dwPatch;
65 public uint dwRevision;
66 public int cReleaseLabels;
67 public IntPtr rgReleaseLabels;
68 public IntPtr cchMetadataOffset;
69 public bool fInvalid;
70 }
71
72 internal static string VersionStringFromOffset(IntPtr wzVersion, IntPtr cchOffset, int? cchLength = null)
73 {
74 var offset = cchOffset.ToInt64() * UnicodeEncoding.CharSize;
75 var wz = new IntPtr(wzVersion.ToInt64() + offset);
76 if (cchLength.HasValue)
77 {
78 return Marshal.PtrToStringUni(wz, (int)cchLength);
79 }
80 else
81 {
82 return Marshal.PtrToStringUni(wz);
83 }
84 }
85
86 internal sealed class VersionHandle : SafeHandle
87 {
88 public VersionHandle() : base(IntPtr.Zero, true) { }
89
90 public override bool IsInvalid => false;
91
92 protected override bool ReleaseHandle()
93 {
94 VerFreeVersion(this.handle);
95 return true;
96 }
97 }
98
99 /// <returns>0 if equal, 1 if version1 &gt; version2, -1 if version1 &lt; version2</returns>
100 public static int CompareParsedVersions(VerUtilVersion version1, VerUtilVersion version2)
101 {
102 return VerCompareParsedVersions(version1.GetHandle(), version2.GetHandle());
103 }
104
105 /// <returns>0 if equal, 1 if version1 &gt; version2, -1 if version1 &lt; version2</returns>
106 public static int CompareStringVersions(string version1, string version2, bool strict)
107 {
108 return VerCompareStringVersions(version1, version2, strict);
109 }
110
111 /// <summary>
112 ///
113 /// </summary>
114 /// <param name="version"></param>
115 /// <returns></returns>
116 public static VerUtilVersion CopyVersion(VerUtilVersion version)
117 {
118 var handle = VerCopyVersion(version.GetHandle());
119 return new VerUtilVersion(handle);
120 }
121
122 /// <summary>
123 ///
124 /// </summary>
125 /// <param name="version"></param>
126 /// <param name="strict">Whether to throw exception on invalid version.</param>
127 /// <returns></returns>
128 public static VerUtilVersion ParseVersion(string version, bool strict)
129 {
130 var handle = VerParseVersion(version, 0, strict);
131 return new VerUtilVersion(handle);
132 }
133
134 /// <summary>
135 ///
136 /// </summary>
137 /// <param name="version"></param>
138 /// <returns></returns>
139 public static VerUtilVersion VersionFromQword(long version)
140 {
141 var handle = VerVersionFromQword(version);
142 return new VerUtilVersion(handle);
143 }
144 }
145}
diff --git a/src/api/burn/WixToolset.Mba.Core/VerUtilVersion.cs b/src/api/burn/WixToolset.Mba.Core/VerUtilVersion.cs
new file mode 100644
index 00000000..7408c26f
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/VerUtilVersion.cs
@@ -0,0 +1,99 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// An enhanced implementation of SemVer 2.0.
10 /// </summary>
11 public sealed class VerUtilVersion : IDisposable
12 {
13 internal VerUtilVersion(VerUtil.VersionHandle handle)
14 {
15 this.Handle = handle;
16
17 var pVersion = handle.DangerousGetHandle();
18 var version = (VerUtil.VersionStruct)Marshal.PtrToStructure(pVersion, typeof(VerUtil.VersionStruct));
19 this.Version = Marshal.PtrToStringUni(version.sczVersion);
20 this.Major = version.dwMajor;
21 this.Minor = version.dwMinor;
22 this.Patch = version.dwPatch;
23 this.Revision = version.dwRevision;
24 this.ReleaseLabels = new VerUtilVersionReleaseLabel[version.cReleaseLabels];
25 this.Metadata = VerUtil.VersionStringFromOffset(version.sczVersion, version.cchMetadataOffset);
26 this.IsInvalid = version.fInvalid;
27
28 for (var i = 0; i < version.cReleaseLabels; ++i)
29 {
30 var offset = i * Marshal.SizeOf(typeof(VerUtil.VersionReleaseLabelStruct));
31 var pReleaseLabel = new IntPtr(version.rgReleaseLabels.ToInt64() + offset);
32 this.ReleaseLabels[i] = new VerUtilVersionReleaseLabel(pReleaseLabel, version.sczVersion);
33 }
34 }
35
36 /// <summary>
37 /// String version, which would have stripped the leading 'v'.
38 /// </summary>
39 public string Version { get; private set; }
40
41 /// <summary>
42 /// For version A.B.C.D, Major is A. It is 0 if not specified.
43 /// </summary>
44 public uint Major { get; private set; }
45
46 /// <summary>
47 /// For version A.B.C.D, Minor is B. It is 0 if not specified.
48 /// </summary>
49 public uint Minor { get; private set; }
50
51 /// <summary>
52 /// For version A.B.C.D, Patch is C. It is 0 if not specified.
53 /// </summary>
54 public uint Patch { get; private set; }
55
56 /// <summary>
57 /// For version A.B.C.D, Revision is D. It is 0 if not specified.
58 /// </summary>
59 public uint Revision { get; private set; }
60
61 /// <summary>
62 /// For version X.Y.Z-releaselabels+metadata, ReleaseLabels is the parsed information for releaselabels.
63 /// </summary>
64 public VerUtilVersionReleaseLabel[] ReleaseLabels { get; private set; }
65
66 /// <summary>
67 /// For version X.Y.Z-releaselabels+metadata, Metadata is the rest of the string after +.
68 /// For invalid versions, it is all of the string after the point where it was an invalid string.
69 /// </summary>
70 public string Metadata { get; private set; }
71
72 /// <summary>
73 /// Whether the version conformed to the spec.
74 /// </summary>
75 public bool IsInvalid { get; private set; }
76
77 /// <inheritdoc/>
78 public void Dispose()
79 {
80 if (this.Handle != null)
81 {
82 this.Handle.Dispose();
83 this.Handle = null;
84 }
85 }
86
87 private VerUtil.VersionHandle Handle { get; set; }
88
89 internal VerUtil.VersionHandle GetHandle()
90 {
91 if (this.Handle == null)
92 {
93 throw new ObjectDisposedException(this.Version);
94 }
95
96 return this.Handle;
97 }
98 }
99}
diff --git a/src/api/burn/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs b/src/api/burn/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs
new file mode 100644
index 00000000..97e8190d
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/VerUtilVersionReleaseLabel.cs
@@ -0,0 +1,36 @@
1// 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.
2
3namespace WixToolset.Mba.Core
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// A release label from a <see cref="VerUtilVersion"/>.
10 /// </summary>
11 public sealed class VerUtilVersionReleaseLabel
12 {
13 internal VerUtilVersionReleaseLabel(IntPtr pReleaseLabel, IntPtr wzVersion)
14 {
15 var releaseLabel = (VerUtil.VersionReleaseLabelStruct)Marshal.PtrToStructure(pReleaseLabel, typeof(VerUtil.VersionReleaseLabelStruct));
16 this.IsNumeric = releaseLabel.fNumeric;
17 this.Value = releaseLabel.dwValue;
18 this.Label = VerUtil.VersionStringFromOffset(wzVersion, releaseLabel.cchLabelOffset, releaseLabel.cchLabel);
19 }
20
21 /// <summary>
22 /// Whether the label was parsed as a number.
23 /// </summary>
24 public bool IsNumeric { get; private set; }
25
26 /// <summary>
27 /// If <see cref="IsNumeric"/> then the value that was parsed.
28 /// </summary>
29 public uint Value { get; private set; }
30
31 /// <summary>
32 /// The string version of the label.
33 /// </summary>
34 public string Label { get; private set; }
35 }
36}
diff --git a/src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj b/src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj
new file mode 100644
index 00000000..2bd7ca80
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.csproj
@@ -0,0 +1,59 @@
1<?xml version="1.0" encoding="utf-8"?>
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<Project Sdk="Microsoft.NET.Sdk">
5 <PropertyGroup>
6 <TargetFrameworks>netstandard2.0;net20</TargetFrameworks>
7 <AssemblyName>WixToolset.Mba.Core</AssemblyName>
8 <RootNamespace>WixToolset.Mba.Core</RootNamespace>
9 <DebugType>embedded</DebugType>
10 <Description>Managed Bootstrapper Application Core</Description>
11 <NuspecFile>$(MSBuildThisFileName).nuspec</NuspecFile>
12 <IncludeSymbols>true</IncludeSymbols>
13 <CreateDocumentationFile>true</CreateDocumentationFile>
14 </PropertyGroup>
15
16 <ItemGroup>
17 <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
18 <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
19 </ItemGroup>
20
21 <PropertyGroup>
22 <NuspecBasePath>$(OutputPath)</NuspecBasePath>
23 <NativeFileListPath Condition=" '$(NCrunch)'=='' ">$(MSBuildProjectDir)..\..\build\obj\$(ProjectName)\$(Configuration)\NativeFileList.txt</NativeFileListPath>
24 <NativeFileListPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalProjectDir)..\..\build\obj\$(ProjectName)\$(Configuration)\NativeFileList.txt</NativeFileListPath>
25 </PropertyGroup>
26
27 <Target Name="BuildMbaNative" BeforeTargets="GetCopyToOutputDirectoryItems" Condition=" '$(NCrunch)'=='' ">
28 <MSBuild Projects="..\mbanative\mbanative.vcxproj" Properties="Platform=Win32" Targets="Build;BuiltProjectOutputGroup;ContentFilesProjectOutputGroup;DebugSymbolsProjectOutputGroup">
29 <Output TaskParameter="TargetOutputs" ItemName="_NativeProjectOutput" />
30 </MSBuild>
31
32 <WriteLinesToFile File="$(NativeFileListPath)" Lines="@(_NativeProjectOutput)" Overwrite="true" />
33
34 <ItemGroup>
35 <FileWrites Include="$(NativeFileListPath)" />
36
37 <AllItemsFullPathWithTargetPath Include="@(_NativeProjectOutput->'%(FullPath)')">
38 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
39 <TargetPath>%(Filename)%(Extension)</TargetPath>
40 </AllItemsFullPathWithTargetPath>
41 </ItemGroup>
42 </Target>
43
44 <Target Name="NCrunchCopyNative" AfterTargets="AfterBuild" Condition=" '$(NCrunch)'=='1' ">
45 <ReadLinesFromFile File="$(NativeFileListPath)">
46 <Output TaskParameter="Lines" ItemName="_NCrunchNativeProjectOutput" />
47 </ReadLinesFromFile>
48
49 <Error Text="You must build $(MSBuildProjectName) to create the referenced native projects. Once built, 'Reload and rebuild' the project in the NCrunch Tests. The $(NativeFileListPath) file must not be empty." Condition=" '@(_NCrunchNativeProjectOutput)'=='' " />
50
51 <Copy SourceFiles="@(_NCrunchNativeProjectOutput)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true">
52 <Output TaskParameter="CopiedFiles" ItemName="_NCrunchNativeCopied" />
53 </Copy>
54
55 <ItemGroup>
56 <FileWrites Include="@(_NCrunchNativeCopied)" />
57 </ItemGroup>
58 </Target>
59</Project>
diff --git a/src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec b/src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec
new file mode 100644
index 00000000..a5e09ea9
--- /dev/null
+++ b/src/api/burn/WixToolset.Mba.Core/WixToolset.Mba.Core.nuspec
@@ -0,0 +1,33 @@
1<?xml version="1.0"?>
2<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3 <metadata minClientVersion="4.0">
4 <id>$id$</id>
5 <version>$version$</version>
6 <authors>$authors$</authors>
7 <owners>$authors$</owners>
8 <license type="expression">MS-RL</license>
9 <projectUrl>https://github.com/wixtoolset/balutil</projectUrl>
10 <requireLicenseAcceptance>false</requireLicenseAcceptance>
11 <description>$description$</description>
12 <copyright>$copyright$</copyright>
13 <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" />
14 <dependencies>
15 <group targetFramework=".NETFramework2.0" />
16 <group targetFramework=".NETStandard2.0" />
17 </dependencies>
18 </metadata>
19
20 <files>
21 <file src="net20\$id$.dll" target="lib\net20" />
22 <file src="net20\$id$.xml" target="lib\net20" />
23 <file src="netstandard2.0\$id$.dll" target="lib\netstandard2.0" />
24 <file src="netstandard2.0\$id$.xml" target="lib\netstandard2.0" />
25
26 <file src="v142\ARM64\mbanative.dll" target="runtimes\win-arm64\native" />
27 <file src="v142\ARM64\mbanative.pdb" target="runtimes\win-arm64\native" />
28 <file src="v142\x64\mbanative.dll" target="runtimes\win-x64\native" />
29 <file src="v142\x64\mbanative.pdb" target="runtimes\win-x64\native" />
30 <file src="v142\x86\mbanative.dll" target="runtimes\win-x86\native" />
31 <file src="v142\x86\mbanative.pdb" target="runtimes\win-x86\native" />
32 </files>
33</package>