aboutsummaryrefslogtreecommitdiff
path: root/src/api/burn/WixToolset.BootstrapperApplicationApi
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2024-03-06 14:48:10 -0800
committerRob Mensching <rob@firegiant.com>2024-03-07 10:55:57 -0800
commit3d2d46f62fc01e2653d0251ad9703090574e7c41 (patch)
treeffdf7dce6c646f38b5e3ad8325c2ce78ca891a1a /src/api/burn/WixToolset.BootstrapperApplicationApi
parenta8504dc4eb1c2d09965b0858699ac737336ef3c1 (diff)
downloadwix-3d2d46f62fc01e2653d0251ad9703090574e7c41.tar.gz
wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.tar.bz2
wix-3d2d46f62fc01e2653d0251ad9703090574e7c41.zip
Better .nupkg names
Diffstat (limited to 'src/api/burn/WixToolset.BootstrapperApplicationApi')
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/BalUtil.cs53
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/BaseBootstrapperApplicationFactory.cs53
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplication.cs2164
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplicationData.cs101
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplicationFactoryAttribute.cs31
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs239
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/BundleInfo.cs99
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs349
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/EventArgs.cs2757
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplication.cs2013
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplicationData.cs22
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplicationFactory.cs22
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs79
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs501
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IBundleInfo.cs54
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IDefaultBootstrapperApplication.cs436
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs230
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IMbaCommand.cs35
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariableInfo.cs15
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariables.cs37
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/IPackageInfo.cs100
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/ManagedBootstrapperApplication.cs19
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/MbaCommand.cs38
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/MbaNative.cs18
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs49
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariableInfo.cs15
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariables.cs87
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/PackageInfo.cs391
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/StrUtil.cs54
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtil.cs146
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtilVersion.cs129
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtilVersionReleaseLabel.cs36
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.csproj27
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec46
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/build/WixToolset.BootstrapperApplicationApi.props18
-rw-r--r--src/api/burn/WixToolset.BootstrapperApplicationApi/build/_._0
36 files changed, 10463 insertions, 0 deletions
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/BalUtil.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BalUtil.cs
new file mode 100644
index 00000000..25257554
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/BalUtil.cs
@@ -0,0 +1,53 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 internal static class BalUtil
9 {
10 [DllImport("mbanative.dll", ExactSpelling = true)]
11 internal static extern int BalEscapeStringFromEngine(
12 [MarshalAs(UnmanagedType.Interface)] IBootstrapperEngine pEngine,
13 [MarshalAs(UnmanagedType.LPWStr)] string wzIn,
14 ref StrUtil.StrHandle psczOut
15 );
16
17 [DllImport("mbanative.dll", ExactSpelling = true)]
18 internal static extern int BalFormatStringFromEngine(
19 [MarshalAs(UnmanagedType.Interface)] IBootstrapperEngine pEngine,
20 [MarshalAs(UnmanagedType.LPWStr)] string wzFormat,
21 ref StrUtil.StrHandle psczOut
22 );
23
24 [DllImport("mbanative.dll", ExactSpelling = true)]
25 internal static extern int BalGetStringVariableFromEngine(
26 [MarshalAs(UnmanagedType.Interface)] IBootstrapperEngine pEngine,
27 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
28 ref StrUtil.StrHandle psczOut
29 );
30
31 [DllImport("mbanative.dll", ExactSpelling = true)]
32 internal static extern int BalGetVersionVariableFromEngine(
33 [MarshalAs(UnmanagedType.Interface)] IBootstrapperEngine pEngine,
34 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
35 ref StrUtil.StrHandle psczOut
36 );
37
38 [DllImport("mbanative.dll", ExactSpelling = true)]
39 internal static extern int BalGetRelatedBundleVariableFromEngine(
40 [MarshalAs(UnmanagedType.Interface)] IBootstrapperEngine pEngine,
41 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
42 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
43 ref StrUtil.StrHandle psczOut
44 );
45
46 [DllImport("mbanative.dll", ExactSpelling = true)]
47 [return: MarshalAs(UnmanagedType.Bool)]
48 internal static extern bool BalVariableExistsFromEngine(
49 [MarshalAs(UnmanagedType.Interface)] IBootstrapperEngine pEngine,
50 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable
51 );
52 }
53}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/BaseBootstrapperApplicationFactory.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BaseBootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..88b136a6
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/BaseBootstrapperApplicationFactory.cs
@@ -0,0 +1,53 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 /// <summary>
9 /// This is no longer used.
10 /// </summary>
11 [Obsolete("Bootstrapper applications now run out of proc and do not use a BootstrapperApplicationFactory. Remove your BootstrapperApplicationFactory class. See https://wixtoolset.org/docs/fiveforfour/ for more details.")]
12 public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory
13 {
14 /// <summary>
15 /// This is no longer used.
16 /// </summary>
17 /// <param name="pArgs">This is no longer used.</param>
18 /// <param name="pResults">This is no longer used.</param>
19 public void Create(IntPtr pArgs, IntPtr pResults)
20 {
21 throw new NotImplementedException();
22 }
23
24 /// <summary>
25 /// This is no longer used.
26 /// </summary>
27 /// <param name="engine">This is no longer used.</param>
28 /// <param name="bootstrapperCommand">This is no longer used.</param>
29 /// <returns>This is no longer used.</returns>
30 protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand);
31
32 /// <summary>
33 /// This is no longer used.
34 /// </summary>
35 /// <param name="pArgs">This is no longer used.</param>
36 /// <param name="engine">This is no longer used.</param>
37 /// <param name="bootstrapperCommand">This is no longer used.</param>
38 public static void InitializeFromCreateArgs(IntPtr pArgs, out IEngine engine, out IBootstrapperCommand bootstrapperCommand)
39 {
40 throw new NotImplementedException();
41 }
42
43 /// <summary>
44 /// This is no longer used.
45 /// </summary>
46 /// <param name="pResults">This is no longer used.</param>
47 /// <param name="ba">This is no longer used.</param>
48 public static void StoreBAInCreateResults(IntPtr pResults, IBootstrapperApplication ba)
49 {
50 throw new NotImplementedException();
51 }
52 }
53}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplication.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplication.cs
new file mode 100644
index 00000000..f9fca748
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplication.cs
@@ -0,0 +1,2164 @@
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.BootstrapperApplicationApi
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 /// Gets the <see cref="IEngine"/> for interaction with the engine.
17 /// </summary>
18 protected IEngine engine;
19
20 /// <inheritdoc/>
21 public event EventHandler<CreateEventArgs> Create;
22
23 /// <inheritdoc/>
24 public event EventHandler<DestroyEventArgs> Destroy;
25
26 /// <inheritdoc/>
27 public event EventHandler<StartupEventArgs> Startup;
28
29 /// <inheritdoc/>
30 public event EventHandler<ShutdownEventArgs> Shutdown;
31
32 /// <inheritdoc/>
33 public event EventHandler<DetectBeginEventArgs> DetectBegin;
34
35 /// <inheritdoc/>
36 public event EventHandler<DetectForwardCompatibleBundleEventArgs> DetectForwardCompatibleBundle;
37
38 /// <inheritdoc/>
39 public event EventHandler<DetectUpdateBeginEventArgs> DetectUpdateBegin;
40
41 /// <inheritdoc/>
42 public event EventHandler<DetectUpdateEventArgs> DetectUpdate;
43
44 /// <inheritdoc/>
45 public event EventHandler<DetectUpdateCompleteEventArgs> DetectUpdateComplete;
46
47 /// <inheritdoc/>
48 public event EventHandler<DetectRelatedBundleEventArgs> DetectRelatedBundle;
49
50 /// <inheritdoc/>
51 public event EventHandler<DetectPackageBeginEventArgs> DetectPackageBegin;
52
53 /// <inheritdoc/>
54 public event EventHandler<DetectCompatibleMsiPackageEventArgs> DetectCompatibleMsiPackage;
55
56 /// <inheritdoc/>
57 public event EventHandler<DetectRelatedMsiPackageEventArgs> DetectRelatedMsiPackage;
58
59 /// <inheritdoc/>
60 public event EventHandler<DetectPatchTargetEventArgs> DetectPatchTarget;
61
62 /// <inheritdoc/>
63 public event EventHandler<DetectMsiFeatureEventArgs> DetectMsiFeature;
64
65 /// <inheritdoc/>
66 public event EventHandler<DetectPackageCompleteEventArgs> DetectPackageComplete;
67
68 /// <inheritdoc/>
69 public event EventHandler<DetectCompleteEventArgs> DetectComplete;
70
71 /// <inheritdoc/>
72 public event EventHandler<PlanBeginEventArgs> PlanBegin;
73
74 /// <inheritdoc/>
75 public event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle;
76
77 /// <inheritdoc/>
78 public event EventHandler<PlanRelatedBundleTypeEventArgs> PlanRelatedBundleType;
79
80 /// <inheritdoc/>
81 public event EventHandler<PlanRollbackBoundaryEventArgs> PlanRollbackBoundary;
82
83 /// <inheritdoc/>
84 public event EventHandler<PlanPackageBeginEventArgs> PlanPackageBegin;
85
86 /// <inheritdoc/>
87 public event EventHandler<PlanCompatibleMsiPackageBeginEventArgs> PlanCompatibleMsiPackageBegin;
88
89 /// <inheritdoc/>
90 public event EventHandler<PlanCompatibleMsiPackageCompleteEventArgs> PlanCompatibleMsiPackageComplete;
91
92 /// <inheritdoc/>
93 public event EventHandler<PlanPatchTargetEventArgs> PlanPatchTarget;
94
95 /// <inheritdoc/>
96 public event EventHandler<PlanMsiFeatureEventArgs> PlanMsiFeature;
97
98 /// <inheritdoc/>
99 public event EventHandler<PlanMsiPackageEventArgs> PlanMsiPackage;
100
101 /// <inheritdoc/>
102 public event EventHandler<PlanPackageCompleteEventArgs> PlanPackageComplete;
103
104 /// <inheritdoc/>
105 public event EventHandler<PlannedCompatiblePackageEventArgs> PlannedCompatiblePackage;
106
107 /// <inheritdoc/>
108 public event EventHandler<PlannedPackageEventArgs> PlannedPackage;
109
110 /// <inheritdoc/>
111 public event EventHandler<PlanCompleteEventArgs> PlanComplete;
112
113 /// <inheritdoc/>
114 public event EventHandler<ApplyBeginEventArgs> ApplyBegin;
115
116 /// <inheritdoc/>
117 public event EventHandler<ElevateBeginEventArgs> ElevateBegin;
118
119 /// <inheritdoc/>
120 public event EventHandler<ElevateCompleteEventArgs> ElevateComplete;
121
122 /// <inheritdoc/>
123 public event EventHandler<ProgressEventArgs> Progress;
124
125 /// <inheritdoc/>
126 public event EventHandler<ErrorEventArgs> Error;
127
128 /// <inheritdoc/>
129 public event EventHandler<RegisterBeginEventArgs> RegisterBegin;
130
131 /// <inheritdoc/>
132 public event EventHandler<RegisterCompleteEventArgs> RegisterComplete;
133
134 /// <inheritdoc/>
135 public event EventHandler<UnregisterBeginEventArgs> UnregisterBegin;
136
137 /// <inheritdoc/>
138 public event EventHandler<UnregisterCompleteEventArgs> UnregisterComplete;
139
140 /// <inheritdoc/>
141 public event EventHandler<CacheBeginEventArgs> CacheBegin;
142
143 /// <inheritdoc/>
144 public event EventHandler<CachePackageBeginEventArgs> CachePackageBegin;
145
146 /// <inheritdoc/>
147 public event EventHandler<CacheAcquireBeginEventArgs> CacheAcquireBegin;
148
149 /// <inheritdoc/>
150 public event EventHandler<CacheAcquireProgressEventArgs> CacheAcquireProgress;
151
152 /// <inheritdoc/>
153 public event EventHandler<CacheAcquireResolvingEventArgs> CacheAcquireResolving;
154
155 /// <inheritdoc/>
156 public event EventHandler<CacheAcquireCompleteEventArgs> CacheAcquireComplete;
157
158 /// <inheritdoc/>
159 public event EventHandler<CacheVerifyBeginEventArgs> CacheVerifyBegin;
160
161 /// <inheritdoc/>
162 public event EventHandler<CacheVerifyProgressEventArgs> CacheVerifyProgress;
163
164 /// <inheritdoc/>
165 public event EventHandler<CacheVerifyCompleteEventArgs> CacheVerifyComplete;
166
167 /// <inheritdoc/>
168 public event EventHandler<CachePackageCompleteEventArgs> CachePackageComplete;
169
170 /// <inheritdoc/>
171 public event EventHandler<CacheCompleteEventArgs> CacheComplete;
172
173 /// <inheritdoc/>
174 public event EventHandler<ExecuteBeginEventArgs> ExecuteBegin;
175
176 /// <inheritdoc/>
177 public event EventHandler<ExecutePackageBeginEventArgs> ExecutePackageBegin;
178
179 /// <inheritdoc/>
180 public event EventHandler<ExecutePatchTargetEventArgs> ExecutePatchTarget;
181
182 /// <inheritdoc/>
183 public event EventHandler<ExecuteMsiMessageEventArgs> ExecuteMsiMessage;
184
185 /// <inheritdoc/>
186 public event EventHandler<ExecuteFilesInUseEventArgs> ExecuteFilesInUse;
187
188 /// <inheritdoc/>
189 public event EventHandler<ExecutePackageCompleteEventArgs> ExecutePackageComplete;
190
191 /// <inheritdoc/>
192 public event EventHandler<ExecuteCompleteEventArgs> ExecuteComplete;
193
194 /// <inheritdoc/>
195 public event EventHandler<ApplyCompleteEventArgs> ApplyComplete;
196
197 /// <inheritdoc/>
198 public event EventHandler<ApplyDowngradeEventArgs> ApplyDowngrade;
199
200 /// <inheritdoc/>
201 public event EventHandler<ExecuteProgressEventArgs> ExecuteProgress;
202
203 /// <inheritdoc/>
204 public event EventHandler<LaunchApprovedExeBeginEventArgs> LaunchApprovedExeBegin;
205
206 /// <inheritdoc/>
207 public event EventHandler<LaunchApprovedExeCompleteEventArgs> LaunchApprovedExeComplete;
208
209 /// <inheritdoc/>
210 public event EventHandler<BeginMsiTransactionBeginEventArgs> BeginMsiTransactionBegin;
211
212 /// <inheritdoc/>
213 public event EventHandler<BeginMsiTransactionCompleteEventArgs> BeginMsiTransactionComplete;
214
215 /// <inheritdoc/>
216 public event EventHandler<CommitMsiTransactionBeginEventArgs> CommitMsiTransactionBegin;
217
218 /// <inheritdoc/>
219 public event EventHandler<CommitMsiTransactionCompleteEventArgs> CommitMsiTransactionComplete;
220
221 /// <inheritdoc/>
222 public event EventHandler<RollbackMsiTransactionBeginEventArgs> RollbackMsiTransactionBegin;
223
224 /// <inheritdoc/>
225 public event EventHandler<RollbackMsiTransactionCompleteEventArgs> RollbackMsiTransactionComplete;
226
227 /// <inheritdoc/>
228 public event EventHandler<PauseAutomaticUpdatesBeginEventArgs> PauseAutomaticUpdatesBegin;
229
230 /// <inheritdoc/>
231 public event EventHandler<PauseAutomaticUpdatesCompleteEventArgs> PauseAutomaticUpdatesComplete;
232
233 /// <inheritdoc/>
234 public event EventHandler<SystemRestorePointBeginEventArgs> SystemRestorePointBegin;
235
236 /// <inheritdoc/>
237 public event EventHandler<SystemRestorePointCompleteEventArgs> SystemRestorePointComplete;
238
239 /// <inheritdoc/>
240 public event EventHandler<PlanForwardCompatibleBundleEventArgs> PlanForwardCompatibleBundle;
241
242 /// <inheritdoc/>
243 public event EventHandler<CacheContainerOrPayloadVerifyBeginEventArgs> CacheContainerOrPayloadVerifyBegin;
244
245 /// <inheritdoc/>
246 public event EventHandler<CacheContainerOrPayloadVerifyProgressEventArgs> CacheContainerOrPayloadVerifyProgress;
247
248 /// <inheritdoc/>
249 public event EventHandler<CacheContainerOrPayloadVerifyCompleteEventArgs> CacheContainerOrPayloadVerifyComplete;
250
251 /// <inheritdoc/>
252 public event EventHandler<CachePayloadExtractBeginEventArgs> CachePayloadExtractBegin;
253
254 /// <inheritdoc/>
255 public event EventHandler<CachePayloadExtractProgressEventArgs> CachePayloadExtractProgress;
256
257 /// <inheritdoc/>
258 public event EventHandler<CachePayloadExtractCompleteEventArgs> CachePayloadExtractComplete;
259
260 /// <inheritdoc/>
261 public event EventHandler<PlanRestoreRelatedBundleEventArgs> PlanRestoreRelatedBundle;
262
263 /// <inheritdoc/>
264 public event EventHandler<ExecuteProcessCancelEventArgs> ExecuteProcessCancel;
265
266 /// <inheritdoc/>
267 public event EventHandler<DetectRelatedBundlePackageEventArgs> DetectRelatedBundlePackage;
268
269 /// <inheritdoc/>
270 public event EventHandler<CachePackageNonVitalValidationFailureEventArgs> CachePackageNonVitalValidationFailure;
271
272 /// <summary>
273 /// The default constructor.
274 /// </summary>
275 /// <remarks>
276 /// The engine object will be valid after handling the OnCreate() event.
277 /// </remarks>
278 protected BootstrapperApplication()
279 {
280 }
281
282 /// <summary>
283 /// This constructor is no longer used.
284 /// </summary>
285 [Obsolete("This constructor is no longer used. Use the default constructor. The engine object will be valid after handling the OnCreate() event.")]
286 protected BootstrapperApplication(IEngine engine)
287 {
288 throw new NotImplementedException("This constructor is no longer used. Use the default constructor. The engine object will be valid after handling the OnCreate() event.");
289 }
290
291 /// <summary>
292 /// Entry point that is called when the bootstrapper application is ready to run.
293 /// </summary>
294 protected abstract void Run();
295
296 /// <summary>
297 /// Called by the engine, raises the <see cref="Create"/> event.
298 /// </summary>
299 /// <param name="args">Additional arguments for this event.</param>
300 protected virtual void OnCreate(CreateEventArgs args)
301 {
302 this.engine = args.Engine;
303
304 EventHandler<CreateEventArgs> handler = this.Create;
305 if (null != handler)
306 {
307 handler(this, args);
308 }
309 }
310
311 /// <summary>
312 /// Called by the engine, raises the <see cref="Destroy"/> event.
313 /// </summary>
314 /// <param name="args">Additional arguments for this event.</param>
315 protected virtual void OnDestroy(DestroyEventArgs args)
316 {
317 EventHandler<DestroyEventArgs> handler = this.Destroy;
318 if (null != handler)
319 {
320 handler(this, args);
321 }
322 }
323
324 /// <summary>
325 /// Called by the engine, raises the <see cref="Startup"/> event.
326 /// </summary>
327 /// <param name="args">Additional arguments for this event.</param>
328 protected virtual void OnStartup(StartupEventArgs args)
329 {
330 EventHandler<StartupEventArgs> handler = this.Startup;
331 if (null != handler)
332 {
333 handler(this, args);
334 }
335
336 Thread uiThread = new Thread(this.Run);
337 uiThread.Name = "UIThread";
338 uiThread.SetApartmentState(ApartmentState.STA);
339 uiThread.Start();
340 }
341
342 /// <summary>
343 /// Called by the engine, raises the <see cref="Shutdown"/> event.
344 /// </summary>
345 /// <param name="args">Additional arguments for this event.</param>
346 protected virtual void OnShutdown(ShutdownEventArgs args)
347 {
348 EventHandler<ShutdownEventArgs> handler = this.Shutdown;
349 if (null != handler)
350 {
351 handler(this, args);
352 }
353 }
354
355 /// <summary>
356 /// Called by the engine, raises the <see cref="DetectBegin"/> event.
357 /// </summary>
358 /// <param name="args">Additional arguments for this event.</param>
359 protected virtual void OnDetectBegin(DetectBeginEventArgs args)
360 {
361 EventHandler<DetectBeginEventArgs> handler = this.DetectBegin;
362 if (null != handler)
363 {
364 handler(this, args);
365 }
366 }
367
368 /// <summary>
369 /// Called by the engine, raises the <see cref="DetectForwardCompatibleBundle"/> event.
370 /// </summary>
371 /// <param name="args">Additional arguments for this event.</param>
372 protected virtual void OnDetectForwardCompatibleBundle(DetectForwardCompatibleBundleEventArgs args)
373 {
374 EventHandler<DetectForwardCompatibleBundleEventArgs> handler = this.DetectForwardCompatibleBundle;
375 if (null != handler)
376 {
377 handler(this, args);
378 }
379 }
380
381 /// <summary>
382 /// Called by the engine, raises the <see cref="DetectUpdateBegin"/> event.
383 /// </summary>
384 /// <param name="args">Additional arguments for this event.</param>
385 protected virtual void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args)
386 {
387 EventHandler<DetectUpdateBeginEventArgs> handler = this.DetectUpdateBegin;
388 if (null != handler)
389 {
390 handler(this, args);
391 }
392 }
393
394 /// <summary>
395 /// Called by the engine, raises the <see cref="DetectUpdate"/> event.
396 /// </summary>
397 /// <param name="args">Additional arguments for this event.</param>
398 protected virtual void OnDetectUpdate(DetectUpdateEventArgs args)
399 {
400 EventHandler<DetectUpdateEventArgs> handler = this.DetectUpdate;
401 if (null != handler)
402 {
403 handler(this, args);
404 }
405 }
406
407 /// <summary>
408 /// Called by the engine, raises the <see cref="DetectUpdateComplete"/> event.
409 /// </summary>
410 /// <param name="args">Additional arguments for this event.</param>
411 protected virtual void OnDetectUpdateComplete(DetectUpdateCompleteEventArgs args)
412 {
413 EventHandler<DetectUpdateCompleteEventArgs> handler = this.DetectUpdateComplete;
414 if (null != handler)
415 {
416 handler(this, args);
417 }
418 }
419
420 /// <summary>
421 /// Called by the engine, raises the <see cref="DetectRelatedBundle"/> event.
422 /// </summary>
423 /// <param name="args">Additional arguments for this event.</param>
424 protected virtual void OnDetectRelatedBundle(DetectRelatedBundleEventArgs args)
425 {
426 EventHandler<DetectRelatedBundleEventArgs> handler = this.DetectRelatedBundle;
427 if (null != handler)
428 {
429 handler(this, args);
430 }
431 }
432
433 /// <summary>
434 /// Called by the engine, raises the <see cref="DetectPackageBegin"/> event.
435 /// </summary>
436 /// <param name="args">Additional arguments for this event.</param>
437 protected virtual void OnDetectPackageBegin(DetectPackageBeginEventArgs args)
438 {
439 EventHandler<DetectPackageBeginEventArgs> handler = this.DetectPackageBegin;
440 if (null != handler)
441 {
442 handler(this, args);
443 }
444 }
445
446 /// <summary>
447 /// Called by the engine, raises the <see cref="DetectCompatibleMsiPackage"/> event.
448 /// </summary>
449 /// <param name="args">Additional arguments for this event.</param>
450 protected virtual void OnDetectCompatibleMsiPackage(DetectCompatibleMsiPackageEventArgs args)
451 {
452 EventHandler<DetectCompatibleMsiPackageEventArgs> handler = this.DetectCompatibleMsiPackage;
453 if (null != handler)
454 {
455 handler(this, args);
456 }
457 }
458
459 /// <summary>
460 /// Called by the engine, raises the <see cref="DetectRelatedMsiPackage"/> event.
461 /// </summary>
462 /// <param name="args">Additional arguments for this event.</param>
463 protected virtual void OnDetectRelatedMsiPackage(DetectRelatedMsiPackageEventArgs args)
464 {
465 EventHandler<DetectRelatedMsiPackageEventArgs> handler = this.DetectRelatedMsiPackage;
466 if (null != handler)
467 {
468 handler(this, args);
469 }
470 }
471
472 /// <summary>
473 /// Called by the engine, raises the <see cref="DetectPatchTarget"/> event.
474 /// </summary>
475 /// <param name="args">Additional arguments for this event.</param>
476 protected virtual void OnDetectPatchTarget(DetectPatchTargetEventArgs args)
477 {
478 EventHandler<DetectPatchTargetEventArgs> handler = this.DetectPatchTarget;
479 if (null != handler)
480 {
481 handler(this, args);
482 }
483 }
484
485 /// <summary>
486 /// Called by the engine, raises the <see cref="DetectMsiFeature"/> event.
487 /// </summary>
488 /// <param name="args">Additional arguments for this event.</param>
489 protected virtual void OnDetectMsiFeature(DetectMsiFeatureEventArgs args)
490 {
491 EventHandler<DetectMsiFeatureEventArgs> handler = this.DetectMsiFeature;
492 if (null != handler)
493 {
494 handler(this, args);
495 }
496 }
497
498 /// <summary>
499 /// Called by the engine, raises the <see cref="DetectPackageComplete"/> event.
500 /// </summary>
501 /// <param name="args">Additional arguments for this event.</param>
502 protected virtual void OnDetectPackageComplete(DetectPackageCompleteEventArgs args)
503 {
504 EventHandler<DetectPackageCompleteEventArgs> handler = this.DetectPackageComplete;
505 if (null != handler)
506 {
507 handler(this, args);
508 }
509 }
510
511 /// <summary>
512 /// Called by the engine, raises the <see cref="DetectComplete"/> event.
513 /// </summary>
514 /// <param name="args">Additional arguments for this event.</param>
515 protected virtual void OnDetectComplete(DetectCompleteEventArgs args)
516 {
517 EventHandler<DetectCompleteEventArgs> handler = this.DetectComplete;
518 if (null != handler)
519 {
520 handler(this, args);
521 }
522 }
523
524 /// <summary>
525 /// Called by the engine, raises the <see cref="PlanBegin"/> event.
526 /// </summary>
527 /// <param name="args">Additional arguments for this event.</param>
528 protected virtual void OnPlanBegin(PlanBeginEventArgs args)
529 {
530 EventHandler<PlanBeginEventArgs> handler = this.PlanBegin;
531 if (null != handler)
532 {
533 handler(this, args);
534 }
535 }
536
537 /// <summary>
538 /// Called by the engine, raises the <see cref="PlanRelatedBundle"/> event.
539 /// </summary>
540 /// <param name="args">Additional arguments for this event.</param>
541 protected virtual void OnPlanRelatedBundle(PlanRelatedBundleEventArgs args)
542 {
543 EventHandler<PlanRelatedBundleEventArgs> handler = this.PlanRelatedBundle;
544 if (null != handler)
545 {
546 handler(this, args);
547 }
548 }
549
550 /// <summary>
551 /// Called by the engine, raises the <see cref="PlanRelatedBundleType"/> event.
552 /// </summary>
553 /// <param name="args">Additional arguments for this event.</param>
554 protected virtual void OnPlanRelatedBundleType(PlanRelatedBundleTypeEventArgs args)
555 {
556 EventHandler<PlanRelatedBundleTypeEventArgs> handler = this.PlanRelatedBundleType;
557 if (null != handler)
558 {
559 handler(this, args);
560 }
561 }
562
563 /// <summary>
564 /// Called by the engine, raises the <see cref="PlanRollbackBoundary"/> event.
565 /// </summary>
566 protected virtual void OnPlanRollbackBoundary(PlanRollbackBoundaryEventArgs args)
567 {
568 EventHandler<PlanRollbackBoundaryEventArgs> handler = this.PlanRollbackBoundary;
569 if (null != handler)
570 {
571 handler(this, args);
572 }
573 }
574
575 /// <summary>
576 /// Called by the engine, raises the <see cref="PlanPackageBegin"/> event.
577 /// </summary>
578 /// <param name="args">Additional arguments for this event.</param>
579 protected virtual void OnPlanPackageBegin(PlanPackageBeginEventArgs args)
580 {
581 EventHandler<PlanPackageBeginEventArgs> handler = this.PlanPackageBegin;
582 if (null != handler)
583 {
584 handler(this, args);
585 }
586 }
587
588 /// <summary>
589 /// Called by the engine, raises the <see cref="PlanCompatibleMsiPackageBegin"/> event.
590 /// </summary>
591 /// <param name="args">Additional arguments for this event.</param>
592 protected virtual void OnPlanCompatibleMsiPackageBegin(PlanCompatibleMsiPackageBeginEventArgs args)
593 {
594 EventHandler<PlanCompatibleMsiPackageBeginEventArgs> handler = this.PlanCompatibleMsiPackageBegin;
595 if (null != handler)
596 {
597 handler(this, args);
598 }
599 }
600
601 /// <summary>
602 /// Called by the engine, raises the <see cref="PlanCompatibleMsiPackageComplete"/> event.
603 /// </summary>
604 /// <param name="args">Additional arguments for this event.</param>
605 protected virtual void OnPlanCompatibleMsiPackageComplete(PlanCompatibleMsiPackageCompleteEventArgs args)
606 {
607 EventHandler<PlanCompatibleMsiPackageCompleteEventArgs> handler = this.PlanCompatibleMsiPackageComplete;
608 if (null != handler)
609 {
610 handler(this, args);
611 }
612 }
613
614 /// <summary>
615 /// Called by the engine, raises the <see cref="PlanPatchTarget"/> event.
616 /// </summary>
617 /// <param name="args">Additional arguments for this event.</param>
618 protected virtual void OnPlanPatchTarget(PlanPatchTargetEventArgs args)
619 {
620 EventHandler<PlanPatchTargetEventArgs> handler = this.PlanPatchTarget;
621 if (null != handler)
622 {
623 handler(this, args);
624 }
625 }
626
627 /// <summary>
628 /// Called by the engine, raises the <see cref="PlanMsiFeature"/> event.
629 /// </summary>
630 /// <param name="args">Additional arguments for this event.</param>
631 protected virtual void OnPlanMsiFeature(PlanMsiFeatureEventArgs args)
632 {
633 EventHandler<PlanMsiFeatureEventArgs> handler = this.PlanMsiFeature;
634 if (null != handler)
635 {
636 handler(this, args);
637 }
638 }
639
640 /// <summary>
641 /// Called by the engine, raises the <see cref="PlanMsiPackage"/> event.
642 /// </summary>
643 /// <param name="args">Additional arguments for this event.</param>
644 protected virtual void OnPlanMsiPackage(PlanMsiPackageEventArgs args)
645 {
646 EventHandler<PlanMsiPackageEventArgs> handler = this.PlanMsiPackage;
647 if (null != handler)
648 {
649 handler(this, args);
650 }
651 }
652
653 /// <summary>
654 /// Called by the engine, raises the <see cref="PlanPackageComplete"/> event.
655 /// </summary>
656 /// <param name="args">Additional arguments for this event.</param>
657 protected virtual void OnPlanPackageComplete(PlanPackageCompleteEventArgs args)
658 {
659 EventHandler<PlanPackageCompleteEventArgs> handler = this.PlanPackageComplete;
660 if (null != handler)
661 {
662 handler(this, args);
663 }
664 }
665
666 /// <summary>
667 /// Called by the engine, raises the <see cref="PlannedCompatiblePackage"/> event.
668 /// </summary>
669 /// <param name="args">Additional arguments for this event.</param>
670 protected virtual void OnPlannedCompatiblePackage(PlannedCompatiblePackageEventArgs args)
671 {
672 EventHandler<PlannedCompatiblePackageEventArgs> handler = this.PlannedCompatiblePackage;
673 if (null != handler)
674 {
675 handler(this, args);
676 }
677 }
678
679 /// <summary>
680 /// Called by the engine, raises the <see cref="PlannedPackage"/> event.
681 /// </summary>
682 /// <param name="args">Additional arguments for this event.</param>
683 protected virtual void OnPlannedPackage(PlannedPackageEventArgs args)
684 {
685 EventHandler<PlannedPackageEventArgs> handler = this.PlannedPackage;
686 if (null != handler)
687 {
688 handler(this, args);
689 }
690 }
691
692 /// <summary>
693 /// Called by the engine, raises the <see cref="PlanComplete"/> event.
694 /// </summary>
695 /// <param name="args">Additional arguments for this event.</param>
696 protected virtual void OnPlanComplete(PlanCompleteEventArgs args)
697 {
698 EventHandler<PlanCompleteEventArgs> handler = this.PlanComplete;
699 if (null != handler)
700 {
701 handler(this, args);
702 }
703 }
704
705 /// <summary>
706 /// Called by the engine, raises the <see cref="ApplyBegin"/> event.
707 /// </summary>
708 /// <param name="args">Additional arguments for this event.</param>
709 protected virtual void OnApplyBegin(ApplyBeginEventArgs args)
710 {
711 EventHandler<ApplyBeginEventArgs> handler = this.ApplyBegin;
712 if (null != handler)
713 {
714 handler(this, args);
715 }
716 }
717
718 /// <summary>
719 /// Called by the engine, raises the <see cref="ElevateBegin"/> event.
720 /// </summary>
721 /// <param name="args">Additional arguments for this event.</param>
722 protected virtual void OnElevateBegin(ElevateBeginEventArgs args)
723 {
724 EventHandler<ElevateBeginEventArgs> handler = this.ElevateBegin;
725 if (null != handler)
726 {
727 handler(this, args);
728 }
729 }
730
731 /// <summary>
732 /// Called by the engine, raises the <see cref="ElevateComplete"/> event.
733 /// </summary>
734 /// <param name="args">Additional arguments for this event.</param>
735 protected virtual void OnElevateComplete(ElevateCompleteEventArgs args)
736 {
737 EventHandler<ElevateCompleteEventArgs> handler = this.ElevateComplete;
738 if (null != handler)
739 {
740 handler(this, args);
741 }
742 }
743
744 /// <summary>
745 /// Called by the engine, raises the <see cref="Progress"/> event.
746 /// </summary>
747 /// <param name="args">Additional arguments for this event.</param>
748 protected virtual void OnProgress(ProgressEventArgs args)
749 {
750 EventHandler<ProgressEventArgs> handler = this.Progress;
751 if (null != handler)
752 {
753 handler(this, args);
754 }
755 }
756
757 /// <summary>
758 /// Called by the engine, raises the <see cref="Error"/> event.
759 /// </summary>
760 /// <param name="args">Additional arguments for this event.</param>
761 protected virtual void OnError(ErrorEventArgs args)
762 {
763 EventHandler<ErrorEventArgs> handler = this.Error;
764 if (null != handler)
765 {
766 handler(this, args);
767 }
768 }
769
770 /// <summary>
771 /// Called by the engine, raises the <see cref="RegisterBegin"/> event.
772 /// </summary>
773 /// <param name="args">Additional arguments for this event.</param>
774 protected virtual void OnRegisterBegin(RegisterBeginEventArgs args)
775 {
776 EventHandler<RegisterBeginEventArgs> handler = this.RegisterBegin;
777 if (null != handler)
778 {
779 handler(this, args);
780 }
781 }
782
783 /// <summary>
784 /// Called by the engine, raises the <see cref="RegisterComplete"/> event.
785 /// </summary>
786 /// <param name="args">Additional arguments for this event.</param>
787 protected virtual void OnRegisterComplete(RegisterCompleteEventArgs args)
788 {
789 EventHandler<RegisterCompleteEventArgs> handler = this.RegisterComplete;
790 if (null != handler)
791 {
792 handler(this, args);
793 }
794 }
795
796 /// <summary>
797 /// Called by the engine, raises the <see cref="UnregisterBegin"/> event.
798 /// </summary>
799 /// <param name="args">Additional arguments for this event.</param>
800 protected virtual void OnUnregisterBegin(UnregisterBeginEventArgs args)
801 {
802 EventHandler<UnregisterBeginEventArgs> handler = this.UnregisterBegin;
803 if (null != handler)
804 {
805 handler(this, args);
806 }
807 }
808
809 /// <summary>
810 /// Called by the engine, raises the <see cref="UnregisterComplete"/> event.
811 /// </summary>
812 /// <param name="args">Additional arguments for this event.</param>
813 protected virtual void OnUnregisterComplete(UnregisterCompleteEventArgs args)
814 {
815 EventHandler<UnregisterCompleteEventArgs> handler = this.UnregisterComplete;
816 if (null != handler)
817 {
818 handler(this, args);
819 }
820 }
821
822 /// <summary>
823 /// Called by the engine, raises the <see cref="CacheBegin"/> event.
824 /// </summary>
825 /// <param name="args">Additional arguments for this event.</param>
826 protected virtual void OnCacheBegin(CacheBeginEventArgs args)
827 {
828 EventHandler<CacheBeginEventArgs> handler = this.CacheBegin;
829 if (null != handler)
830 {
831 handler(this, args);
832 }
833 }
834
835 /// <summary>
836 /// Called by the engine, raises the <see cref="CachePackageBegin"/> event.
837 /// </summary>
838 /// <param name="args">Additional arguments for this event.</param>
839 protected virtual void OnCachePackageBegin(CachePackageBeginEventArgs args)
840 {
841 EventHandler<CachePackageBeginEventArgs> handler = this.CachePackageBegin;
842 if (null != handler)
843 {
844 handler(this, args);
845 }
846 }
847
848 /// <summary>
849 /// Called by the engine, raises the <see cref="CacheAcquireBegin"/> event.
850 /// </summary>
851 /// <param name="args">Additional arguments for this event.</param>
852 protected virtual void OnCacheAcquireBegin(CacheAcquireBeginEventArgs args)
853 {
854 EventHandler<CacheAcquireBeginEventArgs> handler = this.CacheAcquireBegin;
855 if (null != handler)
856 {
857 handler(this, args);
858 }
859 }
860
861 /// <summary>
862 /// Called by the engine, raises the <see cref="CacheAcquireProgress"/> event.
863 /// </summary>
864 /// <param name="args">Additional arguments for this event.</param>
865 protected virtual void OnCacheAcquireProgress(CacheAcquireProgressEventArgs args)
866 {
867 EventHandler<CacheAcquireProgressEventArgs> handler = this.CacheAcquireProgress;
868 if (null != handler)
869 {
870 handler(this, args);
871 }
872 }
873
874 /// <summary>
875 /// Called by the engine, raises the <see cref="CacheAcquireResolving"/> event.
876 /// </summary>
877 /// <param name="args">Additional arguments for this event.</param>
878 protected virtual void OnCacheAcquireResolving(CacheAcquireResolvingEventArgs args)
879 {
880 EventHandler<CacheAcquireResolvingEventArgs> handler = this.CacheAcquireResolving;
881 if (null != handler)
882 {
883 handler(this, args);
884 }
885 }
886
887 /// <summary>
888 /// Called by the engine, raises the <see cref="CacheAcquireComplete"/> event.
889 /// </summary>
890 /// <param name="args">Additional arguments for this event.</param>
891 protected virtual void OnCacheAcquireComplete(CacheAcquireCompleteEventArgs args)
892 {
893 EventHandler<CacheAcquireCompleteEventArgs> handler = this.CacheAcquireComplete;
894 if (null != handler)
895 {
896 handler(this, args);
897 }
898 }
899
900 /// <summary>
901 /// Called by the engine, raises the <see cref="CacheVerifyBegin"/> event.
902 /// </summary>
903 /// <param name="args">Additional arguments for this event.</param>
904 protected virtual void OnCacheVerifyBegin(CacheVerifyBeginEventArgs args)
905 {
906 EventHandler<CacheVerifyBeginEventArgs> handler = this.CacheVerifyBegin;
907 if (null != handler)
908 {
909 handler(this, args);
910 }
911 }
912
913 /// <summary>
914 /// Called by the engine, raises the <see cref="CacheVerifyProgress"/> event.
915 /// </summary>
916 /// <param name="args">Additional arguments for this event.</param>
917 protected virtual void OnCacheVerifyProgress(CacheVerifyProgressEventArgs args)
918 {
919 EventHandler<CacheVerifyProgressEventArgs> handler = this.CacheVerifyProgress;
920 if (null != handler)
921 {
922 handler(this, args);
923 }
924 }
925
926 /// <summary>
927 /// Called by the engine, raises the <see cref="CacheVerifyComplete"/> event.
928 /// </summary>
929 /// <param name="args">Additional arguments for this event.</param>
930 protected virtual void OnCacheVerifyComplete(CacheVerifyCompleteEventArgs args)
931 {
932 EventHandler<CacheVerifyCompleteEventArgs> handler = this.CacheVerifyComplete;
933 if (null != handler)
934 {
935 handler(this, args);
936 }
937 }
938
939 /// <summary>
940 /// Called by the engine, raises the <see cref="CachePackageComplete"/> event.
941 /// </summary>
942 /// <param name="args">Additional arguments for this event.</param>
943 protected virtual void OnCachePackageComplete(CachePackageCompleteEventArgs args)
944 {
945 EventHandler<CachePackageCompleteEventArgs> handler = this.CachePackageComplete;
946 if (null != handler)
947 {
948 handler(this, args);
949 }
950 }
951
952 /// <summary>
953 /// Called by the engine, raises the <see cref="CacheComplete"/> event.
954 /// </summary>
955 /// <param name="args">Additional arguments for this event.</param>
956 protected virtual void OnCacheComplete(CacheCompleteEventArgs args)
957 {
958 EventHandler<CacheCompleteEventArgs> handler = this.CacheComplete;
959 if (null != handler)
960 {
961 handler(this, args);
962 }
963 }
964
965 /// <summary>
966 /// Called by the engine, raises the <see cref="ExecuteBegin"/> event.
967 /// </summary>
968 /// <param name="args">Additional arguments for this event.</param>
969 protected virtual void OnExecuteBegin(ExecuteBeginEventArgs args)
970 {
971 EventHandler<ExecuteBeginEventArgs> handler = this.ExecuteBegin;
972 if (null != handler)
973 {
974 handler(this, args);
975 }
976 }
977
978 /// <summary>
979 /// Called by the engine, raises the <see cref="ExecutePackageBegin"/> event.
980 /// </summary>
981 /// <param name="args">Additional arguments for this event.</param>
982 protected virtual void OnExecutePackageBegin(ExecutePackageBeginEventArgs args)
983 {
984 EventHandler<ExecutePackageBeginEventArgs> handler = this.ExecutePackageBegin;
985 if (null != handler)
986 {
987 handler(this, args);
988 }
989 }
990
991 /// <summary>
992 /// Called by the engine, raises the <see cref="ExecutePatchTarget"/> event.
993 /// </summary>
994 /// <param name="args">Additional arguments for this event.</param>
995 protected virtual void OnExecutePatchTarget(ExecutePatchTargetEventArgs args)
996 {
997 EventHandler<ExecutePatchTargetEventArgs> handler = this.ExecutePatchTarget;
998 if (null != handler)
999 {
1000 handler(this, args);
1001 }
1002 }
1003
1004 /// <summary>
1005 /// Called by the engine, raises the <see cref="ExecuteMsiMessage"/> event.
1006 /// </summary>
1007 /// <param name="args">Additional arguments for this event.</param>
1008 protected virtual void OnExecuteMsiMessage(ExecuteMsiMessageEventArgs args)
1009 {
1010 EventHandler<ExecuteMsiMessageEventArgs> handler = this.ExecuteMsiMessage;
1011 if (null != handler)
1012 {
1013 handler(this, args);
1014 }
1015 }
1016
1017 /// <summary>
1018 /// Called by the engine, raises the <see cref="ExecuteFilesInUse"/> event.
1019 /// </summary>
1020 /// <param name="args">Additional arguments for this event.</param>
1021 protected virtual void OnExecuteFilesInUse(ExecuteFilesInUseEventArgs args)
1022 {
1023 EventHandler<ExecuteFilesInUseEventArgs> handler = this.ExecuteFilesInUse;
1024 if (null != handler)
1025 {
1026 handler(this, args);
1027 }
1028 }
1029
1030 /// <summary>
1031 /// Called by the engine, raises the <see cref="ExecutePackageComplete"/> event.
1032 /// </summary>
1033 /// <param name="args">Additional arguments for this event.</param>
1034 protected virtual void OnExecutePackageComplete(ExecutePackageCompleteEventArgs args)
1035 {
1036 EventHandler<ExecutePackageCompleteEventArgs> handler = this.ExecutePackageComplete;
1037 if (null != handler)
1038 {
1039 handler(this, args);
1040 }
1041 }
1042
1043 /// <summary>
1044 /// Called by the engine, raises the <see cref="ExecuteComplete"/> event.
1045 /// </summary>
1046 /// <param name="args">Additional arguments for this event.</param>
1047 protected virtual void OnExecuteComplete(ExecuteCompleteEventArgs args)
1048 {
1049 EventHandler<ExecuteCompleteEventArgs> handler = this.ExecuteComplete;
1050 if (null != handler)
1051 {
1052 handler(this, args);
1053 }
1054 }
1055
1056 /// <summary>
1057 /// Called by the engine, raises the <see cref="ApplyComplete"/> event.
1058 /// </summary>
1059 /// <param name="args">Additional arguments for this event.</param>
1060 protected virtual void OnApplyComplete(ApplyCompleteEventArgs args)
1061 {
1062 EventHandler<ApplyCompleteEventArgs> handler = this.ApplyComplete;
1063 if (null != handler)
1064 {
1065 handler(this, args);
1066 }
1067 }
1068
1069 /// <summary>
1070 /// Called by the engine, raises the <see cref="ApplyDowngrade"/> event.
1071 /// </summary>
1072 /// <param name="args">Additional arguments for this event.</param>
1073 protected virtual void OnApplyDowngrade(ApplyDowngradeEventArgs args)
1074 {
1075 EventHandler<ApplyDowngradeEventArgs> handler = this.ApplyDowngrade;
1076 if (null != handler)
1077 {
1078 handler(this, args);
1079 }
1080 }
1081
1082 /// <summary>
1083 /// Called by the engine, raises the <see cref="ExecuteProgress"/> event.
1084 /// </summary>
1085 /// <param name="args">Additional arguments for this event.</param>
1086 protected virtual void OnExecuteProgress(ExecuteProgressEventArgs args)
1087 {
1088 EventHandler<ExecuteProgressEventArgs> handler = this.ExecuteProgress;
1089 if (null != handler)
1090 {
1091 handler(this, args);
1092 }
1093 }
1094
1095 /// <summary>
1096 /// Called by the engine, raises the <see cref="LaunchApprovedExeBegin"/> event.
1097 /// </summary>
1098 /// <param name="args">Additional arguments for this event.</param>
1099 protected virtual void OnLaunchApprovedExeBegin(LaunchApprovedExeBeginEventArgs args)
1100 {
1101 EventHandler<LaunchApprovedExeBeginEventArgs> handler = this.LaunchApprovedExeBegin;
1102 if (null != handler)
1103 {
1104 handler(this, args);
1105 }
1106 }
1107
1108 /// <summary>
1109 /// Called by the engine, raises the <see cref="LaunchApprovedExeComplete"/> event.
1110 /// </summary>
1111 /// <param name="args">Additional arguments for this event.</param>
1112 protected virtual void OnLaunchApprovedExeComplete(LaunchApprovedExeCompleteEventArgs args)
1113 {
1114 EventHandler<LaunchApprovedExeCompleteEventArgs> handler = this.LaunchApprovedExeComplete;
1115 if (null != handler)
1116 {
1117 handler(this, args);
1118 }
1119 }
1120
1121 /// <summary>
1122 /// Called by the engine, raises the <see cref="BeginMsiTransactionBegin"/> event.
1123 /// </summary>
1124 /// <param name="args">Additional arguments for this event.</param>
1125 protected virtual void OnBeginMsiTransactionBegin(BeginMsiTransactionBeginEventArgs args)
1126 {
1127 EventHandler<BeginMsiTransactionBeginEventArgs> handler = this.BeginMsiTransactionBegin;
1128 if (null != handler)
1129 {
1130 handler(this, args);
1131 }
1132 }
1133
1134 /// <summary>
1135 /// Called by the engine, raises the <see cref="BeginMsiTransactionComplete"/> event.
1136 /// </summary>
1137 /// <param name="args">Additional arguments for this event.</param>
1138 protected virtual void OnBeginMsiTransactionComplete(BeginMsiTransactionCompleteEventArgs args)
1139 {
1140 EventHandler<BeginMsiTransactionCompleteEventArgs> handler = this.BeginMsiTransactionComplete;
1141 if (null != handler)
1142 {
1143 handler(this, args);
1144 }
1145 }
1146
1147 /// <summary>
1148 /// Called by the engine, raises the <see cref="CommitMsiTransactionBegin"/> event.
1149 /// </summary>
1150 /// <param name="args">Additional arguments for this event.</param>
1151 protected virtual void OnCommitMsiTransactionBegin(CommitMsiTransactionBeginEventArgs args)
1152 {
1153 EventHandler<CommitMsiTransactionBeginEventArgs> handler = this.CommitMsiTransactionBegin;
1154 if (null != handler)
1155 {
1156 handler(this, args);
1157 }
1158 }
1159
1160 /// <summary>
1161 /// Called by the engine, raises the <see cref="CommitMsiTransactionComplete"/> event.
1162 /// </summary>
1163 /// <param name="args">Additional arguments for this event.</param>
1164 protected virtual void OnCommitMsiTransactionComplete(CommitMsiTransactionCompleteEventArgs args)
1165 {
1166 EventHandler<CommitMsiTransactionCompleteEventArgs> handler = this.CommitMsiTransactionComplete;
1167 if (null != handler)
1168 {
1169 handler(this, args);
1170 }
1171 }
1172
1173 /// <summary>
1174 /// Called by the engine, raises the <see cref="RollbackMsiTransactionBegin"/> event.
1175 /// </summary>
1176 /// <param name="args">Additional arguments for this event.</param>
1177 protected virtual void OnRollbackMsiTransactionBegin(RollbackMsiTransactionBeginEventArgs args)
1178 {
1179 EventHandler<RollbackMsiTransactionBeginEventArgs> handler = this.RollbackMsiTransactionBegin;
1180 if (null != handler)
1181 {
1182 handler(this, args);
1183 }
1184 }
1185
1186 /// <summary>
1187 /// Called by the engine, raises the <see cref="RollbackMsiTransactionComplete"/> event.
1188 /// </summary>
1189 /// <param name="args">Additional arguments for this event.</param>
1190 protected virtual void OnRollbackMsiTransactionComplete(RollbackMsiTransactionCompleteEventArgs args)
1191 {
1192 EventHandler<RollbackMsiTransactionCompleteEventArgs> handler = this.RollbackMsiTransactionComplete;
1193 if (null != handler)
1194 {
1195 handler(this, args);
1196 }
1197 }
1198
1199 /// <summary>
1200 /// Called by the engine, raises the <see cref="PauseAutomaticUpdatesBegin"/> event.
1201 /// </summary>
1202 /// <param name="args">Additional arguments for this event.</param>
1203 protected virtual void OnPauseAutomaticUpdatesBegin(PauseAutomaticUpdatesBeginEventArgs args)
1204 {
1205 EventHandler<PauseAutomaticUpdatesBeginEventArgs> handler = this.PauseAutomaticUpdatesBegin;
1206 if (null != handler)
1207 {
1208 handler(this, args);
1209 }
1210 }
1211
1212 /// <summary>
1213 /// Called by the engine, raises the <see cref="PauseAutomaticUpdatesComplete"/> event.
1214 /// </summary>
1215 /// <param name="args">Additional arguments for this event.</param>
1216 protected virtual void OnPauseAutomaticUpdatesComplete(PauseAutomaticUpdatesCompleteEventArgs args)
1217 {
1218 EventHandler<PauseAutomaticUpdatesCompleteEventArgs> handler = this.PauseAutomaticUpdatesComplete;
1219 if (null != handler)
1220 {
1221 handler(this, args);
1222 }
1223 }
1224
1225 /// <summary>
1226 /// Called by the engine, raises the <see cref="SystemRestorePointBegin"/> event.
1227 /// </summary>
1228 /// <param name="args">Additional arguments for this event.</param>
1229 protected virtual void OnSystemRestorePointBegin(SystemRestorePointBeginEventArgs args)
1230 {
1231 EventHandler<SystemRestorePointBeginEventArgs> handler = this.SystemRestorePointBegin;
1232 if (null != handler)
1233 {
1234 handler(this, args);
1235 }
1236 }
1237
1238 /// <summary>
1239 /// Called by the engine, raises the <see cref="SystemRestorePointComplete"/> event.
1240 /// </summary>
1241 /// <param name="args">Additional arguments for this event.</param>
1242 protected virtual void OnSystemRestorePointComplete(SystemRestorePointCompleteEventArgs args)
1243 {
1244 EventHandler<SystemRestorePointCompleteEventArgs> handler = this.SystemRestorePointComplete;
1245 if (null != handler)
1246 {
1247 handler(this, args);
1248 }
1249 }
1250
1251 /// <summary>
1252 /// Called by the engine, raises the <see cref="PlanForwardCompatibleBundle"/> event.
1253 /// </summary>
1254 /// <param name="args">Additional arguments for this event.</param>
1255 protected virtual void OnPlanForwardCompatibleBundle(PlanForwardCompatibleBundleEventArgs args)
1256 {
1257 EventHandler<PlanForwardCompatibleBundleEventArgs> handler = this.PlanForwardCompatibleBundle;
1258 if (null != handler)
1259 {
1260 handler(this, args);
1261 }
1262 }
1263
1264 /// <summary>
1265 /// Called by the engine, raises the <see cref="CacheContainerOrPayloadVerifyBegin"/> event.
1266 /// </summary>
1267 /// <param name="args">Additional arguments for this event.</param>
1268 protected virtual void OnCacheContainerOrPayloadVerifyBegin(CacheContainerOrPayloadVerifyBeginEventArgs args)
1269 {
1270 EventHandler<CacheContainerOrPayloadVerifyBeginEventArgs> handler = this.CacheContainerOrPayloadVerifyBegin;
1271 if (null != handler)
1272 {
1273 handler(this, args);
1274 }
1275 }
1276
1277 /// <summary>
1278 /// Called by the engine, raises the <see cref="CacheContainerOrPayloadVerifyProgress"/> event.
1279 /// </summary>
1280 /// <param name="args">Additional arguments for this event.</param>
1281 protected virtual void OnCacheContainerOrPayloadVerifyProgress(CacheContainerOrPayloadVerifyProgressEventArgs args)
1282 {
1283 EventHandler<CacheContainerOrPayloadVerifyProgressEventArgs> handler = this.CacheContainerOrPayloadVerifyProgress;
1284 if (null != handler)
1285 {
1286 handler(this, args);
1287 }
1288 }
1289
1290 /// <summary>
1291 /// Called by the engine, raises the <see cref="CacheContainerOrPayloadVerifyComplete"/> event.
1292 /// </summary>
1293 /// <param name="args">Additional arguments for this event.</param>
1294 protected virtual void OnCacheContainerOrPayloadVerifyComplete(CacheContainerOrPayloadVerifyCompleteEventArgs args)
1295 {
1296 EventHandler<CacheContainerOrPayloadVerifyCompleteEventArgs> handler = this.CacheContainerOrPayloadVerifyComplete;
1297 if (null != handler)
1298 {
1299 handler(this, args);
1300 }
1301 }
1302
1303 /// <summary>
1304 /// Called by the engine, raises the <see cref="CachePayloadExtractBegin"/> event.
1305 /// </summary>
1306 /// <param name="args">Additional arguments for this event.</param>
1307 protected virtual void OnCachePayloadExtractBegin(CachePayloadExtractBeginEventArgs args)
1308 {
1309 EventHandler<CachePayloadExtractBeginEventArgs> handler = this.CachePayloadExtractBegin;
1310 if (null != handler)
1311 {
1312 handler(this, args);
1313 }
1314 }
1315
1316 /// <summary>
1317 /// Called by the engine, raises the <see cref="CachePayloadExtractProgress"/> event.
1318 /// </summary>
1319 /// <param name="args">Additional arguments for this event.</param>
1320 protected virtual void OnCachePayloadExtractProgress(CachePayloadExtractProgressEventArgs args)
1321 {
1322 EventHandler<CachePayloadExtractProgressEventArgs> handler = this.CachePayloadExtractProgress;
1323 if (null != handler)
1324 {
1325 handler(this, args);
1326 }
1327 }
1328
1329 /// <summary>
1330 /// Called by the engine, raises the <see cref="CachePayloadExtractComplete"/> event.
1331 /// </summary>
1332 /// <param name="args">Additional arguments for this event.</param>
1333 protected virtual void OnCachePayloadExtractComplete(CachePayloadExtractCompleteEventArgs args)
1334 {
1335 EventHandler<CachePayloadExtractCompleteEventArgs> handler = this.CachePayloadExtractComplete;
1336 if (null != handler)
1337 {
1338 handler(this, args);
1339 }
1340 }
1341
1342
1343 /// <summary>
1344 /// Called by the engine, raises the <see cref="PlanRestoreRelatedBundle"/> event.
1345 /// </summary>
1346 /// <param name="args">Additional arguments for this event.</param>
1347 protected virtual void OnPlanRestoreRelatedBundle(PlanRestoreRelatedBundleEventArgs args)
1348 {
1349 EventHandler<PlanRestoreRelatedBundleEventArgs> handler = this.PlanRestoreRelatedBundle;
1350 if (null != handler)
1351 {
1352 handler(this, args);
1353 }
1354 }
1355
1356 /// <summary>
1357 /// Called by the engine, raises the <see cref="ExecuteProcessCancel"/> event.
1358 /// </summary>
1359 /// <param name="args">Additional arguments for this event.</param>
1360 protected virtual void OnExecuteProcessCancel(ExecuteProcessCancelEventArgs args)
1361 {
1362 EventHandler<ExecuteProcessCancelEventArgs> handler = this.ExecuteProcessCancel;
1363 if (null != handler)
1364 {
1365 handler(this, args);
1366 }
1367 }
1368
1369 /// <summary>
1370 /// Called by the engine, raises the <see cref="DetectRelatedBundlePackage"/> event.
1371 /// </summary>
1372 /// <param name="args">Additional arguments for this event.</param>
1373 protected virtual void OnDetectRelatedBundlePackage(DetectRelatedBundlePackageEventArgs args)
1374 {
1375 EventHandler<DetectRelatedBundlePackageEventArgs> handler = this.DetectRelatedBundlePackage;
1376 if (null != handler)
1377 {
1378 handler(this, args);
1379 }
1380 }
1381
1382 /// <summary>
1383 /// Called by the engine, raises the <see cref="CachePackageNonVitalValidationFailure"/> event.
1384 /// </summary>
1385 /// <param name="args">Additional arguments for this event.</param>
1386 protected virtual void OnCachePackageNonVitalValidationFailure(CachePackageNonVitalValidationFailureEventArgs args)
1387 {
1388 EventHandler<CachePackageNonVitalValidationFailureEventArgs> handler = this.CachePackageNonVitalValidationFailure;
1389 if (null != handler)
1390 {
1391 handler(this, args);
1392 }
1393 }
1394
1395 #region IBootstrapperApplication Members
1396
1397 int IBootstrapperApplication.BAProc(int message, IntPtr pvArgs, IntPtr pvResults)
1398 {
1399 switch (message)
1400 {
1401 default:
1402 return NativeMethods.E_NOTIMPL;
1403 }
1404 }
1405
1406 void IBootstrapperApplication.BAProcFallback(int message, IntPtr pvArgs, IntPtr pvResults, ref int phr)
1407 {
1408 }
1409
1410 int IBootstrapperApplication.OnCreate(IBootstrapperEngine engine, ref Command command)
1411 {
1412 CreateEventArgs args = new CreateEventArgs(new Engine(engine), command.GetBootstrapperCommand());
1413 this.OnCreate(args);
1414
1415 return args.HResult;
1416 }
1417
1418 int IBootstrapperApplication.OnDestroy(bool reload)
1419 {
1420 DestroyEventArgs args = new DestroyEventArgs(reload);
1421 this.OnDestroy(args);
1422
1423 return args.HResult;
1424 }
1425
1426 int IBootstrapperApplication.OnStartup()
1427 {
1428 StartupEventArgs args = new StartupEventArgs();
1429 this.OnStartup(args);
1430
1431 return args.HResult;
1432 }
1433
1434 int IBootstrapperApplication.OnShutdown(ref BOOTSTRAPPER_SHUTDOWN_ACTION action)
1435 {
1436 ShutdownEventArgs args = new ShutdownEventArgs(action);
1437 this.OnShutdown(args);
1438
1439 action = args.Action;
1440 return args.HResult;
1441 }
1442
1443 int IBootstrapperApplication.OnDetectBegin(bool fCached, RegistrationType registrationType, int cPackages, ref bool fCancel)
1444 {
1445 DetectBeginEventArgs args = new DetectBeginEventArgs(fCached, registrationType, cPackages, fCancel);
1446 this.OnDetectBegin(args);
1447
1448 fCancel = args.Cancel;
1449 return args.HResult;
1450 }
1451
1452 int IBootstrapperApplication.OnDetectForwardCompatibleBundle(string wzBundleId, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, bool fMissingFromCache, ref bool fCancel)
1453 {
1454 DetectForwardCompatibleBundleEventArgs args = new DetectForwardCompatibleBundleEventArgs(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, fCancel);
1455 this.OnDetectForwardCompatibleBundle(args);
1456
1457 fCancel = args.Cancel;
1458 return args.HResult;
1459 }
1460
1461 int IBootstrapperApplication.OnDetectUpdateBegin(string wzUpdateLocation, ref bool fCancel, ref bool fSkip)
1462 {
1463 DetectUpdateBeginEventArgs args = new DetectUpdateBeginEventArgs(wzUpdateLocation, fCancel, fSkip);
1464 this.OnDetectUpdateBegin(args);
1465
1466 fCancel = args.Cancel;
1467 fSkip = args.Skip;
1468 return args.HResult;
1469 }
1470
1471 int IBootstrapperApplication.OnDetectUpdate(string wzUpdateLocation, long dw64Size, string wzHash, UpdateHashType hashAlgorithm, string wzVersion, string wzTitle, string wzSummary, string wzContentType, string wzContent, ref bool fCancel, ref bool fStopProcessingUpdates)
1472 {
1473 DetectUpdateEventArgs args = new DetectUpdateEventArgs(wzUpdateLocation, dw64Size, wzHash, hashAlgorithm, wzVersion, wzTitle, wzSummary, wzContentType, wzContent, fCancel, fStopProcessingUpdates);
1474 this.OnDetectUpdate(args);
1475
1476 fCancel = args.Cancel;
1477 fStopProcessingUpdates = args.StopProcessingUpdates;
1478 return args.HResult;
1479 }
1480
1481 int IBootstrapperApplication.OnDetectUpdateComplete(int hrStatus, ref bool fIgnoreError)
1482 {
1483 DetectUpdateCompleteEventArgs args = new DetectUpdateCompleteEventArgs(hrStatus, fIgnoreError);
1484 this.OnDetectUpdateComplete(args);
1485
1486 fIgnoreError = args.IgnoreError;
1487 return args.HResult;
1488 }
1489
1490 int IBootstrapperApplication.OnDetectRelatedBundle(string wzProductCode, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, bool fMissingFromCache, ref bool fCancel)
1491 {
1492 DetectRelatedBundleEventArgs args = new DetectRelatedBundleEventArgs(wzProductCode, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, fCancel);
1493 this.OnDetectRelatedBundle(args);
1494
1495 fCancel = args.Cancel;
1496 return args.HResult;
1497 }
1498
1499 int IBootstrapperApplication.OnDetectPackageBegin(string wzPackageId, ref bool fCancel)
1500 {
1501 DetectPackageBeginEventArgs args = new DetectPackageBeginEventArgs(wzPackageId, fCancel);
1502 this.OnDetectPackageBegin(args);
1503
1504 fCancel = args.Cancel;
1505 return args.HResult;
1506 }
1507
1508 int IBootstrapperApplication.OnDetectCompatibleMsiPackage(string wzPackageId, string wzCompatiblePackageId, string wzCompatiblePackageVersion, ref bool fCancel)
1509 {
1510 DetectCompatibleMsiPackageEventArgs args = new DetectCompatibleMsiPackageEventArgs(wzPackageId, wzCompatiblePackageId, wzCompatiblePackageVersion, fCancel);
1511 this.OnDetectCompatibleMsiPackage(args);
1512
1513 fCancel = args.Cancel;
1514 return args.HResult;
1515 }
1516
1517 int IBootstrapperApplication.OnDetectRelatedMsiPackage(string wzPackageId, string wzUpgradeCode, string wzProductCode, bool fPerMachine, string wzVersion, RelatedOperation operation, ref bool fCancel)
1518 {
1519 DetectRelatedMsiPackageEventArgs args = new DetectRelatedMsiPackageEventArgs(wzPackageId, wzUpgradeCode, wzProductCode, fPerMachine, wzVersion, operation, fCancel);
1520 this.OnDetectRelatedMsiPackage(args);
1521
1522 fCancel = args.Cancel;
1523 return args.HResult;
1524 }
1525
1526 int IBootstrapperApplication.OnDetectPatchTarget(string wzPackageId, string wzProductCode, PackageState patchState, ref bool fCancel)
1527 {
1528 DetectPatchTargetEventArgs args = new DetectPatchTargetEventArgs(wzPackageId, wzProductCode, patchState, fCancel);
1529 this.OnDetectPatchTarget(args);
1530
1531 fCancel = args.Cancel;
1532 return args.HResult;
1533 }
1534
1535 int IBootstrapperApplication.OnDetectMsiFeature(string wzPackageId, string wzFeatureId, FeatureState state, ref bool fCancel)
1536 {
1537 DetectMsiFeatureEventArgs args = new DetectMsiFeatureEventArgs(wzPackageId, wzFeatureId, state, fCancel);
1538 this.OnDetectMsiFeature(args);
1539
1540 fCancel = args.Cancel;
1541 return args.HResult;
1542 }
1543
1544 int IBootstrapperApplication.OnDetectPackageComplete(string wzPackageId, int hrStatus, PackageState state, bool fCached)
1545 {
1546 DetectPackageCompleteEventArgs args = new DetectPackageCompleteEventArgs(wzPackageId, hrStatus, state, fCached);
1547 this.OnDetectPackageComplete(args);
1548
1549 return args.HResult;
1550 }
1551
1552 int IBootstrapperApplication.OnDetectComplete(int hrStatus, bool fEligibleForCleanup)
1553 {
1554 DetectCompleteEventArgs args = new DetectCompleteEventArgs(hrStatus, fEligibleForCleanup);
1555 this.OnDetectComplete(args);
1556
1557 return args.HResult;
1558 }
1559
1560 int IBootstrapperApplication.OnPlanBegin(int cPackages, ref bool fCancel)
1561 {
1562 PlanBeginEventArgs args = new PlanBeginEventArgs(cPackages, fCancel);
1563 this.OnPlanBegin(args);
1564
1565 fCancel = args.Cancel;
1566 return args.HResult;
1567 }
1568
1569 int IBootstrapperApplication.OnPlanRelatedBundle(string wzBundleId, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
1570 {
1571 PlanRelatedBundleEventArgs args = new PlanRelatedBundleEventArgs(wzBundleId, recommendedState, pRequestedState, fCancel);
1572 this.OnPlanRelatedBundle(args);
1573
1574 pRequestedState = args.State;
1575 fCancel = args.Cancel;
1576 return args.HResult;
1577 }
1578
1579 int IBootstrapperApplication.OnPlanRelatedBundleType(string wzBundleId, RelatedBundlePlanType recommendedType, ref RelatedBundlePlanType pRequestedType, ref bool fCancel)
1580 {
1581 PlanRelatedBundleTypeEventArgs args = new PlanRelatedBundleTypeEventArgs(wzBundleId, recommendedType, pRequestedType, fCancel);
1582 this.OnPlanRelatedBundleType(args);
1583
1584 pRequestedType = args.Type;
1585 fCancel = args.Cancel;
1586 return args.HResult;
1587 }
1588
1589 int IBootstrapperApplication.OnPlanRollbackBoundary(string wzRollbackBoundaryId, bool fRecommendedTransaction, ref bool fTransaction, ref bool fCancel)
1590 {
1591 PlanRollbackBoundaryEventArgs args = new PlanRollbackBoundaryEventArgs(wzRollbackBoundaryId, fRecommendedTransaction, fTransaction, fCancel);
1592 this.OnPlanRollbackBoundary(args);
1593
1594 fTransaction = args.Transaction;
1595 fCancel = args.Cancel;
1596 return args.HResult;
1597 }
1598
1599 int IBootstrapperApplication.OnPlanPackageBegin(string wzPackageId, PackageState state, bool fCached, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT repairCondition, RequestState recommendedState, BOOTSTRAPPER_CACHE_TYPE recommendedCacheType, ref RequestState pRequestedState, ref BOOTSTRAPPER_CACHE_TYPE pRequestedCacheType, ref bool fCancel)
1600 {
1601 PlanPackageBeginEventArgs args = new PlanPackageBeginEventArgs(wzPackageId, state, fCached, installCondition, repairCondition, recommendedState, recommendedCacheType, pRequestedState, pRequestedCacheType, fCancel);
1602 this.OnPlanPackageBegin(args);
1603
1604 pRequestedState = args.State;
1605 pRequestedCacheType = args.CacheType;
1606 fCancel = args.Cancel;
1607 return args.HResult;
1608 }
1609
1610 int IBootstrapperApplication.OnPlanCompatibleMsiPackageBegin(string wzPackageId, string wzCompatiblePackageId, string wzCompatiblePackageVersion, bool recommendedRemove, ref bool pRequestedRemove, ref bool fCancel)
1611 {
1612 PlanCompatibleMsiPackageBeginEventArgs args = new PlanCompatibleMsiPackageBeginEventArgs(wzPackageId, wzCompatiblePackageId, wzCompatiblePackageVersion, recommendedRemove, pRequestedRemove, fCancel);
1613 this.OnPlanCompatibleMsiPackageBegin(args);
1614
1615 pRequestedRemove = args.RequestRemove;
1616 fCancel = args.Cancel;
1617 return args.HResult;
1618 }
1619
1620 int IBootstrapperApplication.OnPlanCompatibleMsiPackageComplete(string wzPackageId, string wzCompatiblePackageId, int hrStatus, bool requestedRemove)
1621 {
1622 PlanCompatibleMsiPackageCompleteEventArgs args = new PlanCompatibleMsiPackageCompleteEventArgs(wzPackageId, wzCompatiblePackageId, hrStatus, requestedRemove);
1623 this.OnPlanCompatibleMsiPackageComplete(args);
1624
1625 return args.HResult;
1626 }
1627
1628 int IBootstrapperApplication.OnPlanPatchTarget(string wzPackageId, string wzProductCode, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
1629 {
1630 PlanPatchTargetEventArgs args = new PlanPatchTargetEventArgs(wzPackageId, wzProductCode, recommendedState, pRequestedState, fCancel);
1631 this.OnPlanPatchTarget(args);
1632
1633 pRequestedState = args.State;
1634 fCancel = args.Cancel;
1635 return args.HResult;
1636 }
1637
1638 int IBootstrapperApplication.OnPlanMsiFeature(string wzPackageId, string wzFeatureId, FeatureState recommendedState, ref FeatureState pRequestedState, ref bool fCancel)
1639 {
1640 PlanMsiFeatureEventArgs args = new PlanMsiFeatureEventArgs(wzPackageId, wzFeatureId, recommendedState, pRequestedState, fCancel);
1641 this.OnPlanMsiFeature(args);
1642
1643 pRequestedState = args.State;
1644 fCancel = args.Cancel;
1645 return args.HResult;
1646 }
1647
1648 int IBootstrapperApplication.OnPlanMsiPackage(string wzPackageId, bool fExecute, ActionState action, BOOTSTRAPPER_MSI_FILE_VERSIONING recommendedFileVersioning, ref bool fCancel, ref BURN_MSI_PROPERTY actionMsiProperty, ref INSTALLUILEVEL uiLevel, ref bool fDisableExternalUiHandler, ref BOOTSTRAPPER_MSI_FILE_VERSIONING fileVersioning)
1649 {
1650 PlanMsiPackageEventArgs args = new PlanMsiPackageEventArgs(wzPackageId, fExecute, action, recommendedFileVersioning, fCancel, actionMsiProperty, uiLevel, fDisableExternalUiHandler, fileVersioning);
1651 this.OnPlanMsiPackage(args);
1652
1653 fCancel = args.Cancel;
1654 actionMsiProperty = args.ActionMsiProperty;
1655 uiLevel = args.UiLevel;
1656 fDisableExternalUiHandler = args.DisableExternalUiHandler;
1657 fileVersioning = args.FileVersioning;
1658 return args.HResult;
1659 }
1660
1661 int IBootstrapperApplication.OnPlanPackageComplete(string wzPackageId, int hrStatus, RequestState requested)
1662 {
1663 var args = new PlanPackageCompleteEventArgs(wzPackageId, hrStatus, requested);
1664 this.OnPlanPackageComplete(args);
1665
1666 return args.HResult;
1667 }
1668
1669 int IBootstrapperApplication.OnPlannedCompatiblePackage(string wzPackageId, string wzCompatiblePackageId, bool remove)
1670 {
1671 var args = new PlannedCompatiblePackageEventArgs(wzPackageId, wzCompatiblePackageId, remove);
1672 this.OnPlannedCompatiblePackage(args);
1673
1674 return args.HResult;
1675 }
1676
1677 int IBootstrapperApplication.OnPlannedPackage(string wzPackageId, ActionState execute, ActionState rollback, bool fPlannedCache, bool fPlannedUncache)
1678 {
1679 var args = new PlannedPackageEventArgs(wzPackageId, execute, rollback, fPlannedCache, fPlannedUncache);
1680 this.OnPlannedPackage(args);
1681
1682 return args.HResult;
1683 }
1684
1685 int IBootstrapperApplication.OnPlanComplete(int hrStatus)
1686 {
1687 PlanCompleteEventArgs args = new PlanCompleteEventArgs(hrStatus);
1688 this.OnPlanComplete(args);
1689
1690 return args.HResult;
1691 }
1692
1693 int IBootstrapperApplication.OnApplyBegin(int dwPhaseCount, ref bool fCancel)
1694 {
1695 ApplyBeginEventArgs args = new ApplyBeginEventArgs(dwPhaseCount, fCancel);
1696 this.OnApplyBegin(args);
1697
1698 fCancel = args.Cancel;
1699 return args.HResult;
1700 }
1701
1702 int IBootstrapperApplication.OnElevateBegin(ref bool fCancel)
1703 {
1704 ElevateBeginEventArgs args = new ElevateBeginEventArgs(fCancel);
1705 this.OnElevateBegin(args);
1706
1707 fCancel = args.Cancel;
1708 return args.HResult;
1709 }
1710
1711 int IBootstrapperApplication.OnElevateComplete(int hrStatus)
1712 {
1713 ElevateCompleteEventArgs args = new ElevateCompleteEventArgs(hrStatus);
1714 this.OnElevateComplete(args);
1715
1716 return args.HResult;
1717 }
1718
1719 int IBootstrapperApplication.OnProgress(int dwProgressPercentage, int dwOverallPercentage, ref bool fCancel)
1720 {
1721 ProgressEventArgs args = new ProgressEventArgs(dwProgressPercentage, dwOverallPercentage, fCancel);
1722 this.OnProgress(args);
1723
1724 fCancel = args.Cancel;
1725 return args.HResult;
1726 }
1727
1728 int IBootstrapperApplication.OnError(ErrorType errorType, string wzPackageId, int dwCode, string wzError, int dwUIHint, int cData, string[] rgwzData, Result nRecommendation, ref Result pResult)
1729 {
1730 ErrorEventArgs args = new ErrorEventArgs(errorType, wzPackageId, dwCode, wzError, dwUIHint, rgwzData, nRecommendation, pResult);
1731 this.OnError(args);
1732
1733 pResult = args.Result;
1734 return args.HResult;
1735 }
1736
1737 int IBootstrapperApplication.OnRegisterBegin(RegistrationType recommendedRegistrationType, ref bool fCancel, ref RegistrationType registrationType)
1738 {
1739 RegisterBeginEventArgs args = new RegisterBeginEventArgs(recommendedRegistrationType, fCancel, registrationType);
1740 this.OnRegisterBegin(args);
1741
1742 fCancel = args.Cancel;
1743 registrationType = args.RegistrationType;
1744 return args.HResult;
1745 }
1746
1747 int IBootstrapperApplication.OnRegisterComplete(int hrStatus)
1748 {
1749 RegisterCompleteEventArgs args = new RegisterCompleteEventArgs(hrStatus);
1750 this.OnRegisterComplete(args);
1751
1752 return args.HResult;
1753 }
1754
1755 int IBootstrapperApplication.OnCacheBegin(ref bool fCancel)
1756 {
1757 CacheBeginEventArgs args = new CacheBeginEventArgs(fCancel);
1758 this.OnCacheBegin(args);
1759
1760 fCancel = args.Cancel;
1761 return args.HResult;
1762 }
1763
1764 int IBootstrapperApplication.OnCachePackageBegin(string wzPackageId, int cCachePayloads, long dw64PackageCacheSize, bool fVital, ref bool fCancel)
1765 {
1766 CachePackageBeginEventArgs args = new CachePackageBeginEventArgs(wzPackageId, cCachePayloads, dw64PackageCacheSize, fVital, fCancel);
1767 this.OnCachePackageBegin(args);
1768
1769 fCancel = args.Cancel;
1770 return args.HResult;
1771 }
1772
1773 int IBootstrapperApplication.OnCacheAcquireBegin(string wzPackageOrContainerId, string wzPayloadId, string wzSource, string wzDownloadUrl, string wzPayloadContainerId, CacheOperation recommendation, ref CacheOperation action, ref bool fCancel)
1774 {
1775 CacheAcquireBeginEventArgs args = new CacheAcquireBeginEventArgs(wzPackageOrContainerId, wzPayloadId, wzSource, wzDownloadUrl, wzPayloadContainerId, recommendation, action, fCancel);
1776 this.OnCacheAcquireBegin(args);
1777
1778 action = args.Action;
1779 fCancel = args.Cancel;
1780 return args.HResult;
1781 }
1782
1783 int IBootstrapperApplication.OnCacheAcquireProgress(string wzPackageOrContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, ref bool fCancel)
1784 {
1785 CacheAcquireProgressEventArgs args = new CacheAcquireProgressEventArgs(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, fCancel);
1786 this.OnCacheAcquireProgress(args);
1787
1788 fCancel = args.Cancel;
1789 return args.HResult;
1790 }
1791
1792 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)
1793 {
1794 CacheAcquireResolvingEventArgs args = new CacheAcquireResolvingEventArgs(wzPackageOrContainerId, wzPayloadId, searchPaths, fFoundLocal, dwRecommendedSearchPath, wzDownloadUrl, wzPayloadContainerId, recommendation, dwChosenSearchPath, action, fCancel);
1795 this.OnCacheAcquireResolving(args);
1796
1797 dwChosenSearchPath = args.ChosenSearchPath;
1798 action = args.Action;
1799 fCancel = args.Cancel;
1800 return args.HResult;
1801 }
1802
1803 int IBootstrapperApplication.OnCacheAcquireComplete(string wzPackageOrContainerId, string wzPayloadId, int hrStatus, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action)
1804 {
1805 CacheAcquireCompleteEventArgs args = new CacheAcquireCompleteEventArgs(wzPackageOrContainerId, wzPayloadId, hrStatus, recommendation, action);
1806 this.OnCacheAcquireComplete(args);
1807
1808 action = args.Action;
1809 return args.HResult;
1810 }
1811
1812 int IBootstrapperApplication.OnCacheVerifyBegin(string wzPackageOrContainerId, string wzPayloadId, ref bool fCancel)
1813 {
1814 CacheVerifyBeginEventArgs args = new CacheVerifyBeginEventArgs(wzPackageOrContainerId, wzPayloadId, fCancel);
1815 this.OnCacheVerifyBegin(args);
1816
1817 fCancel = args.Cancel;
1818 return args.HResult;
1819 }
1820
1821 int IBootstrapperApplication.OnCacheVerifyProgress(string wzPackageOrContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, CacheVerifyStep verifyStep, ref bool fCancel)
1822 {
1823 CacheVerifyProgressEventArgs args = new CacheVerifyProgressEventArgs(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, verifyStep, fCancel);
1824 this.OnCacheVerifyProgress(args);
1825
1826 fCancel = args.Cancel;
1827 return args.HResult;
1828 }
1829
1830 int IBootstrapperApplication.OnCacheVerifyComplete(string wzPackageOrContainerId, string wzPayloadId, int hrStatus, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action)
1831 {
1832 CacheVerifyCompleteEventArgs args = new CacheVerifyCompleteEventArgs(wzPackageOrContainerId, wzPayloadId, hrStatus, recommendation, action);
1833 this.OnCacheVerifyComplete(args);
1834
1835 action = args.Action;
1836 return args.HResult;
1837 }
1838
1839 int IBootstrapperApplication.OnCachePackageComplete(string wzPackageId, int hrStatus, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action)
1840 {
1841 CachePackageCompleteEventArgs args = new CachePackageCompleteEventArgs(wzPackageId, hrStatus, recommendation, action);
1842 this.OnCachePackageComplete(args);
1843
1844 action = args.Action;
1845 return args.HResult;
1846 }
1847
1848 int IBootstrapperApplication.OnCacheComplete(int hrStatus)
1849 {
1850 CacheCompleteEventArgs args = new CacheCompleteEventArgs(hrStatus);
1851 this.OnCacheComplete(args);
1852
1853 return args.HResult;
1854 }
1855
1856 int IBootstrapperApplication.OnExecuteBegin(int cExecutingPackages, ref bool fCancel)
1857 {
1858 ExecuteBeginEventArgs args = new ExecuteBeginEventArgs(cExecutingPackages, fCancel);
1859 this.OnExecuteBegin(args);
1860
1861 args.Cancel = fCancel;
1862 return args.HResult;
1863 }
1864
1865 int IBootstrapperApplication.OnExecutePackageBegin(string wzPackageId, bool fExecute, ActionState action, INSTALLUILEVEL uiLevel, bool fDisableExternalUiHandler, ref bool fCancel)
1866 {
1867 ExecutePackageBeginEventArgs args = new ExecutePackageBeginEventArgs(wzPackageId, fExecute, action, uiLevel, fDisableExternalUiHandler, fCancel);
1868 this.OnExecutePackageBegin(args);
1869
1870 fCancel = args.Cancel;
1871 return args.HResult;
1872 }
1873
1874 int IBootstrapperApplication.OnExecutePatchTarget(string wzPackageId, string wzTargetProductCode, ref bool fCancel)
1875 {
1876 ExecutePatchTargetEventArgs args = new ExecutePatchTargetEventArgs(wzPackageId, wzTargetProductCode, fCancel);
1877 this.OnExecutePatchTarget(args);
1878
1879 fCancel = args.Cancel;
1880 return args.HResult;
1881 }
1882
1883 int IBootstrapperApplication.OnExecuteProgress(string wzPackageId, int dwProgressPercentage, int dwOverallPercentage, ref bool fCancel)
1884 {
1885 ExecuteProgressEventArgs args = new ExecuteProgressEventArgs(wzPackageId, dwProgressPercentage, dwOverallPercentage, fCancel);
1886 this.OnExecuteProgress(args);
1887
1888 fCancel = args.Cancel;
1889 return args.HResult;
1890 }
1891
1892 int IBootstrapperApplication.OnExecuteMsiMessage(string wzPackageId, InstallMessage messageType, int dwUIHint, string wzMessage, int cData, string[] rgwzData, Result nRecommendation, ref Result pResult)
1893 {
1894 ExecuteMsiMessageEventArgs args = new ExecuteMsiMessageEventArgs(wzPackageId, messageType, dwUIHint, wzMessage, rgwzData, nRecommendation, pResult);
1895 this.OnExecuteMsiMessage(args);
1896
1897 pResult = args.Result;
1898 return args.HResult;
1899 }
1900
1901 int IBootstrapperApplication.OnExecuteFilesInUse(string wzPackageId, int cFiles, string[] rgwzFiles, Result nRecommendation, FilesInUseType source, ref Result pResult)
1902 {
1903 ExecuteFilesInUseEventArgs args = new ExecuteFilesInUseEventArgs(wzPackageId, rgwzFiles, nRecommendation, source, pResult);
1904 this.OnExecuteFilesInUse(args);
1905
1906 pResult = args.Result;
1907 return args.HResult;
1908 }
1909
1910 int IBootstrapperApplication.OnExecutePackageComplete(string wzPackageId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION pAction)
1911 {
1912 ExecutePackageCompleteEventArgs args = new ExecutePackageCompleteEventArgs(wzPackageId, hrStatus, restart, recommendation, pAction);
1913 this.OnExecutePackageComplete(args);
1914
1915 pAction = args.Action;
1916 return args.HResult;
1917 }
1918
1919 int IBootstrapperApplication.OnExecuteComplete(int hrStatus)
1920 {
1921 ExecuteCompleteEventArgs args = new ExecuteCompleteEventArgs(hrStatus);
1922 this.OnExecuteComplete(args);
1923
1924 return args.HResult;
1925 }
1926
1927 int IBootstrapperApplication.OnUnregisterBegin(RegistrationType recommendedRegistrationType, ref RegistrationType registrationType)
1928 {
1929 UnregisterBeginEventArgs args = new UnregisterBeginEventArgs(recommendedRegistrationType, registrationType);
1930 this.OnUnregisterBegin(args);
1931
1932 registrationType = args.RegistrationType;
1933 return args.HResult;
1934 }
1935
1936 int IBootstrapperApplication.OnUnregisterComplete(int hrStatus)
1937 {
1938 UnregisterCompleteEventArgs args = new UnregisterCompleteEventArgs(hrStatus);
1939 this.OnUnregisterComplete(args);
1940
1941 return args.HResult;
1942 }
1943
1944 int IBootstrapperApplication.OnApplyComplete(int hrStatus, ApplyRestart restart, BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_APPLYCOMPLETE_ACTION pAction)
1945 {
1946 ApplyCompleteEventArgs args = new ApplyCompleteEventArgs(hrStatus, restart, recommendation, pAction);
1947 this.OnApplyComplete(args);
1948
1949 pAction = args.Action;
1950 return args.HResult;
1951 }
1952
1953 int IBootstrapperApplication.OnApplyDowngrade(int hrRecommendation, ref int hrStatus)
1954 {
1955 ApplyDowngradeEventArgs args = new ApplyDowngradeEventArgs(hrRecommendation, hrStatus);
1956 this.OnApplyDowngrade(args);
1957
1958 hrStatus = args.Status;
1959 return args.HResult;
1960 }
1961
1962 int IBootstrapperApplication.OnLaunchApprovedExeBegin(ref bool fCancel)
1963 {
1964 LaunchApprovedExeBeginEventArgs args = new LaunchApprovedExeBeginEventArgs(fCancel);
1965 this.OnLaunchApprovedExeBegin(args);
1966
1967 fCancel = args.Cancel;
1968 return args.HResult;
1969 }
1970
1971 int IBootstrapperApplication.OnLaunchApprovedExeComplete(int hrStatus, int processId)
1972 {
1973 LaunchApprovedExeCompleteEventArgs args = new LaunchApprovedExeCompleteEventArgs(hrStatus, processId);
1974 this.OnLaunchApprovedExeComplete(args);
1975
1976 return args.HResult;
1977 }
1978
1979 int IBootstrapperApplication.OnBeginMsiTransactionBegin(string transactionId, ref bool fCancel)
1980 {
1981 BeginMsiTransactionBeginEventArgs args = new BeginMsiTransactionBeginEventArgs(transactionId, fCancel);
1982 this.OnBeginMsiTransactionBegin(args);
1983
1984 fCancel = args.Cancel;
1985 return args.HResult;
1986 }
1987
1988 int IBootstrapperApplication.OnBeginMsiTransactionComplete(string transactionId, int hrStatus)
1989 {
1990 BeginMsiTransactionCompleteEventArgs args = new BeginMsiTransactionCompleteEventArgs(transactionId, hrStatus);
1991 this.OnBeginMsiTransactionComplete(args);
1992
1993 return args.HResult;
1994 }
1995
1996 int IBootstrapperApplication.OnCommitMsiTransactionBegin(string transactionId, ref bool fCancel)
1997 {
1998 CommitMsiTransactionBeginEventArgs args = new CommitMsiTransactionBeginEventArgs(transactionId, fCancel);
1999 this.OnCommitMsiTransactionBegin(args);
2000
2001 fCancel = args.Cancel;
2002 return args.HResult;
2003 }
2004
2005 int IBootstrapperApplication.OnCommitMsiTransactionComplete(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction)
2006 {
2007 CommitMsiTransactionCompleteEventArgs args = new CommitMsiTransactionCompleteEventArgs(transactionId, hrStatus, restart, recommendation, pAction);
2008 this.OnCommitMsiTransactionComplete(args);
2009
2010 pAction = args.Action;
2011 return args.HResult;
2012 }
2013
2014 int IBootstrapperApplication.OnRollbackMsiTransactionBegin(string transactionId)
2015 {
2016 RollbackMsiTransactionBeginEventArgs args = new RollbackMsiTransactionBeginEventArgs(transactionId);
2017 this.OnRollbackMsiTransactionBegin(args);
2018
2019 return args.HResult;
2020 }
2021
2022 int IBootstrapperApplication.OnRollbackMsiTransactionComplete(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction)
2023 {
2024 RollbackMsiTransactionCompleteEventArgs args = new RollbackMsiTransactionCompleteEventArgs(transactionId, hrStatus, restart, recommendation, pAction);
2025 this.OnRollbackMsiTransactionComplete(args);
2026
2027 pAction = args.Action;
2028 return args.HResult;
2029 }
2030
2031 int IBootstrapperApplication.OnPauseAutomaticUpdatesBegin()
2032 {
2033 PauseAutomaticUpdatesBeginEventArgs args = new PauseAutomaticUpdatesBeginEventArgs();
2034 this.OnPauseAutomaticUpdatesBegin(args);
2035
2036 return args.HResult;
2037 }
2038
2039 int IBootstrapperApplication.OnPauseAutomaticUpdatesComplete(int hrStatus)
2040 {
2041 PauseAutomaticUpdatesCompleteEventArgs args = new PauseAutomaticUpdatesCompleteEventArgs(hrStatus);
2042 this.OnPauseAutomaticUpdatesComplete(args);
2043
2044 return args.HResult;
2045 }
2046
2047 int IBootstrapperApplication.OnSystemRestorePointBegin()
2048 {
2049 SystemRestorePointBeginEventArgs args = new SystemRestorePointBeginEventArgs();
2050 this.OnSystemRestorePointBegin(args);
2051
2052 return args.HResult;
2053 }
2054
2055 int IBootstrapperApplication.OnSystemRestorePointComplete(int hrStatus)
2056 {
2057 SystemRestorePointCompleteEventArgs args = new SystemRestorePointCompleteEventArgs(hrStatus);
2058 this.OnSystemRestorePointComplete(args);
2059
2060 return args.HResult;
2061 }
2062
2063 int IBootstrapperApplication.OnPlanForwardCompatibleBundle(string wzBundleId, RelationType relationType, string wzBundleTag, bool fPerMachine, string wzVersion, bool fRecommendedIgnoreBundle, ref bool fCancel, ref bool fIgnoreBundle)
2064 {
2065 PlanForwardCompatibleBundleEventArgs args = new PlanForwardCompatibleBundleEventArgs(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fRecommendedIgnoreBundle, fCancel, fIgnoreBundle);
2066 this.OnPlanForwardCompatibleBundle(args);
2067
2068 fCancel = args.Cancel;
2069 fIgnoreBundle = args.IgnoreBundle;
2070 return args.HResult;
2071 }
2072
2073 int IBootstrapperApplication.OnCacheContainerOrPayloadVerifyBegin(string wzPackageOrContainerId, string wzPayloadId, ref bool fCancel)
2074 {
2075 CacheContainerOrPayloadVerifyBeginEventArgs args = new CacheContainerOrPayloadVerifyBeginEventArgs(wzPackageOrContainerId, wzPayloadId, fCancel);
2076 this.OnCacheContainerOrPayloadVerifyBegin(args);
2077
2078 fCancel = args.Cancel;
2079 return args.HResult;
2080 }
2081
2082 int IBootstrapperApplication.OnCacheContainerOrPayloadVerifyProgress(string wzPackageOrContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, ref bool fCancel)
2083 {
2084 CacheContainerOrPayloadVerifyProgressEventArgs args = new CacheContainerOrPayloadVerifyProgressEventArgs(wzPackageOrContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, fCancel);
2085 this.OnCacheContainerOrPayloadVerifyProgress(args);
2086
2087 fCancel = args.Cancel;
2088 return args.HResult;
2089 }
2090
2091 int IBootstrapperApplication.OnCacheContainerOrPayloadVerifyComplete(string wzPackageOrContainerId, string wzPayloadId, int hrStatus)
2092 {
2093 CacheContainerOrPayloadVerifyCompleteEventArgs args = new CacheContainerOrPayloadVerifyCompleteEventArgs(wzPackageOrContainerId, wzPayloadId, hrStatus);
2094 this.OnCacheContainerOrPayloadVerifyComplete(args);
2095
2096 return args.HResult;
2097 }
2098
2099 int IBootstrapperApplication.OnCachePayloadExtractBegin(string wzContainerId, string wzPayloadId, ref bool fCancel)
2100 {
2101 CachePayloadExtractBeginEventArgs args = new CachePayloadExtractBeginEventArgs(wzContainerId, wzPayloadId, fCancel);
2102 this.OnCachePayloadExtractBegin(args);
2103
2104 fCancel = args.Cancel;
2105 return args.HResult;
2106 }
2107
2108 int IBootstrapperApplication.OnCachePayloadExtractProgress(string wzContainerId, string wzPayloadId, long dw64Progress, long dw64Total, int dwOverallPercentage, ref bool fCancel)
2109 {
2110 CachePayloadExtractProgressEventArgs args = new CachePayloadExtractProgressEventArgs(wzContainerId, wzPayloadId, dw64Progress, dw64Total, dwOverallPercentage, fCancel);
2111 this.OnCachePayloadExtractProgress(args);
2112
2113 fCancel = args.Cancel;
2114 return args.HResult;
2115 }
2116
2117 int IBootstrapperApplication.OnCachePayloadExtractComplete(string wzContainerId, string wzPayloadId, int hrStatus)
2118 {
2119 CachePayloadExtractCompleteEventArgs args = new CachePayloadExtractCompleteEventArgs(wzContainerId, wzPayloadId, hrStatus);
2120 this.OnCachePayloadExtractComplete(args);
2121
2122 return args.HResult;
2123 }
2124
2125 int IBootstrapperApplication.OnPlanRestoreRelatedBundle(string wzBundleId, RequestState recommendedState, ref RequestState pRequestedState, ref bool fCancel)
2126 {
2127 PlanRestoreRelatedBundleEventArgs args = new PlanRestoreRelatedBundleEventArgs(wzBundleId, recommendedState, pRequestedState, fCancel);
2128 this.OnPlanRestoreRelatedBundle(args);
2129
2130 pRequestedState = args.State;
2131 fCancel = args.Cancel;
2132 return args.HResult;
2133 }
2134
2135 int IBootstrapperApplication.OnExecuteProcessCancel(string wzPackageId, int processId, BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION recommendation, ref BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION pAction)
2136 {
2137 ExecuteProcessCancelEventArgs args = new ExecuteProcessCancelEventArgs(wzPackageId, processId, recommendation, pAction);
2138 this.OnExecuteProcessCancel(args);
2139
2140 pAction = args.Action;
2141 return args.HResult;
2142 }
2143
2144 int IBootstrapperApplication.OnDetectRelatedBundlePackage(string wzPackageId, string wzProductCode, RelationType relationType, bool fPerMachine, string wzVersion, ref bool fCancel)
2145 {
2146 DetectRelatedBundlePackageEventArgs args = new DetectRelatedBundlePackageEventArgs(wzPackageId, wzProductCode, relationType, fPerMachine, wzVersion, fCancel);
2147 this.OnDetectRelatedBundlePackage(args);
2148
2149 fCancel = args.Cancel;
2150 return args.HResult;
2151 }
2152
2153 int IBootstrapperApplication.OnCachePackageNonVitalValidationFailure(string wzPackageId, int hrStatus, BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION recommendation, ref BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION action)
2154 {
2155 CachePackageNonVitalValidationFailureEventArgs args = new CachePackageNonVitalValidationFailureEventArgs(wzPackageId, hrStatus, recommendation, action);
2156 this.OnCachePackageNonVitalValidationFailure(args);
2157
2158 action = args.Action;
2159 return args.HResult;
2160 }
2161
2162 #endregion
2163 }
2164}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplicationData.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplicationData.cs
new file mode 100644
index 00000000..10cb863f
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/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.BootstrapperApplicationApi
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 /// The default file name for BootstrapperApplicationData.
16 /// </summary>
17 public const string DefaultFileName = "BootstrapperApplicationData.xml";
18
19 /// <summary>
20 /// The XML namespace for BootstrapperApplicationData.
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.BootstrapperApplicationApi/BootstrapperApplicationFactoryAttribute.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplicationFactoryAttribute.cs
new file mode 100644
index 00000000..9b64e838
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperApplicationFactoryAttribute.cs
@@ -0,0 +1,31 @@
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.BootstrapperApplicationApi
4{
5 using System;
6
7 /// <summary>
8 /// This is no longer used.
9 /// </summary>
10 [Obsolete("Bootstrapper applications now run out of proc and do not use a BootstrapperApplicationFactory. Remove your BootstrapperApplicationFactory class. See https://wixtoolset.org/docs/fiveforfour/ for more details.")]
11 [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
12 public sealed class BootstrapperApplicationFactoryAttribute : Attribute
13 {
14 /// <summary>
15 /// This is no longer used.
16 /// </summary>
17 /// <param name="bootstrapperApplicationFactoryType">This is no longer used</param>
18 public BootstrapperApplicationFactoryAttribute(Type bootstrapperApplicationFactoryType)
19 {
20 throw new NotImplementedException();
21 }
22
23 /// <summary>
24 /// This is no longer used.
25 /// </summary>
26 public Type BootstrapperApplicationFactoryType
27 {
28 get { throw new NotImplementedException(); }
29 }
30 }
31}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs
new file mode 100644
index 00000000..612e8ce9
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/BootstrapperCommand.cs
@@ -0,0 +1,239 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.CodeDom.Compiler;
7 using System.Collections.Generic;
8 using System.ComponentModel;
9 using System.Runtime.InteropServices;
10
11 /// <summary>
12 /// Command-line provided to the bootstrapper application.
13 /// </summary>
14 [Serializable]
15 [StructLayout(LayoutKind.Sequential)]
16 [GeneratedCodeAttribute("WixToolset.Bootstrapper.InteropCodeGenerator", "1.0.0.0")]
17 public struct Command
18 {
19 // Strings must be declared as pointers so that Marshaling doesn't free them.
20 [MarshalAs(UnmanagedType.I4)] internal int cbSize;
21 [MarshalAs(UnmanagedType.U4)] private readonly LaunchAction action;
22 [MarshalAs(UnmanagedType.U4)] private readonly Display display;
23 private readonly IntPtr wzCommandLine;
24 [MarshalAs(UnmanagedType.I4)] private readonly int nCmdShow;
25 [MarshalAs(UnmanagedType.U4)] private readonly ResumeType resume;
26 private readonly IntPtr hwndSplashScreen;
27 [MarshalAs(UnmanagedType.I4)] private readonly RelationType relation;
28 [MarshalAs(UnmanagedType.Bool)] private readonly bool passthrough;
29 private readonly IntPtr wzLayoutDirectory;
30 private readonly IntPtr wzBootstrapperWorkingFolder;
31 private readonly IntPtr wzBootstrapperApplicationDataPath;
32
33 /// <summary>
34 /// Gets the IBootstrapperCommand for this Command.
35 /// </summary>
36 /// <returns>IBootstrapperCommand</returns>
37 public IBootstrapperCommand GetBootstrapperCommand()
38 {
39 return new BootstrapperCommand(
40 this.action,
41 this.display,
42 Marshal.PtrToStringUni(this.wzCommandLine),
43 this.nCmdShow,
44 this.resume,
45 this.hwndSplashScreen,
46 this.relation,
47 this.passthrough,
48 Marshal.PtrToStringUni(this.wzLayoutDirectory),
49 Marshal.PtrToStringUni(this.wzBootstrapperWorkingFolder),
50 Marshal.PtrToStringUni(this.wzBootstrapperApplicationDataPath));
51 }
52 }
53
54 /// <summary>
55 /// Default implementation of <see cref="IBootstrapperCommand"/>.
56 /// </summary>
57 public sealed class BootstrapperCommand : IBootstrapperCommand
58 {
59 /// <summary>
60 /// See <see cref="IBootstrapperCommand"/>.
61 /// </summary>
62 public BootstrapperCommand(
63 LaunchAction action,
64 Display display,
65 string commandLine,
66 int cmdShow,
67 ResumeType resume,
68 IntPtr splashScreen,
69 RelationType relation,
70 bool passthrough,
71 string layoutDirectory,
72 string bootstrapperWorkingFolder,
73 string bootstrapperApplicationDataPath)
74 {
75 this.Action = action;
76 this.Display = display;
77 this.CommandLine = commandLine;
78 this.CmdShow = cmdShow;
79 this.Resume = resume;
80 this.SplashScreen = splashScreen;
81 this.Relation = relation;
82 this.Passthrough = passthrough;
83 this.LayoutDirectory = layoutDirectory;
84 this.BootstrapperWorkingFolder = bootstrapperWorkingFolder;
85 this.BootstrapperApplicationDataPath = bootstrapperApplicationDataPath;
86 }
87
88 /// <inheritdoc/>
89 public LaunchAction Action { get; }
90
91 /// <inheritdoc/>
92 public Display Display { get; }
93
94 /// <inheritdoc/>
95 public string CommandLine { get; }
96
97 /// <inheritdoc/>
98 public int CmdShow { get; }
99
100 /// <inheritdoc/>
101 public ResumeType Resume { get; }
102
103 /// <inheritdoc/>
104 public IntPtr SplashScreen { get; }
105
106 /// <inheritdoc/>
107 public RelationType Relation { get; }
108
109 /// <inheritdoc/>
110 public bool Passthrough { get; }
111
112 /// <inheritdoc/>
113 public string LayoutDirectory { get; }
114
115 /// <inheritdoc/>
116 public string BootstrapperWorkingFolder { get; }
117
118 /// <inheritdoc/>
119 public string BootstrapperApplicationDataPath { get; }
120
121 /// <inheritdoc/>
122 public IMbaCommand ParseCommandLine()
123 {
124 var args = ParseCommandLineToArgs(this.CommandLine);
125 var unknownArgs = new List<string>();
126 var variables = new List<KeyValuePair<string, string>>();
127 var restart = Restart.Unknown;
128
129 foreach (var arg in args)
130 {
131 var unknownArg = false;
132
133 if (arg[0] == '-' || arg[0] == '/')
134 {
135 var parameter = arg.Substring(1).ToLowerInvariant();
136 switch (parameter)
137 {
138 case "norestart":
139 if (restart == Restart.Unknown)
140 {
141 restart = Restart.Never;
142 }
143 break;
144 case "forcerestart":
145 if (restart == Restart.Unknown)
146 {
147 restart = Restart.Always;
148 }
149 break;
150 default:
151 unknownArg = true;
152 break;
153 }
154 }
155 else
156 {
157 var index = arg.IndexOf('=');
158 if (index == -1)
159 {
160 unknownArg = true;
161 }
162 else
163 {
164 var name = arg.Substring(0, index);
165 var value = arg.Substring(index + 1);
166 variables.Add(new KeyValuePair<string, string>(name, value));
167 }
168 }
169
170 if (unknownArg)
171 {
172 unknownArgs.Add(arg);
173 }
174 }
175
176 if (restart == Restart.Unknown)
177 {
178 restart = this.Display < Display.Full ? Restart.Automatic : Restart.Prompt;
179 }
180
181 return new MbaCommand
182 {
183 Restart = restart,
184 UnknownCommandLineArgs = unknownArgs.ToArray(),
185 Variables = variables.ToArray(),
186 };
187 }
188
189 /// <summary>
190 /// Gets the command line arguments as a string array.
191 /// </summary>
192 /// <returns>
193 /// Array of command line arguments.
194 /// </returns>
195 /// <exception type="Win32Exception">The command line could not be parsed into an array.</exception>
196 /// <remarks>
197 /// This method uses the same parsing as the operating system which handles quotes and spaces correctly.
198 /// </remarks>
199 public static string[] ParseCommandLineToArgs(string commandLine)
200 {
201 if (null == commandLine)
202 {
203 return new string[0];
204 }
205
206 // Parse the filtered command line arguments into a native array.
207 int argc = 0;
208
209 // CommandLineToArgvW tries to treat the first argument as the path to the process,
210 // which fails pretty miserably if your first argument is something like
211 // FOO="C:\Program Files\My Company". So give it something harmless to play with.
212 IntPtr argv = NativeMethods.CommandLineToArgvW("ignored " + commandLine, out argc);
213
214 if (IntPtr.Zero == argv)
215 {
216 // Throw an exception with the last error.
217 throw new Win32Exception();
218 }
219
220 // Marshal each native array pointer to a managed string.
221 try
222 {
223 // Skip "ignored" argument/hack.
224 string[] args = new string[argc - 1];
225 for (int i = 1; i < argc; ++i)
226 {
227 IntPtr argvi = Marshal.ReadIntPtr(argv, i * IntPtr.Size);
228 args[i - 1] = Marshal.PtrToStringUni(argvi);
229 }
230
231 return args;
232 }
233 finally
234 {
235 NativeMethods.LocalFree(argv);
236 }
237 }
238 }
239}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/BundleInfo.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/BundleInfo.cs
new file mode 100644
index 00000000..14cac881
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/BundleInfo.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.BootstrapperApplicationApi
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 IOverridableVariables OverridableVariables { get; internal set; }
27
28 /// <inheritdoc/>
29 public IDictionary<string, IPackageInfo> Packages { get; internal set; }
30
31 internal BundleInfo()
32 {
33 this.Packages = new Dictionary<string, IPackageInfo>();
34 }
35
36 /// <inheritdoc/>
37 public IPackageInfo AddRelatedBundleAsPackage(string productCode, RelationType relationType, bool perMachine, string version)
38 {
39 var package = PackageInfo.GetRelatedBundleAsPackage(productCode, relationType, perMachine, version);
40 this.Packages.Add(package.Id, package);
41 return package;
42 }
43
44 /// <inheritdoc/>
45 public IPackageInfo AddUpdateBundleAsPackage(string packageId)
46 {
47 var package = PackageInfo.GetUpdateBundleAsPackage(packageId);
48 this.Packages.Add(package.Id, package);
49 return package;
50 }
51
52 /// <summary>
53 /// Parses BA manifest from the given stream.
54 /// </summary>
55 /// <param name="stream"></param>
56 /// <returns></returns>
57 public static IBundleInfo ParseBundleFromStream(Stream stream)
58 {
59 XPathDocument manifest = new XPathDocument(stream);
60 XPathNavigator root = manifest.CreateNavigator();
61 return ParseBundleFromXml(root);
62 }
63
64 /// <summary>
65 /// Parses BA manifest from the given <see cref="XPathNavigator"/>.
66 /// </summary>
67 /// <param name="root">The root of the BA manifest.</param>
68 /// <returns></returns>
69 public static IBundleInfo ParseBundleFromXml(XPathNavigator root)
70 {
71 BundleInfo bundle = new BundleInfo();
72
73 XmlNamespaceManager namespaceManager = new XmlNamespaceManager(root.NameTable);
74 namespaceManager.AddNamespace("p", BootstrapperApplicationData.XMLNamespace);
75 XPathNavigator bundleNode = root.SelectSingleNode("/p:BootstrapperApplicationData/p:WixBundleProperties", namespaceManager);
76
77 if (bundleNode == null)
78 {
79 throw new Exception("Failed to select bundle information.");
80 }
81
82 bool? perMachine = BootstrapperApplicationData.GetYesNoAttribute(bundleNode, "PerMachine");
83 if (perMachine.HasValue)
84 {
85 bundle.PerMachine = perMachine.Value;
86 }
87
88 bundle.Name = BootstrapperApplicationData.GetAttribute(bundleNode, "DisplayName");
89
90 bundle.LogVariable = BootstrapperApplicationData.GetAttribute(bundleNode, "LogPathVariable");
91
92 bundle.OverridableVariables = OverridableVariablesInfo.ParseFromXml(root);
93
94 bundle.Packages = PackageInfo.ParsePackagesFromXml(root);
95
96 return bundle;
97 }
98 }
99}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs
new file mode 100644
index 00000000..487858e0
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/Engine.cs
@@ -0,0 +1,349 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.ComponentModel;
7 using System.Runtime.InteropServices;
8 using System.Security;
9
10 /// <summary>
11 /// Default implementation of <see cref="IEngine"/>.
12 /// </summary>
13 public sealed class Engine : IEngine
14 {
15 private IBootstrapperEngine engine;
16
17 internal Engine(IBootstrapperEngine engine)
18 {
19 this.engine = engine;
20 }
21
22 /// <inheritdoc/>
23 public int PackageCount
24 {
25 get
26 {
27 int count;
28 this.engine.GetPackageCount(out count);
29
30 return count;
31 }
32 }
33
34 /// <inheritdoc/>
35 public void Apply(IntPtr hwndParent)
36 {
37 this.engine.Apply(hwndParent);
38 }
39
40 /// <inheritdoc/>
41 public void CloseSplashScreen()
42 {
43 this.engine.CloseSplashScreen();
44 }
45
46 /// <inheritdoc/>
47 public int CompareVersions(string version1, string version2)
48 {
49 this.engine.CompareVersions(version1, version2, out var result);
50 return result;
51 }
52
53 /// <inheritdoc/>
54 public bool ContainsVariable(string name)
55 {
56 return BalUtil.BalVariableExistsFromEngine(this.engine, name);
57 }
58
59 /// <inheritdoc/>
60 public void Detect()
61 {
62 this.Detect(IntPtr.Zero);
63 }
64
65 /// <inheritdoc/>
66 public void Detect(IntPtr hwndParent)
67 {
68 this.engine.Detect(hwndParent);
69 }
70
71 /// <inheritdoc/>
72 public bool Elevate(IntPtr hwndParent)
73 {
74 int ret = this.engine.Elevate(hwndParent);
75
76 if (NativeMethods.S_OK == ret || NativeMethods.E_ALREADYINITIALIZED == ret)
77 {
78 return true;
79 }
80 else if (NativeMethods.E_CANCELLED == ret)
81 {
82 return false;
83 }
84 else
85 {
86 throw new Win32Exception(ret);
87 }
88 }
89
90 /// <inheritdoc/>
91 public string EscapeString(string input)
92 {
93 StrUtil.StrHandle handle = new StrUtil.StrHandle();
94 try
95 {
96 int ret = BalUtil.BalEscapeStringFromEngine(this.engine, input, ref handle);
97 if (ret != NativeMethods.S_OK)
98 {
99 throw new Win32Exception(ret);
100 }
101
102 return handle.ToUniString();
103 }
104 finally
105 {
106 handle.Dispose();
107 }
108 }
109
110 /// <inheritdoc/>
111 public bool EvaluateCondition(string condition)
112 {
113 bool value;
114 this.engine.EvaluateCondition(condition, out value);
115
116 return value;
117 }
118
119 /// <inheritdoc/>
120 public string FormatString(string format)
121 {
122 StrUtil.StrHandle handle = new StrUtil.StrHandle();
123 try
124 {
125 int ret = BalUtil.BalFormatStringFromEngine(this.engine, format, ref handle);
126 if (ret != NativeMethods.S_OK)
127 {
128 throw new Win32Exception(ret);
129 }
130
131 return handle.ToUniString();
132 }
133 finally
134 {
135 handle.Dispose();
136 }
137 }
138
139 /// <inheritdoc/>
140 public long GetVariableNumeric(string name)
141 {
142 int ret = this.engine.GetVariableNumeric(name, out long value);
143 if (NativeMethods.S_OK != ret)
144 {
145 throw new Win32Exception(ret);
146 }
147
148 return value;
149 }
150
151 /// <inheritdoc/>
152 public SecureString GetVariableSecureString(string name)
153 {
154 StrUtil.StrHandle handle = new StrUtil.StrHandle();
155 try
156 {
157 int ret = BalUtil.BalGetStringVariableFromEngine(this.engine, name, ref handle);
158 if (ret != NativeMethods.S_OK)
159 {
160 throw new Win32Exception(ret);
161 }
162
163 return handle.ToSecureString();
164 }
165 finally
166 {
167 handle.Dispose();
168 }
169 }
170
171 /// <inheritdoc/>
172 public string GetVariableString(string name)
173 {
174 StrUtil.StrHandle handle = new StrUtil.StrHandle();
175 try
176 {
177 int ret = BalUtil.BalGetStringVariableFromEngine(this.engine, name, ref handle);
178 if (ret != NativeMethods.S_OK)
179 {
180 throw new Win32Exception(ret);
181 }
182
183 return handle.ToUniString();
184 }
185 finally
186 {
187 handle.Dispose();
188 }
189 }
190
191 /// <inheritdoc/>
192 public string GetVariableVersion(string name)
193 {
194 StrUtil.StrHandle handle = new StrUtil.StrHandle();
195 try
196 {
197 int ret = BalUtil.BalGetVersionVariableFromEngine(this.engine, name, ref handle);
198 if (ret != NativeMethods.S_OK)
199 {
200 throw new Win32Exception(ret);
201 }
202
203 return handle.ToUniString();
204 }
205 finally
206 {
207 handle.Dispose();
208 }
209 }
210
211 /// <inheritdoc/>
212 public string GetRelatedBundleVariable(string bundleId, string name)
213 {
214 StrUtil.StrHandle handle = new StrUtil.StrHandle();
215 try
216 {
217 int ret = BalUtil.BalGetRelatedBundleVariableFromEngine(this.engine, bundleId, name, ref handle);
218 if (ret != NativeMethods.S_OK)
219 {
220 throw new Win32Exception(ret);
221 }
222
223 return handle.ToUniString();
224 }
225 finally
226 {
227 handle.Dispose();
228 }
229 }
230
231 /// <inheritdoc/>
232 public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments)
233 {
234 this.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, 0);
235 }
236
237 /// <inheritdoc/>
238 public void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout)
239 {
240 this.engine.LaunchApprovedExe(hwndParent, approvedExeForElevationId, arguments, waitForInputIdleTimeout);
241 }
242 /// <inheritdoc/>
243
244 public void Log(LogLevel level, string message)
245 {
246 this.engine.Log(level, message);
247 }
248
249 /// <inheritdoc/>
250 public void Plan(LaunchAction action)
251 {
252 this.engine.Plan(action);
253 }
254
255 /// <inheritdoc/>
256 public void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, string hash, string updatePackageId)
257 {
258 this.engine.SetUpdate(localSource, downloadSource, size, hashType, hash, updatePackageId);
259 }
260
261 /// <inheritdoc/>
262 public void SetUpdateSource(string url)
263 {
264 this.engine.SetUpdateSource(url);
265 }
266
267 /// <inheritdoc/>
268 public void SetLocalSource(string packageOrContainerId, string payloadId, string path)
269 {
270 this.engine.SetLocalSource(packageOrContainerId, payloadId, path);
271 }
272
273 /// <inheritdoc/>
274 public void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password)
275 {
276 this.engine.SetDownloadSource(packageOrContainerId, payloadId, url, user, password);
277 }
278
279 /// <inheritdoc/>
280 public void SetVariableNumeric(string name, long value)
281 {
282 this.engine.SetVariableNumeric(name, value);
283 }
284
285 /// <inheritdoc/>
286 public void SetVariableString(string name, SecureString value, bool formatted)
287 {
288 IntPtr pValue = Marshal.SecureStringToCoTaskMemUnicode(value);
289 try
290 {
291 this.engine.SetVariableString(name, pValue, formatted);
292 }
293 finally
294 {
295 Marshal.FreeCoTaskMem(pValue);
296 }
297 }
298
299 /// <inheritdoc/>
300 public void SetVariableString(string name, string value, bool formatted)
301 {
302 IntPtr pValue = Marshal.StringToCoTaskMemUni(value);
303 try
304 {
305 this.engine.SetVariableString(name, pValue, formatted);
306 }
307 finally
308 {
309 Marshal.FreeCoTaskMem(pValue);
310 }
311 }
312
313 /// <inheritdoc/>
314 public void SetVariableVersion(string name, string value)
315 {
316 IntPtr pValue = Marshal.StringToCoTaskMemUni(value);
317 try
318 {
319 this.engine.SetVariableVersion(name, pValue);
320 }
321 finally
322 {
323 Marshal.FreeCoTaskMem(pValue);
324 }
325 }
326
327 /// <inheritdoc/>
328 public int SendEmbeddedError(int errorCode, string message, int uiHint)
329 {
330 int result = 0;
331 this.engine.SendEmbeddedError(errorCode, message, uiHint, out result);
332 return result;
333 }
334
335 /// <inheritdoc/>
336 public int SendEmbeddedProgress(int progressPercentage, int overallPercentage)
337 {
338 int result = 0;
339 this.engine.SendEmbeddedProgress(progressPercentage, overallPercentage, out result);
340 return result;
341 }
342
343 /// <inheritdoc/>
344 public void Quit(int exitCode)
345 {
346 this.engine.Quit(exitCode);
347 }
348 }
349}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/EventArgs.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/EventArgs.cs
new file mode 100644
index 00000000..e1649d43
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/EventArgs.cs
@@ -0,0 +1,2757 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Collections.ObjectModel;
8 using System.Runtime.InteropServices;
9
10 /// <summary>
11 /// Base class for BA <see cref="EventArgs"/> classes.
12 /// </summary>
13 [Serializable]
14 public abstract class HResultEventArgs : EventArgs
15 {
16 /// <summary>
17 /// This class is for events raised by the engine.
18 /// It is not intended to be instantiated by user code.
19 /// </summary>
20 public HResultEventArgs()
21 {
22 }
23
24 /// <summary>
25 /// Gets or sets the <see cref="HResult"/> of the operation. This is passed back to the engine.
26 /// </summary>
27 public int HResult { get; set; }
28 }
29
30 /// <summary>
31 /// Base class for cancellable BA <see cref="EventArgs"/> classes.
32 /// </summary>
33 [Serializable]
34 public abstract class CancellableHResultEventArgs : HResultEventArgs
35 {
36 /// <summary>
37 /// This class is for events raised by the engine.
38 /// It is not intended to be instantiated by user code.
39 /// </summary>
40 public CancellableHResultEventArgs(bool cancelRecommendation)
41 {
42 this.Cancel = cancelRecommendation;
43 }
44
45 /// <summary>
46 /// Gets or sets whether to cancel the operation. This is passed back to the engine.
47 /// </summary>
48 public bool Cancel { get; set; }
49 }
50
51 /// <summary>
52 /// Base class for <see cref="EventArgs"/> classes that must return a <see cref="Result"/>.
53 /// </summary>
54 [Serializable]
55 public abstract class ResultEventArgs : HResultEventArgs
56 {
57 /// <summary>
58 /// This class is for events raised by the engine.
59 /// It is not intended to be instantiated by user code.
60 /// </summary>
61 public ResultEventArgs(Result recommendation, Result result)
62 {
63 this.Recommendation = recommendation;
64 this.Result = result;
65 }
66
67 /// <summary>
68 /// Gets the recommended <see cref="Result"/> of the operation.
69 /// </summary>
70 public Result Recommendation { get; private set; }
71
72 /// <summary>
73 /// Gets or sets the <see cref="Result"/> of the operation. This is passed back to the engine.
74 /// </summary>
75 public Result Result { get; set; }
76 }
77
78 /// <summary>
79 /// Base class for <see cref="EventArgs"/> classes that receive status from the engine.
80 /// </summary>
81 [Serializable]
82 public abstract class StatusEventArgs : HResultEventArgs
83 {
84 /// <summary>
85 /// This class is for events raised by the engine.
86 /// It is not intended to be instantiated by user code.
87 /// </summary>
88 public StatusEventArgs(int hrStatus)
89 {
90 this.Status = hrStatus;
91 }
92
93 /// <summary>
94 /// Gets the return code of the operation.
95 /// </summary>
96 public int Status { get; private set; }
97 }
98
99 /// <summary>
100 /// Base class for <see cref="EventArgs"/> classes that receive status from the engine and return an action.
101 /// </summary>
102 public abstract class ActionEventArgs<T> : StatusEventArgs
103 {
104 /// <summary>
105 /// This class is for events raised by the engine.
106 /// It is not intended to be instantiated by user code.
107 /// </summary>
108 public ActionEventArgs(int hrStatus, T recommendation, T action)
109 : base(hrStatus)
110 {
111 this.Recommendation = recommendation;
112 this.Action = action;
113 }
114
115 /// <summary>
116 /// Gets the recommended action from the engine.
117 /// </summary>
118 public T Recommendation { get; private set; }
119
120 /// <summary>
121 /// Gets or sets the action to be performed. This is passed back to the engine.
122 /// </summary>
123 public T Action { get; set; }
124 }
125
126 /// <summary>
127 /// Base class for cancellable action BA <see cref="EventArgs"/> classes.
128 /// </summary>
129 [Serializable]
130 public abstract class CancellableActionEventArgs<T> : CancellableHResultEventArgs
131 {
132 /// <summary>
133 /// This class is for events raised by the engine.
134 /// It is not intended to be instantiated by user code.
135 /// </summary>
136 public CancellableActionEventArgs(bool cancelRecommendation, T recommendation, T action)
137 : base(cancelRecommendation)
138 {
139 this.Recommendation = recommendation;
140 this.Action = action;
141 }
142
143 /// <summary>
144 /// Gets the recommended action from the engine.
145 /// </summary>
146 public T Recommendation { get; private set; }
147
148 /// <summary>
149 /// Gets or sets the action to be performed. This is passed back to the engine.
150 /// </summary>
151 public T Action { get; set; }
152 }
153
154 /// <summary>
155 /// Base class for cache progress events.
156 /// </summary>
157 [Serializable]
158 public abstract class CacheProgressBaseEventArgs : CancellableHResultEventArgs
159 {
160 /// <summary>
161 /// This class is for events raised by the engine.
162 /// It is not intended to be instantiated by user code.
163 /// </summary>
164 public CacheProgressBaseEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
165 : base(cancelRecommendation)
166 {
167 this.PackageOrContainerId = packageOrContainerId;
168 this.PayloadId = payloadId;
169 this.Progress = progress;
170 this.Total = total;
171 this.OverallPercentage = overallPercentage;
172 }
173
174 /// <summary>
175 /// Gets the identifier of the container or package.
176 /// </summary>
177 public string PackageOrContainerId { get; private set; }
178
179 /// <summary>
180 /// Gets the identifier of the payload.
181 /// </summary>
182 public string PayloadId { get; private set; }
183
184 /// <summary>
185 /// Gets the number of bytes cached thus far.
186 /// </summary>
187 public long Progress { get; private set; }
188
189 /// <summary>
190 /// Gets the total bytes to cache.
191 /// </summary>
192 public long Total { get; private set; }
193
194 /// <summary>
195 /// Gets the overall percentage of progress of caching.
196 /// </summary>
197 public int OverallPercentage { get; private set; }
198 }
199
200 /// <summary>
201 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Create"/>.
202 /// </summary>
203 [Serializable]
204 public class CreateEventArgs : HResultEventArgs
205 {
206 /// <summary>
207 /// This class is for events raised by the engine.
208 /// It is not intended to be instantiated by user code.
209 /// </summary>
210 public CreateEventArgs(IEngine engine, IBootstrapperCommand command)
211 {
212 this.Engine = engine;
213 this.Command = command;
214 }
215
216 /// <summary>
217 /// Engine running the application.
218 /// </summary>
219 public IEngine Engine { get; }
220
221 /// <summary>
222 /// Command line arguments.
223 /// </summary>
224 public IBootstrapperCommand Command { get; }
225 }
226
227 /// <summary>
228 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Destroy"/>.
229 /// </summary>
230 [Serializable]
231 public class DestroyEventArgs : HResultEventArgs
232 {
233 /// <summary>
234 /// This class is for events raised by the engine.
235 /// It is not intended to be instantiated by user code.
236 /// </summary>
237 public DestroyEventArgs(bool reload)
238 {
239 this.Reload = reload;
240 }
241
242 /// <summary>
243 /// Bootstrapper application is being reloaded.
244 /// </summary>
245 public bool Reload { get; }
246 }
247
248 /// <summary>
249 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Startup"/>.
250 /// </summary>
251 [Serializable]
252 public class StartupEventArgs : HResultEventArgs
253 {
254 /// <summary>
255 /// This class is for events raised by the engine.
256 /// It is not intended to be instantiated by user code.
257 /// </summary>
258 public StartupEventArgs()
259 {
260 }
261 }
262
263 /// <summary>
264 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Shutdown"/>.
265 /// </summary>
266 [Serializable]
267 public class ShutdownEventArgs : HResultEventArgs
268 {
269 /// <summary>
270 /// This class is for events raised by the engine.
271 /// It is not intended to be instantiated by user code.
272 /// </summary>
273 public ShutdownEventArgs(BOOTSTRAPPER_SHUTDOWN_ACTION action)
274 {
275 this.Action = action;
276 }
277
278 /// <summary>
279 /// The action for OnShutdown.
280 /// </summary>
281 public BOOTSTRAPPER_SHUTDOWN_ACTION Action { get; set; }
282 }
283
284 /// <summary>
285 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectBegin"/>
286 /// </summary>
287 [Serializable]
288 public class DetectBeginEventArgs : CancellableHResultEventArgs
289 {
290 /// <summary>
291 /// This class is for events raised by the engine.
292 /// It is not intended to be instantiated by user code.
293 /// </summary>
294 public DetectBeginEventArgs(bool cached, RegistrationType registrationType, int packageCount, bool cancelRecommendation)
295 : base(cancelRecommendation)
296 {
297 this.Cached = cached;
298 this.RegistrationType = registrationType;
299 this.PackageCount = packageCount;
300 }
301
302 /// <summary>
303 /// Gets whether the bundle is cached.
304 /// </summary>
305 public bool Cached { get; private set; }
306
307 /// <summary>
308 /// Gets the bundle's registration state.
309 /// </summary>
310 public RegistrationType RegistrationType { get; private set; }
311
312 /// <summary>
313 /// Gets the number of packages to detect.
314 /// </summary>
315 public int PackageCount { get; private set; }
316 }
317
318 /// <summary>
319 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectForwardCompatibleBundle"/>
320 /// </summary>
321 [Serializable]
322 public class DetectForwardCompatibleBundleEventArgs : CancellableHResultEventArgs
323 {
324 /// <summary>
325 /// This class is for events raised by the engine.
326 /// It is not intended to be instantiated by user code.
327 /// </summary>
328 public DetectForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, string version, bool missingFromCache, bool cancelRecommendation)
329 : base(cancelRecommendation)
330 {
331 this.BundleId = bundleId;
332 this.RelationType = relationType;
333 this.BundleTag = bundleTag;
334 this.PerMachine = perMachine;
335 this.Version = version;
336 this.MissingFromCache = missingFromCache;
337 }
338
339 /// <summary>
340 /// Gets the identity of the forward compatible bundle detected.
341 /// </summary>
342 public string BundleId { get; private set; }
343
344 /// <summary>
345 /// Gets the relationship type of the forward compatible bundle.
346 /// </summary>
347 public RelationType RelationType { get; private set; }
348
349 /// <summary>
350 /// Gets the tag of the forward compatible bundle.
351 /// </summary>
352 public string BundleTag { get; private set; }
353
354 /// <summary>
355 /// Gets whether the detected forward compatible bundle is per machine.
356 /// </summary>
357 public bool PerMachine { get; private set; }
358
359 /// <summary>
360 /// Gets the version of the forward compatible bundle detected.
361 /// </summary>
362 public string Version { get; private set; }
363
364 /// <summary>
365 /// Whether the forward compatible bundle is missing from the package cache.
366 /// </summary>
367 public bool MissingFromCache { get; set; }
368 }
369
370 /// <summary>
371 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdateBegin"/>
372 /// </summary>
373 [Serializable]
374 public class DetectUpdateBeginEventArgs : CancellableHResultEventArgs
375 {
376 /// <summary>
377 /// This class is for events raised by the engine.
378 /// It is not intended to be instantiated by user code.
379 /// </summary>
380 public DetectUpdateBeginEventArgs(string updateLocation, bool cancelRecommendation, bool skipRecommendation)
381 : base(cancelRecommendation)
382 {
383 this.UpdateLocation = updateLocation;
384 this.Skip = skipRecommendation;
385 }
386
387 /// <summary>
388 /// Gets the identity of the bundle to detect.
389 /// </summary>
390 public string UpdateLocation { get; private set; }
391
392 /// <summary>
393 /// Whether to skip checking for bundle updates.
394 /// </summary>
395 public bool Skip { get; set; }
396 }
397
398 /// <summary>
399 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdate"/>
400 /// </summary>
401 [Serializable]
402 public class DetectUpdateEventArgs : CancellableHResultEventArgs
403 {
404 /// <summary>
405 /// This class is for events raised by the engine.
406 /// It is not intended to be instantiated by user code.
407 /// </summary>
408 public DetectUpdateEventArgs(string updateLocation, long size, string hash, UpdateHashType hashAlgorithm, string version, string title, string summary, string contentType, string content, bool cancelRecommendation, bool stopRecommendation)
409 : base(cancelRecommendation)
410 {
411 this.UpdateLocation = updateLocation;
412 this.Size = size;
413 this.Hash = hash;
414 this.HashAlgorithm = hashAlgorithm;
415 this.Version = version;
416 this.Title = title;
417 this.Summary = summary;
418 this.ContentType = contentType;
419 this.Content = content;
420 this.StopProcessingUpdates = stopRecommendation;
421 }
422
423 /// <summary>
424 /// Gets the identity of the bundle to detect.
425 /// </summary>
426 public string UpdateLocation { get; private set; }
427
428 /// <summary>
429 /// Gets the size of the updated bundle.
430 /// </summary>
431 public long Size { get; private set; }
432
433 /// <summary>
434 /// File hash of the updated bundle.
435 /// </summary>
436 public string Hash { get; }
437
438 /// <summary>
439 /// The algorithm of the updated bundle's hash.
440 /// </summary>
441 public UpdateHashType HashAlgorithm { get; }
442
443 /// <summary>
444 /// Gets the version of the updated bundle.
445 /// </summary>
446 public string Version { get; private set; }
447
448 /// <summary>
449 /// Gets the title of the the updated bundle.
450 /// </summary>
451 public string Title { get; private set; }
452
453 /// <summary>
454 /// Gets the summary of the updated bundle.
455 /// </summary>
456 public string Summary { get; private set; }
457
458 /// <summary>
459 /// Gets the content type of the content of the updated bundle.
460 /// </summary>
461 public string ContentType { get; private set; }
462
463 /// <summary>
464 /// Gets the content of the updated bundle.
465 /// </summary>
466 public string Content { get; private set; }
467
468 /// <summary>
469 /// Tells the engine to stop giving the rest of the updates found in the feed.
470 /// </summary>
471 public bool StopProcessingUpdates { get; set; }
472 }
473
474 /// <summary>
475 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectUpdateComplete"/>
476 /// </summary>
477 [Serializable]
478 public class DetectUpdateCompleteEventArgs : StatusEventArgs
479 {
480 /// <summary>
481 /// This class is for events raised by the engine.
482 /// It is not intended to be instantiated by user code.
483 /// </summary>
484 public DetectUpdateCompleteEventArgs(int hrStatus, bool ignoreRecommendation)
485 : base(hrStatus)
486 {
487 this.IgnoreError = ignoreRecommendation;
488 }
489
490 /// <summary>
491 /// If Status is an error, then set this to true to ignore it and continue detecting.
492 /// </summary>
493 public bool IgnoreError { get; set; }
494 }
495
496 /// <summary>
497 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectRelatedBundle"/>
498 /// </summary>
499 [Serializable]
500 public class DetectRelatedBundleEventArgs : CancellableHResultEventArgs
501 {
502 /// <summary>
503 /// This class is for events raised by the engine.
504 /// It is not intended to be instantiated by user code.
505 /// </summary>
506 public DetectRelatedBundleEventArgs(string productCode, RelationType relationType, string bundleTag, bool perMachine, string version, bool missingFromCache, bool cancelRecommendation)
507 : base(cancelRecommendation)
508 {
509 this.ProductCode = productCode;
510 this.RelationType = relationType;
511 this.BundleTag = bundleTag;
512 this.PerMachine = perMachine;
513 this.Version = version;
514 this.MissingFromCache = missingFromCache;
515 }
516
517 /// <summary>
518 /// Gets the identity of the related bundle detected.
519 /// </summary>
520 public string ProductCode { get; private set; }
521
522 /// <summary>
523 /// Gets the relationship type of the related bundle.
524 /// </summary>
525 public RelationType RelationType { get; private set; }
526
527 /// <summary>
528 /// Gets the tag of the related package bundle.
529 /// </summary>
530 public string BundleTag { get; private set; }
531
532 /// <summary>
533 /// Gets whether the detected bundle is per machine.
534 /// </summary>
535 public bool PerMachine { get; private set; }
536
537 /// <summary>
538 /// Gets the version of the related bundle detected.
539 /// </summary>
540 public string Version { get; private set; }
541
542 /// <summary>
543 /// Whether the related bundle is missing from the package cache.
544 /// </summary>
545 public bool MissingFromCache { get; set; }
546 }
547
548 /// <summary>
549 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectPackageBegin"/>
550 /// </summary>
551 [Serializable]
552 public class DetectPackageBeginEventArgs : CancellableHResultEventArgs
553 {
554 /// <summary>
555 /// This class is for events raised by the engine.
556 /// It is not intended to be instantiated by user code.
557 /// </summary>
558 public DetectPackageBeginEventArgs(string packageId, bool cancelRecommendation)
559 : base(cancelRecommendation)
560 {
561 this.PackageId = packageId;
562 }
563
564 /// <summary>
565 /// Gets the identity of the package to detect.
566 /// </summary>
567 public string PackageId { get; private set; }
568 }
569
570 /// <summary>
571 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectCompatibleMsiPackage"/>
572 /// </summary>
573 [Serializable]
574 public class DetectCompatibleMsiPackageEventArgs : CancellableHResultEventArgs
575 {
576 /// <summary>
577 /// This class is for events raised by the engine.
578 /// It is not intended to be instantiated by user code.
579 /// </summary>
580 public DetectCompatibleMsiPackageEventArgs(string packageId, string compatiblePackageId, string compatiblePackageVersion, bool cancelRecommendation)
581 : base(cancelRecommendation)
582 {
583 this.PackageId = packageId;
584 this.CompatiblePackageId = compatiblePackageId;
585 this.CompatiblePackageVersion = compatiblePackageVersion;
586 }
587
588 /// <summary>
589 /// Gets the identity of the package that was not detected.
590 /// </summary>
591 public string PackageId { get; private set; }
592
593 /// <summary>
594 /// Gets the identity of the compatible package that was detected.
595 /// </summary>
596 public string CompatiblePackageId { get; private set; }
597
598 /// <summary>
599 /// Gets the version of the compatible package that was detected.
600 /// </summary>
601 public string CompatiblePackageVersion { get; private set; }
602 }
603
604 /// <summary>
605 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectRelatedMsiPackage"/>
606 /// </summary>
607 [Serializable]
608 public class DetectRelatedMsiPackageEventArgs : CancellableHResultEventArgs
609 {
610 /// <summary>
611 /// This class is for events raised by the engine.
612 /// It is not intended to be instantiated by user code.
613 /// </summary>
614 public DetectRelatedMsiPackageEventArgs(string packageId, string upgradeCode, string productCode, bool perMachine, string version, RelatedOperation operation, bool cancelRecommendation)
615 : base(cancelRecommendation)
616 {
617 this.PackageId = packageId;
618 this.UpgradeCode = upgradeCode;
619 this.ProductCode = productCode;
620 this.PerMachine = perMachine;
621 this.Version = version;
622 this.Operation = operation;
623 }
624
625 /// <summary>
626 /// Gets the identity of the product's package detected.
627 /// </summary>
628 public string PackageId { get; private set; }
629
630 /// <summary>
631 /// Gets the upgrade code of the related package detected.
632 /// </summary>
633 public string UpgradeCode { get; private set; }
634
635 /// <summary>
636 /// Gets the identity of the related package detected.
637 /// </summary>
638 public string ProductCode { get; private set; }
639
640 /// <summary>
641 /// Gets whether the detected package is per machine.
642 /// </summary>
643 public bool PerMachine { get; private set; }
644
645 /// <summary>
646 /// Gets the version of the related package detected.
647 /// </summary>
648 public string Version { get; private set; }
649
650 /// <summary>
651 /// Gets the operation that will be taken on the detected package.
652 /// </summary>
653 public RelatedOperation Operation { get; private set; }
654 }
655
656 /// <summary>
657 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectPatchTarget"/>
658 /// </summary>
659 public class DetectPatchTargetEventArgs : CancellableHResultEventArgs
660 {
661 /// <summary>
662 /// This class is for events raised by the engine.
663 /// It is not intended to be instantiated by user code.
664 /// </summary>
665 public DetectPatchTargetEventArgs(string packageId, string productCode, PackageState state, bool cancelRecommendation)
666 : base(cancelRecommendation)
667 {
668 this.PackageId = packageId;
669 this.ProductCode = productCode;
670 this.State = state;
671 }
672
673 /// <summary>
674 /// Gets the identity of the patch's package.
675 /// </summary>
676 public string PackageId { get; private set; }
677
678 /// <summary>
679 /// Gets the product code of the target.
680 /// </summary>
681 public string ProductCode { get; private set; }
682
683 /// <summary>
684 /// Gets the detected patch state for the target.
685 /// </summary>
686 public PackageState State { get; private set; }
687 }
688
689 /// <summary>
690 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectMsiFeature"/>
691 /// </summary>
692 public class DetectMsiFeatureEventArgs : CancellableHResultEventArgs
693 {
694 /// <summary>
695 /// This class is for events raised by the engine.
696 /// It is not intended to be instantiated by user code.
697 /// </summary>
698 public DetectMsiFeatureEventArgs(string packageId, string featureId, FeatureState state, bool cancelRecommendation)
699 : base(cancelRecommendation)
700 {
701 this.PackageId = packageId;
702 this.FeatureId = featureId;
703 this.State = state;
704 }
705
706 /// <summary>
707 /// Gets the identity of the feature's package detected.
708 /// </summary>
709 public string PackageId { get; private set; }
710
711 /// <summary>
712 /// Gets the identity of the feature detected.
713 /// </summary>
714 public string FeatureId { get; private set; }
715
716 /// <summary>
717 /// Gets the detected feature state.
718 /// </summary>
719 public FeatureState State { get; private set; }
720 }
721
722 /// <summary>
723 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectPackageComplete"/>.
724 /// </summary>
725 [Serializable]
726 public class DetectPackageCompleteEventArgs : StatusEventArgs
727 {
728 /// <summary>
729 /// This class is for events raised by the engine.
730 /// It is not intended to be instantiated by user code.
731 /// </summary>
732 public DetectPackageCompleteEventArgs(string packageId, int hrStatus, PackageState state, bool cached)
733 : base(hrStatus)
734 {
735 this.PackageId = packageId;
736 this.State = state;
737 this.Cached = cached;
738 }
739
740 /// <summary>
741 /// Gets the identity of the package detected.
742 /// </summary>
743 public string PackageId { get; private set; }
744
745 /// <summary>
746 /// Gets the state of the specified package.
747 /// </summary>
748 public PackageState State { get; private set; }
749
750 /// <summary>
751 /// Gets whether any part of the package is cached.
752 /// </summary>
753 public bool Cached { get; private set; }
754 }
755
756 /// <summary>
757 /// Event arguments used when the detection phase has completed.
758 /// </summary>
759 [Serializable]
760 public class DetectCompleteEventArgs : StatusEventArgs
761 {
762 /// <summary>
763 /// This class is for events raised by the engine.
764 /// It is not intended to be instantiated by user code.
765 /// </summary>
766 public DetectCompleteEventArgs(int hrStatus, bool eligibleForCleanup)
767 : base(hrStatus)
768 {
769 this.EligibleForCleanup = eligibleForCleanup;
770 }
771
772 /// <summary>
773 /// Indicates whether the engine will uninstall the bundle if shutdown without running Apply.
774 /// </summary>
775 public bool EligibleForCleanup { get; private set; }
776 }
777
778 /// <summary>
779 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanBegin"/>
780 /// </summary>
781 [Serializable]
782 public class PlanBeginEventArgs : CancellableHResultEventArgs
783 {
784 /// <summary>
785 /// This class is for events raised by the engine.
786 /// It is not intended to be instantiated by user code.
787 /// </summary>
788 public PlanBeginEventArgs(int packageCount, bool cancelRecommendation)
789 : base(cancelRecommendation)
790 {
791 this.PackageCount = packageCount;
792 }
793
794 /// <summary>
795 /// Gets the number of packages to plan for.
796 /// </summary>
797 public int PackageCount { get; private set; }
798 }
799
800 /// <summary>
801 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRelatedBundle"/>
802 /// </summary>
803 [Serializable]
804 public class PlanRelatedBundleEventArgs : CancellableHResultEventArgs
805 {
806 /// <summary>
807 /// This class is for events raised by the engine.
808 /// It is not intended to be instantiated by user code.
809 /// </summary>
810 public PlanRelatedBundleEventArgs(string bundleId, RequestState recommendedState, RequestState state, bool cancelRecommendation)
811 : base(cancelRecommendation)
812 {
813 this.BundleId = bundleId;
814 this.RecommendedState = recommendedState;
815 this.State = state;
816 }
817
818 /// <summary>
819 /// Gets the identity of the bundle to plan for.
820 /// </summary>
821 public string BundleId { get; private set; }
822
823 /// <summary>
824 /// Gets the recommended requested state for the bundle.
825 /// </summary>
826 public RequestState RecommendedState { get; private set; }
827
828 /// <summary>
829 /// Gets or sets the requested state for the bundle.
830 /// </summary>
831 public RequestState State { get; set; }
832 }
833
834 /// <summary>
835 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRelatedBundleType"/>
836 /// </summary>
837 [Serializable]
838 public class PlanRelatedBundleTypeEventArgs : CancellableHResultEventArgs
839 {
840 /// <summary>
841 /// This class is for events raised by the engine.
842 /// It is not intended to be instantiated by user code.
843 /// </summary>
844 public PlanRelatedBundleTypeEventArgs(string bundleId, RelatedBundlePlanType recommendedType, RelatedBundlePlanType type, bool cancelRecommendation)
845 : base(cancelRecommendation)
846 {
847 this.BundleId = bundleId;
848 this.RecommendedType = recommendedType;
849 this.Type = type;
850 }
851
852 /// <summary>
853 /// Gets the identity of the bundle to plan for.
854 /// </summary>
855 public string BundleId { get; private set; }
856
857 /// <summary>
858 /// Gets the recommended plan type for the bundle.
859 /// </summary>
860 public RelatedBundlePlanType RecommendedType { get; private set; }
861
862 /// <summary>
863 /// Gets or sets the plan type for the bundle.
864 /// </summary>
865 public RelatedBundlePlanType Type { get; set; }
866 }
867
868 /// <summary>
869 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPackageBegin"/>
870 /// </summary>
871 [Serializable]
872 public class PlanPackageBeginEventArgs : CancellableHResultEventArgs
873 {
874 /// <summary>
875 /// This class is for events raised by the engine.
876 /// It is not intended to be instantiated by user code.
877 /// </summary>
878 public PlanPackageBeginEventArgs(string packageId, PackageState currentState, bool cached, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition, BOOTSTRAPPER_PACKAGE_CONDITION_RESULT repairCondition, RequestState recommendedState, BOOTSTRAPPER_CACHE_TYPE recommendedCacheType, RequestState state, BOOTSTRAPPER_CACHE_TYPE cacheType, bool cancelRecommendation)
879 : base(cancelRecommendation)
880 {
881 this.PackageId = packageId;
882 this.CurrentState = currentState;
883 this.Cached = cached;
884 this.InstallCondition = installCondition;
885 this.RepairCondition = repairCondition;
886 this.RecommendedState = recommendedState;
887 this.RecommendedCacheType = recommendedCacheType;
888 this.State = state;
889 this.CacheType = cacheType;
890 }
891
892 /// <summary>
893 /// Gets the identity of the package to plan for.
894 /// </summary>
895 public string PackageId { get; private set; }
896
897 /// <summary>
898 /// Gets the current state of the package.
899 /// </summary>
900 public PackageState CurrentState { get; private set; }
901
902 /// <summary>
903 /// Gets whether any part of the package is cached.
904 /// </summary>
905 public bool Cached { get; private set; }
906
907 /// <summary>
908 /// Gets the evaluated result of the package's install condition.
909 /// </summary>
910 public BOOTSTRAPPER_PACKAGE_CONDITION_RESULT InstallCondition { get; private set; }
911
912 /// <summary>
913 /// Gets the evaluated result of the package's repair condition.
914 /// </summary>
915 public BOOTSTRAPPER_PACKAGE_CONDITION_RESULT RepairCondition { get; private set; }
916
917 /// <summary>
918 /// Gets the recommended requested state for the package.
919 /// </summary>
920 public RequestState RecommendedState { get; private set; }
921
922 /// <summary>
923 /// The authored cache type of the package.
924 /// </summary>
925 public BOOTSTRAPPER_CACHE_TYPE RecommendedCacheType { get; private set; }
926
927 /// <summary>
928 /// Gets or sets the requested state for the package.
929 /// </summary>
930 public RequestState State { get; set; }
931
932 /// <summary>
933 /// Gets or sets the requested cache type for the package.
934 /// </summary>
935 public BOOTSTRAPPER_CACHE_TYPE CacheType { get; set; }
936 }
937
938 /// <summary>
939 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanCompatibleMsiPackageBegin"/>
940 /// </summary>
941 [Serializable]
942 public class PlanCompatibleMsiPackageBeginEventArgs : CancellableHResultEventArgs
943 {
944 /// <summary>
945 /// This class is for events raised by the engine.
946 /// It is not intended to be instantiated by user code.
947 /// </summary>
948 public PlanCompatibleMsiPackageBeginEventArgs(string packageId, string compatiblePackageId, string compatiblePackageVersion, bool recommendedRemove, bool requestRemove, bool cancelRecommendation)
949 : base(cancelRecommendation)
950 {
951 this.PackageId = packageId;
952 this.CompatiblePackageId = compatiblePackageId;
953 this.CompatiblePackageVersion = compatiblePackageVersion;
954 this.RecommendedRemove = recommendedRemove;
955 this.RequestRemove = requestRemove;
956 }
957
958 /// <summary>
959 /// Gets the identity of the package that was not detected.
960 /// </summary>
961 public string PackageId { get; private set; }
962
963 /// <summary>
964 /// Gets the identity of the compatible package detected.
965 /// </summary>
966 public string CompatiblePackageId { get; private set; }
967
968 /// <summary>
969 /// Gets the version of the compatible package detected.
970 /// </summary>
971 public string CompatiblePackageVersion { get; private set; }
972
973 /// <summary>
974 /// Gets the recommended state to use for the compatible package for planning.
975 /// </summary>
976 public bool RecommendedRemove { get; private set; }
977
978 /// <summary>
979 /// Gets or sets whether to uninstall the compatible package.
980 /// </summary>
981 public bool RequestRemove { get; set; }
982 }
983
984 /// <summary>
985 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanCompatibleMsiPackageComplete"/>
986 /// </summary>
987 [Serializable]
988 public class PlanCompatibleMsiPackageCompleteEventArgs : StatusEventArgs
989 {
990 /// <summary>
991 /// This class is for events raised by the engine.
992 /// It is not intended to be instantiated by user code.
993 /// </summary>
994 public PlanCompatibleMsiPackageCompleteEventArgs(string packageId, string compatiblePackageId, int hrStatus, bool requestedRemove)
995 : base(hrStatus)
996 {
997 this.PackageId = packageId;
998 this.CompatiblePackageId = compatiblePackageId;
999 this.RequestedRemove = requestedRemove;
1000 }
1001
1002 /// <summary>
1003 /// Gets the identity of the package planned for.
1004 /// </summary>
1005 public string PackageId { get; private set; }
1006
1007 /// <summary>
1008 /// Gets the identity of the compatible package detected.
1009 /// </summary>
1010 public string CompatiblePackageId { get; private set; }
1011
1012 /// <summary>
1013 /// Gets the requested state of the package.
1014 /// </summary>
1015 public bool RequestedRemove { get; private set; }
1016 }
1017
1018 /// <summary>
1019 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRollbackBoundary"/>
1020 /// </summary>
1021 [Serializable]
1022 public class PlanRollbackBoundaryEventArgs : CancellableHResultEventArgs
1023 {
1024 /// <summary>
1025 /// This class is for events raised by the engine.
1026 /// It is not intended to be instantiated by user code.
1027 /// </summary>
1028 public PlanRollbackBoundaryEventArgs(string rollbackBoundaryId, bool recommendedTransaction, bool transaction, bool cancelRecommendation)
1029 : base(cancelRecommendation)
1030 {
1031 this.RollbackBoundaryId = rollbackBoundaryId;
1032 this.RecommendedTransaction = recommendedTransaction;
1033 this.Transaction = transaction;
1034 }
1035
1036 /// <summary>
1037 /// Gets the identity of the rollback boundary to plan for.
1038 /// </summary>
1039 public string RollbackBoundaryId { get; private set; }
1040
1041 /// <summary>
1042 /// Whether or not the rollback boundary was authored to use an MSI transaction.
1043 /// </summary>
1044 public bool RecommendedTransaction { get; private set; }
1045
1046 /// <summary>
1047 /// Whether or not an MSI transaction will be used in the rollback boundary.
1048 /// If <see cref="RecommendedTransaction"/> is false, setting the value to true has no effect.
1049 /// If <see cref="RecommendedTransaction"/> is true, setting the value to false will cause the packages inside this rollback boundary to be executed without a wrapping MSI transaction.
1050 /// </summary>
1051 public bool Transaction { get; set; }
1052 }
1053
1054 /// <summary>
1055 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPatchTarget"/>
1056 /// </summary>
1057 [Serializable]
1058 public class PlanPatchTargetEventArgs : CancellableHResultEventArgs
1059 {
1060 /// <summary>
1061 /// This class is for events raised by the engine.
1062 /// It is not intended to be instantiated by user code.
1063 /// </summary>
1064 public PlanPatchTargetEventArgs(string packageId, string productCode, RequestState recommendedState, RequestState state, bool cancelRecommendation)
1065 : base(cancelRecommendation)
1066 {
1067 this.PackageId = packageId;
1068 this.ProductCode = productCode;
1069 this.RecommendedState = recommendedState;
1070 this.State = state;
1071 }
1072
1073 /// <summary>
1074 /// Gets the identity of the patch's package.
1075 /// </summary>
1076 public string PackageId { get; private set; }
1077
1078 /// <summary>
1079 /// Gets the product code of the target.
1080 /// </summary>
1081 public string ProductCode { get; private set; }
1082
1083 /// <summary>
1084 /// Gets the recommended state of the patch to use by planning for the target.
1085 /// </summary>
1086 public RequestState RecommendedState { get; private set; }
1087
1088 /// <summary>
1089 /// Gets or sets the state of the patch to use by planning for the target.
1090 /// </summary>
1091 public RequestState State { get; set; }
1092 }
1093
1094 /// <summary>
1095 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanMsiFeature"/>
1096 /// </summary>
1097 [Serializable]
1098 public class PlanMsiFeatureEventArgs : CancellableHResultEventArgs
1099 {
1100 /// <summary>
1101 /// This class is for events raised by the engine.
1102 /// It is not intended to be instantiated by user code.
1103 /// </summary>
1104 public PlanMsiFeatureEventArgs(string packageId, string featureId, FeatureState recommendedState, FeatureState state, bool cancelRecommendation)
1105 : base(cancelRecommendation)
1106 {
1107 this.PackageId = packageId;
1108 this.FeatureId = featureId;
1109 this.RecommendedState = recommendedState;
1110 this.State = state;
1111 }
1112
1113 /// <summary>
1114 /// Gets the identity of the feature's package to plan.
1115 /// </summary>
1116 public string PackageId { get; private set; }
1117
1118 /// <summary>
1119 /// Gets the identity of the feature to plan.
1120 /// </summary>
1121 public string FeatureId { get; private set; }
1122
1123 /// <summary>
1124 /// Gets the recommended feature state to use by planning.
1125 /// </summary>
1126 public FeatureState RecommendedState { get; private set; }
1127
1128 /// <summary>
1129 /// Gets or sets the feature state to use by planning.
1130 /// </summary>
1131 public FeatureState State { get; set; }
1132 }
1133
1134 /// <summary>
1135 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanMsiPackage"/>
1136 /// </summary>
1137 [Serializable]
1138 public class PlanMsiPackageEventArgs : CancellableHResultEventArgs
1139 {
1140 /// <summary>
1141 /// This class is for events raised by the engine.
1142 /// It is not intended to be instantiated by user code.
1143 /// </summary>
1144 public PlanMsiPackageEventArgs(string packageId, bool shouldExecute, ActionState action, BOOTSTRAPPER_MSI_FILE_VERSIONING recommendedFileVersioning, bool cancelRecommendation, BURN_MSI_PROPERTY actionMsiProperty, INSTALLUILEVEL uiLevel, bool disableExternalUiHandler, BOOTSTRAPPER_MSI_FILE_VERSIONING fileVersioning)
1145 : base(cancelRecommendation)
1146 {
1147 this.PackageId = packageId;
1148 this.ShouldExecute = shouldExecute;
1149 this.Action = action;
1150 this.RecommendedFileVersioning = recommendedFileVersioning;
1151 this.ActionMsiProperty = actionMsiProperty;
1152 this.UiLevel = uiLevel;
1153 this.DisableExternalUiHandler = disableExternalUiHandler;
1154 this.FileVersioning = fileVersioning;
1155 }
1156
1157 /// <summary>
1158 /// Gets identity of the package planned for.
1159 /// </summary>
1160 public string PackageId { get; private set; }
1161
1162 /// <summary>
1163 /// Gets whether the package is planned to execute or roll back.
1164 /// </summary>
1165 public bool ShouldExecute { get; private set; }
1166
1167 /// <summary>
1168 /// Gets the action planned for the package.
1169 /// </summary>
1170 public ActionState Action { get; private set; }
1171
1172 /// <summary>
1173 /// Gets the recommended file versioning for the package.
1174 /// </summary>
1175 public BOOTSTRAPPER_MSI_FILE_VERSIONING RecommendedFileVersioning { get; private set; }
1176
1177 /// <summary>
1178 /// Gets or sets the requested MSI property to add.
1179 /// </summary>
1180 public BURN_MSI_PROPERTY ActionMsiProperty { get; set; }
1181
1182 /// <summary>
1183 /// Gets or sets the requested internal UI level.
1184 /// </summary>
1185 public INSTALLUILEVEL UiLevel { get; set; }
1186
1187 /// <summary>
1188 /// Gets or sets whether Burn is requested to set up an external UI handler.
1189 /// </summary>
1190 public bool DisableExternalUiHandler { get; set; }
1191
1192 /// <summary>
1193 /// Gets or sets the requested file versioning.
1194 /// </summary>
1195 public BOOTSTRAPPER_MSI_FILE_VERSIONING FileVersioning { get; set; }
1196 }
1197
1198 /// <summary>
1199 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanPackageComplete"/>
1200 /// </summary>
1201 [Serializable]
1202 public class PlanPackageCompleteEventArgs : StatusEventArgs
1203 {
1204 /// <summary>
1205 /// This class is for events raised by the engine.
1206 /// It is not intended to be instantiated by user code.
1207 /// </summary>
1208 public PlanPackageCompleteEventArgs(string packageId, int hrStatus, RequestState requested)
1209 : base(hrStatus)
1210 {
1211 this.PackageId = packageId;
1212 this.Requested = requested;
1213 }
1214
1215 /// <summary>
1216 /// Gets the identity of the package planned for.
1217 /// </summary>
1218 public string PackageId { get; private set; }
1219
1220 /// <summary>
1221 /// Gets the requested state for the package.
1222 /// </summary>
1223 public RequestState Requested { get; private set; }
1224 }
1225
1226 /// <summary>
1227 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlannedCompatiblePackage"/>
1228 /// </summary>
1229 [Serializable]
1230 public class PlannedCompatiblePackageEventArgs : HResultEventArgs
1231 {
1232 /// <summary>
1233 /// This class is for events raised by the engine.
1234 /// It is not intended to be instantiated by user code.
1235 /// </summary>
1236 public PlannedCompatiblePackageEventArgs(string packageId, string compatiblePackageId, bool remove)
1237 {
1238 this.PackageId = packageId;
1239 this.CompatiblePackageId = compatiblePackageId;
1240 this.Remove = remove;
1241 }
1242
1243 /// <summary>
1244 /// Gets the identity of the package planned for.
1245 /// </summary>
1246 public string PackageId { get; private set; }
1247
1248 /// <summary>
1249 /// Gets the identity of the compatible package detected.
1250 /// </summary>
1251 public string CompatiblePackageId { get; private set; }
1252
1253 /// <summary>
1254 /// Gets the planned state of the package.
1255 /// </summary>
1256 public bool Remove { get; private set; }
1257 }
1258
1259 /// <summary>
1260 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlannedPackage"/>
1261 /// </summary>
1262 [Serializable]
1263 public class PlannedPackageEventArgs : HResultEventArgs
1264 {
1265 /// <summary>
1266 /// This class is for events raised by the engine.
1267 /// It is not intended to be instantiated by user code.
1268 /// </summary>
1269 public PlannedPackageEventArgs(string packageId, ActionState execute, ActionState rollback, bool cache, bool uncache)
1270 {
1271 this.PackageId = packageId;
1272 this.Execute = execute;
1273 this.Rollback = rollback;
1274 this.Cache = cache;
1275 this.Uncache = uncache;
1276 }
1277
1278 /// <summary>
1279 /// Gets the identity of the package planned for.
1280 /// </summary>
1281 public string PackageId { get; private set; }
1282
1283 /// <summary>
1284 /// Gets the planned execution action.
1285 /// </summary>
1286 public ActionState Execute { get; private set; }
1287
1288 /// <summary>
1289 /// Gets the planned rollback action.
1290 /// </summary>
1291 public ActionState Rollback { get; private set; }
1292
1293 /// <summary>
1294 /// Gets whether the package will be cached.
1295 /// </summary>
1296 public bool Cache { get; private set; }
1297
1298 /// <summary>
1299 /// Gets whether the package will be removed from the package cache.
1300 /// </summary>
1301 public bool Uncache { get; private set; }
1302 }
1303
1304 /// <summary>
1305 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanComplete"/>.
1306 /// </summary>
1307 [Serializable]
1308 public class PlanCompleteEventArgs : StatusEventArgs
1309 {
1310 /// <summary>
1311 /// This class is for events raised by the engine.
1312 /// It is not intended to be instantiated by user code.
1313 /// </summary>
1314 public PlanCompleteEventArgs(int hrStatus)
1315 : base(hrStatus)
1316 {
1317 }
1318 }
1319
1320 /// <summary>
1321 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanForwardCompatibleBundle"/>
1322 /// </summary>
1323 [Serializable]
1324 public class PlanForwardCompatibleBundleEventArgs : CancellableHResultEventArgs
1325 {
1326 /// <summary>
1327 /// This class is for events raised by the engine.
1328 /// It is not intended to be instantiated by user code.
1329 /// </summary>
1330 public PlanForwardCompatibleBundleEventArgs(string bundleId, RelationType relationType, string bundleTag, bool perMachine, string version, bool recommendedIgnoreBundle, bool cancelRecommendation, bool ignoreBundle)
1331 : base(cancelRecommendation)
1332 {
1333 this.BundleId = bundleId;
1334 this.RelationType = relationType;
1335 this.BundleTag = bundleTag;
1336 this.PerMachine = perMachine;
1337 this.Version = version;
1338 this.RecommendedIgnoreBundle = recommendedIgnoreBundle;
1339 this.IgnoreBundle = ignoreBundle;
1340 }
1341
1342 /// <summary>
1343 /// Gets the identity of the forward compatible bundle detected.
1344 /// </summary>
1345 public string BundleId { get; private set; }
1346
1347 /// <summary>
1348 /// Gets the relationship type of the forward compatible bundle.
1349 /// </summary>
1350 public RelationType RelationType { get; private set; }
1351
1352 /// <summary>
1353 /// Gets the tag of the forward compatible bundle.
1354 /// </summary>
1355 public string BundleTag { get; private set; }
1356
1357 /// <summary>
1358 /// Gets whether the forward compatible bundle is per machine.
1359 /// </summary>
1360 public bool PerMachine { get; private set; }
1361
1362 /// <summary>
1363 /// Gets the version of the forward compatible bundle.
1364 /// </summary>
1365 public string Version { get; private set; }
1366
1367 /// <summary>
1368 /// Gets the recommendation of whether the engine should use the forward compatible bundle.
1369 /// </summary>
1370 public bool RecommendedIgnoreBundle { get; set; }
1371
1372 /// <summary>
1373 /// Gets or sets whether the engine will use the forward compatible bundle.
1374 /// </summary>
1375 public bool IgnoreBundle { get; set; }
1376 }
1377
1378 /// <summary>
1379 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyBegin"/>
1380 /// </summary>
1381 [Serializable]
1382 public class ApplyBeginEventArgs : CancellableHResultEventArgs
1383 {
1384 /// <summary>
1385 /// This class is for events raised by the engine.
1386 /// It is not intended to be instantiated by user code.
1387 /// </summary>
1388 public ApplyBeginEventArgs(int phaseCount, bool cancelRecommendation)
1389 : base(cancelRecommendation)
1390 {
1391 this.PhaseCount = phaseCount;
1392 }
1393
1394 /// <summary>
1395 /// Gets the number of phases that the engine will go through in apply.
1396 /// There are currently two possible phases: cache and execute.
1397 /// </summary>
1398 public int PhaseCount { get; private set; }
1399 }
1400
1401 /// <summary>
1402 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ElevateBegin"/>
1403 /// </summary>
1404 [Serializable]
1405 public class ElevateBeginEventArgs : CancellableHResultEventArgs
1406 {
1407 /// <summary>
1408 /// This class is for events raised by the engine.
1409 /// It is not intended to be instantiated by user code.
1410 /// </summary>
1411 public ElevateBeginEventArgs(bool cancelRecommendation)
1412 : base(cancelRecommendation)
1413 {
1414 }
1415 }
1416
1417 /// <summary>
1418 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ElevateComplete"/>.
1419 /// </summary>
1420 [Serializable]
1421 public class ElevateCompleteEventArgs : StatusEventArgs
1422 {
1423 /// <summary>
1424 /// This class is for events raised by the engine.
1425 /// It is not intended to be instantiated by user code.
1426 /// </summary>
1427 public ElevateCompleteEventArgs(int hrStatus)
1428 : base(hrStatus)
1429 {
1430 }
1431 }
1432
1433 /// <summary>
1434 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Progress"/>
1435 /// </summary>
1436 [Serializable]
1437 public class ProgressEventArgs : CancellableHResultEventArgs
1438 {
1439 /// <summary>
1440 /// This class is for events raised by the engine.
1441 /// It is not intended to be instantiated by user code.
1442 /// </summary>
1443 public ProgressEventArgs(int progressPercentage, int overallPercentage, bool cancelRecommendation)
1444 : base(cancelRecommendation)
1445 {
1446 this.ProgressPercentage = progressPercentage;
1447 this.OverallPercentage = overallPercentage;
1448 }
1449
1450 /// <summary>
1451 /// Gets the percentage from 0 to 100 completed for a package.
1452 /// </summary>
1453 public int ProgressPercentage { get; private set; }
1454
1455 /// <summary>
1456 /// Gets the percentage from 0 to 100 completed for the bundle.
1457 /// </summary>
1458 public int OverallPercentage { get; private set; }
1459 }
1460
1461 /// <summary>
1462 /// Event arguments for <see cref="IDefaultBootstrapperApplication.Error"/>
1463 /// </summary>
1464 [Serializable]
1465 public class ErrorEventArgs : ResultEventArgs
1466 {
1467 /// <summary>
1468 /// This class is for events raised by the engine.
1469 /// It is not intended to be instantiated by user code.
1470 /// </summary>
1471 public ErrorEventArgs(ErrorType errorType, string packageId, int errorCode, string errorMessage, int dwUIHint, string[] data, Result recommendation, Result result)
1472 : base(recommendation, result)
1473 {
1474 this.ErrorType = errorType;
1475 this.PackageId = packageId;
1476 this.ErrorCode = errorCode;
1477 this.ErrorMessage = errorMessage;
1478 this.UIHint = dwUIHint;
1479 this.Data = new ReadOnlyCollection<string>(data ?? new string[] { });
1480 }
1481
1482 /// <summary>
1483 /// Gets the type of error that occurred.
1484 /// </summary>
1485 public ErrorType ErrorType { get; private set; }
1486
1487 /// <summary>
1488 /// Gets the identity of the package that yielded the error.
1489 /// </summary>
1490 public string PackageId { get; private set; }
1491
1492 /// <summary>
1493 /// Gets the error code.
1494 /// </summary>
1495 public int ErrorCode { get; private set; }
1496
1497 /// <summary>
1498 /// Gets the error message.
1499 /// </summary>
1500 public string ErrorMessage { get; private set; }
1501
1502 /// <summary>
1503 /// Gets the recommended display flags for an error dialog.
1504 /// </summary>
1505 public int UIHint { get; private set; }
1506
1507 /// <summary>
1508 /// Gets the extended data for the error.
1509 /// </summary>
1510 public IList<string> Data { get; private set; }
1511 }
1512
1513 /// <summary>
1514 /// Event arguments for <see cref="IDefaultBootstrapperApplication.RegisterBegin"/>
1515 /// </summary>
1516 [Serializable]
1517 public class RegisterBeginEventArgs : CancellableHResultEventArgs
1518 {
1519 /// <summary>
1520 /// This class is for events raised by the engine.
1521 /// It is not intended to be instantiated by user code.
1522 /// </summary>
1523 public RegisterBeginEventArgs(RegistrationType recommendedRegistrationType, bool cancelRecommendation, RegistrationType registrationType)
1524 : base(cancelRecommendation)
1525 {
1526 this.RecommendedRegistrationType = recommendedRegistrationType;
1527 this.RegistrationType = registrationType;
1528 }
1529
1530 /// <summary>
1531 /// Gets the recommended registration type.
1532 /// </summary>
1533 public RegistrationType RecommendedRegistrationType { get; private set; }
1534
1535 /// <summary>
1536 /// Gets or sets the registration type.
1537 /// </summary>
1538 public RegistrationType RegistrationType { get; set; }
1539 }
1540
1541 /// <summary>
1542 /// Event arguments for <see cref="IDefaultBootstrapperApplication.RegisterComplete"/>.
1543 /// </summary>
1544 [Serializable]
1545 public class RegisterCompleteEventArgs : StatusEventArgs
1546 {
1547 /// <summary>
1548 /// This class is for events raised by the engine.
1549 /// It is not intended to be instantiated by user code.
1550 /// </summary>
1551 public RegisterCompleteEventArgs(int hrStatus)
1552 : base(hrStatus)
1553 {
1554 }
1555 }
1556
1557 /// <summary>
1558 /// Event arguments for <see cref="IDefaultBootstrapperApplication.UnregisterBegin"/>
1559 /// </summary>
1560 [Serializable]
1561 public class UnregisterBeginEventArgs : HResultEventArgs
1562 {
1563 /// <summary>
1564 /// This class is for events raised by the engine.
1565 /// It is not intended to be instantiated by user code.
1566 /// </summary>
1567 public UnregisterBeginEventArgs(RegistrationType recommendedRegistrationType, RegistrationType registrationType)
1568 {
1569 this.RecommendedRegistrationType = recommendedRegistrationType;
1570 this.RegistrationType = registrationType;
1571 }
1572
1573 /// <summary>
1574 /// Gets the recommended registration type.
1575 /// </summary>
1576 public RegistrationType RecommendedRegistrationType { get; private set; }
1577
1578 /// <summary>
1579 /// Gets or sets the registration type.
1580 /// </summary>
1581 public RegistrationType RegistrationType { get; set; }
1582 }
1583
1584 /// <summary>
1585 /// Event arguments for <see cref="IDefaultBootstrapperApplication.UnregisterComplete"/>
1586 /// </summary>
1587 [Serializable]
1588 public class UnregisterCompleteEventArgs : StatusEventArgs
1589 {
1590 /// <summary>
1591 /// This class is for events raised by the engine.
1592 /// It is not intended to be instantiated by user code.
1593 /// </summary>
1594 public UnregisterCompleteEventArgs(int hrStatus)
1595 : base(hrStatus)
1596 {
1597 }
1598 }
1599
1600 /// <summary>
1601 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheBegin"/>
1602 /// </summary>
1603 [Serializable]
1604 public class CacheBeginEventArgs : CancellableHResultEventArgs
1605 {
1606 /// <summary>
1607 /// This class is for events raised by the engine.
1608 /// It is not intended to be instantiated by user code.
1609 /// </summary>
1610 public CacheBeginEventArgs(bool cancelRecommendation)
1611 : base(cancelRecommendation)
1612 {
1613 }
1614 }
1615
1616 /// <summary>
1617 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireBegin"/>.
1618 /// </summary>
1619 [Serializable]
1620 public class CacheAcquireBeginEventArgs : CancellableActionEventArgs<CacheOperation>
1621 {
1622 /// <summary>
1623 /// This class is for events raised by the engine.
1624 /// It is not intended to be instantiated by user code.
1625 /// </summary>
1626 public CacheAcquireBeginEventArgs(string packageOrContainerId, string payloadId, string source, string downloadUrl, string payloadContainerId, CacheOperation recommendation, CacheOperation action, bool cancelRecommendation)
1627 : base(cancelRecommendation, recommendation, action)
1628 {
1629 this.PackageOrContainerId = packageOrContainerId;
1630 this.PayloadId = payloadId;
1631 this.Source = source;
1632 this.DownloadUrl = downloadUrl;
1633 this.PayloadContainerId = payloadContainerId;
1634 }
1635
1636 /// <summary>
1637 /// Gets the identifier of the container or package.
1638 /// </summary>
1639 public string PackageOrContainerId { get; private set; }
1640
1641 /// <summary>
1642 /// Gets the identifier of the payload (if acquiring a payload).
1643 /// </summary>
1644 public string PayloadId { get; private set; }
1645
1646 /// <summary>
1647 /// Gets the source of the container or payload.
1648 /// </summary>
1649 public string Source { get; private set; }
1650
1651 /// <summary>
1652 /// Gets the optional URL to download container or payload.
1653 /// </summary>
1654 public string DownloadUrl { get; private set; }
1655
1656 /// <summary>
1657 /// Gets the optional identity of the container that contains the payload being acquired.
1658 /// </summary>
1659 public string PayloadContainerId { get; private set; }
1660 }
1661
1662 /// <summary>
1663 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireProgress"/>.
1664 /// </summary>
1665 [Serializable]
1666 public class CacheAcquireProgressEventArgs : CacheProgressBaseEventArgs
1667 {
1668 /// <summary>
1669 /// This class is for events raised by the engine.
1670 /// It is not intended to be instantiated by user code.
1671 /// </summary>
1672 public CacheAcquireProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
1673 : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
1674 {
1675 }
1676 }
1677
1678 /// <summary>
1679 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>.
1680 /// </summary>
1681 [Serializable]
1682 public class CacheAcquireCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION>
1683 {
1684 /// <summary>
1685 /// This class is for events raised by the engine.
1686 /// It is not intended to be instantiated by user code.
1687 /// </summary>
1688 public CacheAcquireCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION action)
1689 : base(hrStatus, recommendation, action)
1690 {
1691 this.PackageOrContainerId = packageOrContainerId;
1692 this.PayloadId = payloadId;
1693 }
1694
1695 /// <summary>
1696 /// Gets the identifier of the container or package.
1697 /// </summary>
1698 public string PackageOrContainerId { get; private set; }
1699
1700 /// <summary>
1701 /// Gets the identifier of the payload (if acquiring a payload).
1702 /// </summary>
1703 public string PayloadId { get; private set; }
1704 }
1705
1706 /// <summary>
1707 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheVerifyBegin"/>.
1708 /// </summary>
1709 [Serializable]
1710 public class CacheVerifyBeginEventArgs : CancellableHResultEventArgs
1711 {
1712 /// <summary>
1713 /// This class is for events raised by the engine.
1714 /// It is not intended to be instantiated by user code.
1715 /// </summary>
1716 public CacheVerifyBeginEventArgs(string packageOrContainerId, string payloadId, bool cancelRecommendation)
1717 : base(cancelRecommendation)
1718 {
1719 this.PackageOrContainerId = packageOrContainerId;
1720 this.PayloadId = payloadId;
1721 }
1722
1723 /// <summary>
1724 /// Gets the identifier of the container or package.
1725 /// </summary>
1726 public string PackageOrContainerId { get; private set; }
1727
1728 /// <summary>
1729 /// Gets the identifier of the payload.
1730 /// </summary>
1731 public string PayloadId { get; private set; }
1732 }
1733
1734 /// <summary>
1735 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheVerifyProgress"/>.
1736 /// </summary>
1737 [Serializable]
1738 public class CacheVerifyProgressEventArgs : CacheProgressBaseEventArgs
1739 {
1740 /// <summary>
1741 /// This class is for events raised by the engine.
1742 /// It is not intended to be instantiated by user code.
1743 /// </summary>
1744 public CacheVerifyProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, CacheVerifyStep verifyStep, bool cancelRecommendation)
1745 : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
1746 {
1747 this.Step = verifyStep;
1748 }
1749
1750 /// <summary>
1751 /// Gets the current verification step.
1752 /// </summary>
1753 public CacheVerifyStep Step { get; private set; }
1754 }
1755
1756 /// <summary>
1757 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheVerifyComplete"/>
1758 /// </summary>
1759 [Serializable]
1760 public class CacheVerifyCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION>
1761 {
1762 /// <summary>
1763 /// This class is for events raised by the engine.
1764 /// It is not intended to be instantiated by user code.
1765 /// </summary>
1766 public CacheVerifyCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action)
1767 : base(hrStatus, recommendation, action)
1768 {
1769 this.PackageOrContainerId = packageOrContainerId;
1770 this.PayloadId = payloadId;
1771 }
1772
1773 /// <summary>
1774 /// Gets the identifier of the container or package.
1775 /// </summary>
1776 public string PackageOrContainerId { get; private set; }
1777
1778 /// <summary>
1779 /// Gets the identifier of the payload.
1780 /// </summary>
1781 public string PayloadId { get; private set; }
1782 }
1783
1784 /// <summary>
1785 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheComplete"/>.
1786 /// </summary>
1787 [Serializable]
1788 public class CacheCompleteEventArgs : StatusEventArgs
1789 {
1790 /// <summary>
1791 /// This class is for events raised by the engine.
1792 /// It is not intended to be instantiated by user code.
1793 /// </summary>
1794 public CacheCompleteEventArgs(int hrStatus)
1795 : base(hrStatus)
1796 {
1797 }
1798 }
1799
1800 /// <summary>
1801 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteBegin"/>
1802 /// </summary>
1803 [Serializable]
1804 public class ExecuteBeginEventArgs : CancellableHResultEventArgs
1805 {
1806 /// <summary>
1807 /// This class is for events raised by the engine.
1808 /// It is not intended to be instantiated by user code.
1809 /// </summary>
1810 public ExecuteBeginEventArgs(int packageCount, bool cancelRecommendation)
1811 : base(cancelRecommendation)
1812 {
1813 this.PackageCount = packageCount;
1814 }
1815
1816 /// <summary>
1817 /// Gets the number of packages to act on.
1818 /// </summary>
1819 public int PackageCount { get; private set; }
1820 }
1821
1822 /// <summary>
1823 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePackageBegin"/>
1824 /// </summary>
1825 [Serializable]
1826 public class ExecutePackageBeginEventArgs : CancellableHResultEventArgs
1827 {
1828 /// <summary>
1829 /// This class is for events raised by the engine.
1830 /// It is not intended to be instantiated by user code.
1831 /// </summary>
1832 public ExecutePackageBeginEventArgs(string packageId, bool shouldExecute, ActionState action, INSTALLUILEVEL uiLevel, bool disableExternalUiHandler, bool cancelRecommendation)
1833 : base(cancelRecommendation)
1834 {
1835 this.PackageId = packageId;
1836 this.ShouldExecute = shouldExecute;
1837 this.Action = action;
1838 this.UiLevel = uiLevel;
1839 this.DisableExternalUiHandler = disableExternalUiHandler;
1840 }
1841
1842 /// <summary>
1843 /// Gets the identity of the package to act on.
1844 /// </summary>
1845 public string PackageId { get; private set; }
1846
1847 /// <summary>
1848 /// Gets whether the package is being executed or rolled back.
1849 /// </summary>
1850 public bool ShouldExecute { get; private set; }
1851
1852 /// <summary>
1853 /// Gets the action about to be executed.
1854 /// </summary>
1855 public ActionState Action { get; private set; }
1856
1857 /// <summary>
1858 /// Gets the internal UI level (if this is an MSI or MSP package).
1859 /// </summary>
1860 public INSTALLUILEVEL UiLevel { get; private set; }
1861
1862 /// <summary>
1863 /// Gets whether Burn will set up an external UI handler (if this is an MSI or MSP package).
1864 /// </summary>
1865 public bool DisableExternalUiHandler { get; private set; }
1866 }
1867
1868 /// <summary>
1869 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePatchTarget"/>
1870 /// </summary>
1871 [Serializable]
1872 public class ExecutePatchTargetEventArgs : CancellableHResultEventArgs
1873 {
1874 /// <summary>
1875 /// This class is for events raised by the engine.
1876 /// It is not intended to be instantiated by user code.
1877 /// </summary>
1878 public ExecutePatchTargetEventArgs(string packageId, string targetProductCode, bool cancelRecommendation)
1879 : base(cancelRecommendation)
1880 {
1881 this.PackageId = packageId;
1882 this.TargetProductCode = targetProductCode;
1883 }
1884
1885 /// <summary>
1886 /// Gets the identity of the package to act on.
1887 /// </summary>
1888 public string PackageId { get; private set; }
1889
1890 /// <summary>
1891 /// Gets the product code being targeted.
1892 /// </summary>
1893 public string TargetProductCode { get; private set; }
1894 }
1895
1896 /// <summary>
1897 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteMsiMessage"/>
1898 /// </summary>
1899 [Serializable]
1900 public class ExecuteMsiMessageEventArgs : ResultEventArgs
1901 {
1902 /// <summary>
1903 /// This class is for events raised by the engine.
1904 /// It is not intended to be instantiated by user code.
1905 /// </summary>
1906 public ExecuteMsiMessageEventArgs(string packageId, InstallMessage messageType, int dwUIHint, string message, string[] data, Result recommendation, Result result)
1907 : base(recommendation, result)
1908 {
1909 this.PackageId = packageId;
1910 this.MessageType = messageType;
1911 this.UIHint = dwUIHint;
1912 this.Message = message;
1913 this.Data = new ReadOnlyCollection<string>(data ?? new string[] { });
1914 }
1915
1916 /// <summary>
1917 /// Gets the identity of the package that yielded this message.
1918 /// </summary>
1919 public string PackageId { get; private set; }
1920
1921 /// <summary>
1922 /// Gets the type of this message.
1923 /// </summary>
1924 public InstallMessage MessageType { get; private set; }
1925
1926 /// <summary>
1927 /// Gets the recommended display flags for this message.
1928 /// </summary>
1929 public int UIHint { get; private set; }
1930
1931 /// <summary>
1932 /// Gets the message.
1933 /// </summary>
1934 public string Message { get; private set; }
1935
1936 /// <summary>
1937 /// Gets the extended data for the message.
1938 /// </summary>
1939 public IList<string> Data { get; private set; }
1940 }
1941
1942 /// <summary>
1943 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteFilesInUse"/>
1944 /// </summary>
1945 [Serializable]
1946 public class ExecuteFilesInUseEventArgs : ResultEventArgs
1947 {
1948 /// <summary>
1949 /// This class is for events raised by the engine.
1950 /// It is not intended to be instantiated by user code.
1951 /// </summary>
1952 public ExecuteFilesInUseEventArgs(string packageId, string[] files, Result recommendation, FilesInUseType source, Result result)
1953 : base(recommendation, result)
1954 {
1955 this.PackageId = packageId;
1956 this.Files = new ReadOnlyCollection<string>(files ?? new string[] { });
1957 this.Source = source;
1958 }
1959
1960 /// <summary>
1961 /// Gets the identity of the package that yielded the files in use message.
1962 /// </summary>
1963 public string PackageId { get; private set; }
1964
1965 /// <summary>
1966 /// Gets the list of files in use.
1967 /// </summary>
1968 public IList<string> Files { get; private set; }
1969
1970 /// <summary>
1971 /// Gets the source of the message.
1972 /// </summary>
1973 public FilesInUseType Source { get; private set; }
1974 }
1975
1976 /// <summary>
1977 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>
1978 /// </summary>
1979 [Serializable]
1980 public class ExecutePackageCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION>
1981 {
1982 /// <summary>
1983 /// This class is for events raised by the engine.
1984 /// It is not intended to be instantiated by user code.
1985 /// </summary>
1986 public ExecutePackageCompleteEventArgs(string packageId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation, BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION action)
1987 : base(hrStatus, recommendation, action)
1988 {
1989 this.PackageId = packageId;
1990 this.Restart = restart;
1991 }
1992
1993 /// <summary>
1994 /// Gets the identity of the package that was acted on.
1995 /// </summary>
1996 public string PackageId { get; private set; }
1997
1998 /// <summary>
1999 /// Gets the package restart state after being applied.
2000 /// </summary>
2001 public ApplyRestart Restart { get; private set; }
2002 }
2003
2004 /// <summary>
2005 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteComplete"/>.
2006 /// </summary>
2007 [Serializable]
2008 public class ExecuteCompleteEventArgs : StatusEventArgs
2009 {
2010 /// <summary>
2011 /// This class is for events raised by the engine.
2012 /// It is not intended to be instantiated by user code.
2013 /// </summary>
2014 public ExecuteCompleteEventArgs(int hrStatus)
2015 : base(hrStatus)
2016 {
2017 }
2018 }
2019
2020 /// <summary>
2021 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyComplete"/>
2022 /// </summary>
2023 [Serializable]
2024 public class ApplyCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_APPLYCOMPLETE_ACTION>
2025 {
2026 /// <summary>
2027 /// This class is for events raised by the engine.
2028 /// It is not intended to be instantiated by user code.
2029 /// </summary>
2030 public ApplyCompleteEventArgs(int hrStatus, ApplyRestart restart, BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation, BOOTSTRAPPER_APPLYCOMPLETE_ACTION action)
2031 : base(hrStatus, recommendation, action)
2032 {
2033 this.Restart = restart;
2034 }
2035
2036 /// <summary>
2037 /// Gets the apply restart state when complete.
2038 /// </summary>
2039 public ApplyRestart Restart { get; private set; }
2040 }
2041
2042 /// <summary>
2043 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ApplyDowngrade"/>
2044 /// </summary>
2045 [Serializable]
2046 public class ApplyDowngradeEventArgs : HResultEventArgs
2047 {
2048 /// <summary>
2049 /// This class is for events raised by the engine.
2050 /// It is not intended to be instantiated by user code.
2051 /// </summary>
2052 public ApplyDowngradeEventArgs(int hrRecommendation, int hrStatus)
2053 {
2054 this.Recommendation = hrRecommendation;
2055 this.Status = hrStatus;
2056 }
2057
2058 /// <summary>
2059 /// Gets the recommended HRESULT.
2060 /// </summary>
2061 public int Recommendation { get; private set; }
2062
2063 /// <summary>
2064 /// Gets or sets the HRESULT for Apply.
2065 /// </summary>
2066 public int Status { get; set; }
2067 }
2068
2069 /// <summary>
2070 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>.
2071 /// </summary>
2072 [Serializable]
2073 public class CacheAcquireResolvingEventArgs : CancellableActionEventArgs<CacheResolveOperation>
2074 {
2075 /// <summary>
2076 /// This class is for events raised by the engine.
2077 /// It is not intended to be instantiated by user code.
2078 /// </summary>
2079 public CacheAcquireResolvingEventArgs(string packageOrContainerId, string payloadId, string[] searchPaths, bool foundLocal, int recommendedSearchPath, string downloadUrl, string payloadContainerId, CacheResolveOperation recommendation, int chosenSearchPath, CacheResolveOperation action, bool cancel)
2080 : base(cancel, recommendation, action)
2081 {
2082 this.PackageOrContainerId = packageOrContainerId;
2083 this.PayloadId = payloadId;
2084 this.SearchPaths = searchPaths;
2085 this.FoundLocal = foundLocal;
2086 this.RecommendedSearchPath = recommendedSearchPath;
2087 this.DownloadUrl = downloadUrl;
2088 this.PayloadContainerId = payloadContainerId;
2089 this.ChosenSearchPath = chosenSearchPath;
2090 }
2091
2092 /// <summary>
2093 /// Gets the identity of the package or container that is being acquired.
2094 /// </summary>
2095 public string PackageOrContainerId { get; private set; }
2096
2097 /// <summary>
2098 /// Gets the identity of the payload that is being acquired.
2099 /// </summary>
2100 public string PayloadId { get; private set; }
2101
2102 /// <summary>
2103 /// Gets the search paths used for source resolution.
2104 /// </summary>
2105 public string[] SearchPaths { get; private set; }
2106
2107 /// <summary>
2108 /// Gets whether <see cref="RecommendedSearchPath"/> indicates that a file was found at that search path.
2109 /// </summary>
2110 public bool FoundLocal { get; private set; }
2111
2112 /// <summary>
2113 /// When <see cref="FoundLocal"/> is true, the index to <see cref="SearchPaths"/> for the recommended local file.
2114 /// </summary>
2115 public int RecommendedSearchPath { get; private set; }
2116
2117 /// <summary>
2118 /// Gets the optional URL to download container or payload.
2119 /// </summary>
2120 public string DownloadUrl { get; private set; }
2121
2122 /// <summary>
2123 /// Gets the optional identity of the container that contains the payload being acquired.
2124 /// </summary>
2125 public string PayloadContainerId { get; private set; }
2126
2127 /// <summary>
2128 /// Gets or sets the index to <see cref="SearchPaths"/> to use when <see cref="CancellableActionEventArgs{T}.Action"/> is set to <see cref="CacheOperation.Copy"/>.
2129 /// </summary>
2130 public int ChosenSearchPath { get; set; }
2131 }
2132
2133 /// <summary>
2134 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePackageBegin"/>
2135 /// </summary>
2136 [Serializable]
2137 public class CachePackageBeginEventArgs : CancellableHResultEventArgs
2138 {
2139 /// <summary>
2140 /// This class is for events raised by the engine.
2141 /// It is not intended to be instantiated by user code.
2142 /// </summary>
2143 public CachePackageBeginEventArgs(string packageId, int cachePayloads, long packageCacheSize, bool vital, bool cancelRecommendation)
2144 : base(cancelRecommendation)
2145 {
2146 this.PackageId = packageId;
2147 this.CachePayloads = cachePayloads;
2148 this.PackageCacheSize = packageCacheSize;
2149 this.Vital = vital;
2150 }
2151
2152 /// <summary>
2153 /// Gets the identity of the package that is being cached.
2154 /// </summary>
2155 public string PackageId { get; private set; }
2156
2157 /// <summary>
2158 /// Gets number of payloads to be cached.
2159 /// </summary>
2160 public long CachePayloads { get; private set; }
2161
2162 /// <summary>
2163 /// Gets the size on disk required by the specific package.
2164 /// </summary>
2165 public long PackageCacheSize { get; private set; }
2166
2167 /// <summary>
2168 /// If caching a package is not vital, then acquisition will be skipped unless the BA opts in through <see cref="IDefaultBootstrapperApplication.CachePackageNonVitalValidationFailure"/>.
2169 /// </summary>
2170 public bool Vital { get; private set; }
2171 }
2172
2173 /// <summary>
2174 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePackageComplete"/>
2175 /// </summary>
2176 [Serializable]
2177 public class CachePackageCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION>
2178 {
2179 /// <summary>
2180 /// This class is for events raised by the engine.
2181 /// It is not intended to be instantiated by user code.
2182 /// </summary>
2183 public CachePackageCompleteEventArgs(string packageId, int hrStatus, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation, BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action)
2184 : base(hrStatus, recommendation, action)
2185 {
2186 this.PackageId = packageId;
2187 }
2188
2189 /// <summary>
2190 /// Gets the identity of the package that was cached.
2191 /// </summary>
2192 public string PackageId { get; private set; }
2193 }
2194
2195 /// <summary>
2196 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteProgress"/>
2197 /// </summary>
2198 [Serializable]
2199 public class ExecuteProgressEventArgs : CancellableHResultEventArgs
2200 {
2201 /// <summary>
2202 /// This class is for events raised by the engine.
2203 /// It is not intended to be instantiated by user code.
2204 /// </summary>
2205 public ExecuteProgressEventArgs(string packageId, int progressPercentage, int overallPercentage, bool cancelRecommendation)
2206 : base(cancelRecommendation)
2207 {
2208 this.PackageId = packageId;
2209 this.ProgressPercentage = progressPercentage;
2210 this.OverallPercentage = overallPercentage;
2211 }
2212
2213 /// <summary>
2214 /// Gets the identity of the package that was executed.
2215 /// </summary>
2216 public string PackageId { get; private set; }
2217
2218 /// <summary>
2219 /// Gets the percentage from 0 to 100 of the execution progress for a single payload.
2220 /// </summary>
2221 public int ProgressPercentage { get; private set; }
2222
2223 /// <summary>
2224 /// Gets the percentage from 0 to 100 of the execution progress for all payloads.
2225 /// </summary>
2226 public int OverallPercentage { get; private set; }
2227 }
2228
2229 /// <summary>
2230 /// Event arguments for <see cref="IDefaultBootstrapperApplication.LaunchApprovedExeBegin"/>.
2231 /// </summary>
2232 [Serializable]
2233 public class LaunchApprovedExeBeginEventArgs : CancellableHResultEventArgs
2234 {
2235 /// <summary>
2236 /// This class is for events raised by the engine.
2237 /// It is not intended to be instantiated by user code.
2238 /// </summary>
2239 public LaunchApprovedExeBeginEventArgs(bool cancelRecommendation)
2240 : base(cancelRecommendation)
2241 {
2242 }
2243 }
2244
2245 /// <summary>
2246 /// Event arguments for <see cref="IDefaultBootstrapperApplication.LaunchApprovedExeComplete"/>.
2247 /// </summary>
2248 [Serializable]
2249 public class LaunchApprovedExeCompleteEventArgs : StatusEventArgs
2250 {
2251 /// <summary>
2252 /// This class is for events raised by the engine.
2253 /// It is not intended to be instantiated by user code.
2254 /// </summary>
2255 public LaunchApprovedExeCompleteEventArgs(int hrStatus, int processId)
2256 : base(hrStatus)
2257 {
2258 this.ProcessId = processId;
2259 }
2260
2261 /// <summary>
2262 /// Gets the ProcessId of the process that was launched.
2263 /// This is only valid if the status reports success.
2264 /// </summary>
2265 public int ProcessId { get; private set; }
2266 }
2267
2268 /// <summary>
2269 /// Event arguments for <see cref="IDefaultBootstrapperApplication.BeginMsiTransactionBegin"/>.
2270 /// </summary>
2271 [Serializable]
2272 public class BeginMsiTransactionBeginEventArgs : CancellableHResultEventArgs
2273 {
2274 /// <summary>
2275 /// This class is for events raised by the engine.
2276 /// It is not intended to be instantiated by user code.
2277 /// </summary>
2278 public BeginMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation)
2279 : base(cancelRecommendation)
2280 {
2281 this.TransactionId = transactionId;
2282 }
2283
2284 /// <summary>
2285 /// Gets the MSI transaction Id.
2286 /// </summary>
2287 public string TransactionId { get; private set; }
2288 }
2289
2290 /// <summary>
2291 /// Event arguments for <see cref="IDefaultBootstrapperApplication.BeginMsiTransactionComplete"/>.
2292 /// </summary>
2293 [Serializable]
2294 public class BeginMsiTransactionCompleteEventArgs : StatusEventArgs
2295 {
2296 /// <summary>
2297 /// This class is for events raised by the engine.
2298 /// It is not intended to be instantiated by user code.
2299 /// </summary>
2300 public BeginMsiTransactionCompleteEventArgs(string transactionId, int hrStatus)
2301 : base(hrStatus)
2302 {
2303 this.TransactionId = transactionId;
2304 }
2305
2306 /// <summary>
2307 /// Gets the MSI transaction Id.
2308 /// </summary>
2309 public string TransactionId { get; private set; }
2310 }
2311
2312 /// <summary>
2313 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionBegin"/>.
2314 /// </summary>
2315 [Serializable]
2316 public class CommitMsiTransactionBeginEventArgs : CancellableHResultEventArgs
2317 {
2318 /// <summary>
2319 /// This class is for events raised by the engine.
2320 /// It is not intended to be instantiated by user code.
2321 /// </summary>
2322 public CommitMsiTransactionBeginEventArgs(string transactionId, bool cancelRecommendation)
2323 : base(cancelRecommendation)
2324 {
2325 this.TransactionId = transactionId;
2326 }
2327
2328 /// <summary>
2329 /// Gets the MSI transaction Id.
2330 /// </summary>
2331 public string TransactionId { get; private set; }
2332 }
2333
2334 /// <summary>
2335 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionComplete"/>.
2336 /// </summary>
2337 [Serializable]
2338 public class CommitMsiTransactionCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION>
2339 {
2340 /// <summary>
2341 /// This class is for events raised by the engine.
2342 /// It is not intended to be instantiated by user code.
2343 /// </summary>
2344 public CommitMsiTransactionCompleteEventArgs(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action)
2345 : base(hrStatus, recommendation, action)
2346 {
2347 this.TransactionId = transactionId;
2348 this.Restart = restart;
2349 }
2350
2351 /// <summary>
2352 /// Gets the MSI transaction Id.
2353 /// </summary>
2354 public string TransactionId { get; private set; }
2355
2356 /// <summary>
2357 /// Gets the package restart state after being applied.
2358 /// </summary>
2359 public ApplyRestart Restart { get; private set; }
2360 }
2361
2362 /// <summary>
2363 /// Event arguments for <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionBegin"/>.
2364 /// </summary>
2365 [Serializable]
2366 public class RollbackMsiTransactionBeginEventArgs : HResultEventArgs
2367 {
2368 /// <summary>
2369 /// This class is for events raised by the engine.
2370 /// It is not intended to be instantiated by user code.
2371 /// </summary>
2372 public RollbackMsiTransactionBeginEventArgs(string transactionId)
2373 {
2374 this.TransactionId = transactionId;
2375 }
2376
2377 /// <summary>
2378 /// Gets the MSI transaction Id.
2379 /// </summary>
2380 public string TransactionId { get; private set; }
2381 }
2382
2383 /// <summary>
2384 /// Event arguments for <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionComplete"/>.
2385 /// </summary>
2386 [Serializable]
2387 public class RollbackMsiTransactionCompleteEventArgs : ActionEventArgs<BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION>
2388 {
2389 /// <summary>
2390 /// This class is for events raised by the engine.
2391 /// It is not intended to be instantiated by user code.
2392 /// </summary>
2393 public RollbackMsiTransactionCompleteEventArgs(string transactionId, int hrStatus, ApplyRestart restart, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation, BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION action)
2394 : base(hrStatus, recommendation, action)
2395 {
2396 this.TransactionId = transactionId;
2397 this.Restart = restart;
2398 }
2399
2400 /// <summary>
2401 /// Gets the MSI transaction Id.
2402 /// </summary>
2403 public string TransactionId { get; private set; }
2404
2405 /// <summary>
2406 /// Gets the package restart state after being applied.
2407 /// </summary>
2408 public ApplyRestart Restart { get; private set; }
2409 }
2410
2411 /// <summary>
2412 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PauseAutomaticUpdatesBegin"/>.
2413 /// </summary>
2414 [Serializable]
2415 public class PauseAutomaticUpdatesBeginEventArgs : HResultEventArgs
2416 {
2417 /// <summary>
2418 /// This class is for events raised by the engine.
2419 /// It is not intended to be instantiated by user code.
2420 /// </summary>
2421 public PauseAutomaticUpdatesBeginEventArgs()
2422 {
2423 }
2424 }
2425
2426 /// <summary>
2427 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PauseAutomaticUpdatesComplete"/>.
2428 /// </summary>
2429 [Serializable]
2430 public class PauseAutomaticUpdatesCompleteEventArgs : StatusEventArgs
2431 {
2432 /// <summary>
2433 /// This class is for events raised by the engine.
2434 /// It is not intended to be instantiated by user code.
2435 /// </summary>
2436 public PauseAutomaticUpdatesCompleteEventArgs(int hrStatus)
2437 : base(hrStatus)
2438 {
2439 }
2440 }
2441
2442 /// <summary>
2443 /// Event arguments for <see cref="IDefaultBootstrapperApplication.SystemRestorePointBegin"/>.
2444 /// </summary>
2445 [Serializable]
2446 public class SystemRestorePointBeginEventArgs : HResultEventArgs
2447 {
2448 /// <summary>
2449 /// This class is for events raised by the engine.
2450 /// It is not intended to be instantiated by user code.
2451 /// </summary>
2452 public SystemRestorePointBeginEventArgs()
2453 {
2454 }
2455 }
2456
2457 /// <summary>
2458 /// Event arguments for <see cref="IDefaultBootstrapperApplication.SystemRestorePointComplete"/>.
2459 /// </summary>
2460 [Serializable]
2461 public class SystemRestorePointCompleteEventArgs : StatusEventArgs
2462 {
2463 /// <summary>
2464 /// This class is for events raised by the engine.
2465 /// It is not intended to be instantiated by user code.
2466 /// </summary>
2467 public SystemRestorePointCompleteEventArgs(int hrStatus)
2468 : base(hrStatus)
2469 {
2470 }
2471 }
2472
2473 /// <summary>
2474 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyBegin"/>.
2475 /// </summary>
2476 [Serializable]
2477 public class CacheContainerOrPayloadVerifyBeginEventArgs : CancellableHResultEventArgs
2478 {
2479 /// <summary>
2480 /// This class is for events raised by the engine.
2481 /// It is not intended to be instantiated by user code.
2482 /// </summary>
2483 public CacheContainerOrPayloadVerifyBeginEventArgs(string packageOrContainerId, string payloadId, bool cancelRecommendation)
2484 : base(cancelRecommendation)
2485 {
2486 this.PackageOrContainerId = packageOrContainerId;
2487 this.PayloadId = payloadId;
2488 }
2489
2490 /// <summary>
2491 /// Gets the identifier of the container or package.
2492 /// </summary>
2493 public string PackageOrContainerId { get; private set; }
2494
2495 /// <summary>
2496 /// Gets the identifier of the payload.
2497 /// </summary>
2498 public string PayloadId { get; private set; }
2499 }
2500
2501 /// <summary>
2502 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyProgress"/>.
2503 /// </summary>
2504 [Serializable]
2505 public class CacheContainerOrPayloadVerifyProgressEventArgs : CacheProgressBaseEventArgs
2506 {
2507 /// <summary>
2508 /// This class is for events raised by the engine.
2509 /// It is not intended to be instantiated by user code.
2510 /// </summary>
2511 public CacheContainerOrPayloadVerifyProgressEventArgs(string packageOrContainerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
2512 : base(packageOrContainerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
2513 {
2514 }
2515 }
2516
2517 /// <summary>
2518 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyComplete"/>
2519 /// </summary>
2520 [Serializable]
2521 public class CacheContainerOrPayloadVerifyCompleteEventArgs : StatusEventArgs
2522 {
2523 /// <summary>
2524 /// This class is for events raised by the engine.
2525 /// It is not intended to be instantiated by user code.
2526 /// </summary>
2527 public CacheContainerOrPayloadVerifyCompleteEventArgs(string packageOrContainerId, string payloadId, int hrStatus)
2528 : base(hrStatus)
2529 {
2530 this.PackageOrContainerId = packageOrContainerId;
2531 this.PayloadId = payloadId;
2532 }
2533
2534 /// <summary>
2535 /// Gets the identifier of the container or package.
2536 /// </summary>
2537 public string PackageOrContainerId { get; private set; }
2538
2539 /// <summary>
2540 /// Gets the identifier of the payload.
2541 /// </summary>
2542 public string PayloadId { get; private set; }
2543 }
2544
2545 /// <summary>
2546 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractBegin"/>.
2547 /// </summary>
2548 [Serializable]
2549 public class CachePayloadExtractBeginEventArgs : CancellableHResultEventArgs
2550 {
2551 /// <summary>
2552 /// This class is for events raised by the engine.
2553 /// It is not intended to be instantiated by user code.
2554 /// </summary>
2555 public CachePayloadExtractBeginEventArgs(string containerId, string payloadId, bool cancelRecommendation)
2556 : base(cancelRecommendation)
2557 {
2558 this.ContainerId = containerId;
2559 this.PayloadId = payloadId;
2560 }
2561
2562 /// <summary>
2563 /// Gets the identifier of the container.
2564 /// </summary>
2565 public string ContainerId { get; private set; }
2566
2567 /// <summary>
2568 /// Gets the identifier of the payload.
2569 /// </summary>
2570 public string PayloadId { get; private set; }
2571 }
2572
2573 /// <summary>
2574 /// EventArgs for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractProgress"/>.
2575 /// </summary>
2576 [Serializable]
2577 public class CachePayloadExtractProgressEventArgs : CacheProgressBaseEventArgs
2578 {
2579 /// <summary>
2580 /// This class is for events raised by the engine.
2581 /// It is not intended to be instantiated by user code.
2582 /// </summary>
2583 public CachePayloadExtractProgressEventArgs(string containerId, string payloadId, long progress, long total, int overallPercentage, bool cancelRecommendation)
2584 : base(containerId, payloadId, progress, total, overallPercentage, cancelRecommendation)
2585 {
2586 }
2587 }
2588
2589 /// <summary>
2590 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePayloadExtractComplete"/>
2591 /// </summary>
2592 [Serializable]
2593 public class CachePayloadExtractCompleteEventArgs : StatusEventArgs
2594 {
2595 /// <summary>
2596 /// This class is for events raised by the engine.
2597 /// It is not intended to be instantiated by user code.
2598 /// </summary>
2599 public CachePayloadExtractCompleteEventArgs(string containerId, string payloadId, int hrStatus)
2600 : base(hrStatus)
2601 {
2602 this.ContainerId = containerId;
2603 this.PayloadId = payloadId;
2604 }
2605
2606 /// <summary>
2607 /// Gets the identifier of the container.
2608 /// </summary>
2609 public string ContainerId { get; private set; }
2610
2611 /// <summary>
2612 /// Gets the identifier of the payload.
2613 /// </summary>
2614 public string PayloadId { get; private set; }
2615 }
2616
2617 /// <summary>
2618 /// Event arguments for <see cref="IDefaultBootstrapperApplication.PlanRestoreRelatedBundle"/>
2619 /// </summary>
2620 [Serializable]
2621 public class PlanRestoreRelatedBundleEventArgs : CancellableHResultEventArgs
2622 {
2623 /// <summary>
2624 /// This class is for events raised by the engine.
2625 /// It is not intended to be instantiated by user code.
2626 /// </summary>
2627 public PlanRestoreRelatedBundleEventArgs(string bundleId, RequestState recommendedState, RequestState state, bool cancelRecommendation)
2628 : base(cancelRecommendation)
2629 {
2630 this.BundleId = bundleId;
2631 this.RecommendedState = recommendedState;
2632 this.State = state;
2633 }
2634
2635 /// <summary>
2636 /// Gets the identity of the bundle to plan for.
2637 /// </summary>
2638 public string BundleId { get; private set; }
2639
2640 /// <summary>
2641 /// Gets the recommended requested state for the bundle.
2642 /// </summary>
2643 public RequestState RecommendedState { get; private set; }
2644
2645 /// <summary>
2646 /// Gets or sets the requested state for the bundle.
2647 /// </summary>
2648 public RequestState State { get; set; }
2649 }
2650
2651 /// <summary>
2652 /// Event arguments for <see cref="IDefaultBootstrapperApplication.ExecuteProcessCancel"/>
2653 /// </summary>
2654 [Serializable]
2655 public class ExecuteProcessCancelEventArgs : HResultEventArgs
2656 {
2657 /// <summary>
2658 /// This class is for events raised by the engine.
2659 /// It is not intended to be instantiated by user code.
2660 /// </summary>
2661 public ExecuteProcessCancelEventArgs(string packageId, int processId, BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION recommendation, BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION action)
2662 {
2663 this.PackageId = packageId;
2664 this.ProcessId = processId;
2665 this.Recommendation = recommendation;
2666 this.Action = action;
2667 }
2668
2669 /// <summary>
2670 /// Gets the identity of the package.
2671 /// </summary>
2672 public string PackageId { get; private set; }
2673
2674 /// <summary>
2675 /// Gets the process id.
2676 /// </summary>
2677 public int ProcessId { get; private set; }
2678
2679 /// <summary>
2680 /// Gets the recommended action from the engine.
2681 /// </summary>
2682 public BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION Recommendation { get; private set; }
2683
2684 /// <summary>
2685 /// Gets or sets the action to be performed. This is passed back to the engine.
2686 /// </summary>
2687 public BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION Action { get; set; }
2688 }
2689
2690 /// <summary>
2691 /// Event arguments for <see cref="IDefaultBootstrapperApplication.DetectRelatedBundlePackage"/>
2692 /// </summary>
2693 [Serializable]
2694 public class DetectRelatedBundlePackageEventArgs : CancellableHResultEventArgs
2695 {
2696 /// <summary>
2697 /// This class is for events raised by the engine.
2698 /// It is not intended to be instantiated by user code.
2699 /// </summary>
2700 public DetectRelatedBundlePackageEventArgs(string packageId, string productCode, RelationType relationType, bool perMachine, string version, bool cancelRecommendation)
2701 : base(cancelRecommendation)
2702 {
2703 this.PackageId = packageId;
2704 this.ProductCode = productCode;
2705 this.RelationType = relationType;
2706 this.PerMachine = perMachine;
2707 this.Version = version;
2708 }
2709
2710 /// <summary>
2711 /// Gets the identity of the product's package detected.
2712 /// </summary>
2713 public string PackageId { get; private set; }
2714
2715 /// <summary>
2716 /// Gets the identity of the related bundle detected.
2717 /// </summary>
2718 public string ProductCode { get; private set; }
2719
2720 /// <summary>
2721 /// Gets the relationship type of the related bundle.
2722 /// </summary>
2723 public RelationType RelationType { get; private set; }
2724
2725 /// <summary>
2726 /// Gets whether the detected bundle is per machine.
2727 /// </summary>
2728 public bool PerMachine { get; private set; }
2729
2730 /// <summary>
2731 /// Gets the version of the related bundle detected.
2732 /// </summary>
2733 public string Version { get; private set; }
2734 }
2735
2736 /// <summary>
2737 /// Event arguments for <see cref="IDefaultBootstrapperApplication.CachePackageNonVitalValidationFailure"/>
2738 /// </summary>
2739 [Serializable]
2740 public class CachePackageNonVitalValidationFailureEventArgs : ActionEventArgs<BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION>
2741 {
2742 /// <summary>
2743 /// This class is for events raised by the engine.
2744 /// It is not intended to be instantiated by user code.
2745 /// </summary>
2746 public CachePackageNonVitalValidationFailureEventArgs(string packageId, int hrStatus, BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION recommendation, BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION action)
2747 : base(hrStatus, recommendation, action)
2748 {
2749 this.PackageId = packageId;
2750 }
2751
2752 /// <summary>
2753 /// Gets the identity of the package that was being validated.
2754 /// </summary>
2755 public string PackageId { get; private set; }
2756 }
2757}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplication.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplication.cs
new file mode 100644
index 00000000..ad7f8dd7
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplication.cs
@@ -0,0 +1,2013 @@
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.BootstrapperApplicationApi
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 );
26
27 /// <summary>
28 /// Low level method that is called directly from the engine.
29 /// </summary>
30 void BAProcFallback(
31 int message,
32 IntPtr pvArgs,
33 IntPtr pvResults,
34 ref int phr
35 );
36
37 /// <summary>
38 /// See <see cref="IDefaultBootstrapperApplication.Create"/>.
39 /// </summary>
40 [PreserveSig]
41 [return: MarshalAs(UnmanagedType.I4)]
42 int OnCreate(IBootstrapperEngine engine, ref Command command);
43
44 /// <summary>
45 /// See <see cref="IDefaultBootstrapperApplication.Destroy"/>.
46 /// </summary>
47 [PreserveSig]
48 [return: MarshalAs(UnmanagedType.I4)]
49 int OnDestroy(bool reload);
50
51 /// <summary>
52 /// See <see cref="IDefaultBootstrapperApplication.Startup"/>.
53 /// </summary>
54 [PreserveSig]
55 [return: MarshalAs(UnmanagedType.I4)]
56 int OnStartup();
57
58 /// <summary>
59 /// See <see cref="IDefaultBootstrapperApplication.Shutdown"/>.
60 /// </summary>
61 [PreserveSig]
62 [return: MarshalAs(UnmanagedType.I4)]
63 int OnShutdown(ref BOOTSTRAPPER_SHUTDOWN_ACTION action);
64
65 /// <summary>
66 /// See <see cref="IDefaultBootstrapperApplication.DetectBegin"/>.
67 /// </summary>
68 [PreserveSig]
69 [return: MarshalAs(UnmanagedType.I4)]
70 int OnDetectBegin(
71 [MarshalAs(UnmanagedType.Bool)] bool fCached,
72 [MarshalAs(UnmanagedType.U4)] RegistrationType registrationType,
73 [MarshalAs(UnmanagedType.U4)] int cPackages,
74 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
75 );
76
77 /// <summary>
78 /// See <see cref="IDefaultBootstrapperApplication.DetectForwardCompatibleBundle"/>.
79 /// </summary>
80 [PreserveSig]
81 [return: MarshalAs(UnmanagedType.I4)]
82 int OnDetectForwardCompatibleBundle(
83 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
84 [MarshalAs(UnmanagedType.U4)] RelationType relationType,
85 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
86 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
87 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
88 [MarshalAs(UnmanagedType.Bool)] bool fMissingFromCache,
89 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
90 );
91
92 /// <summary>
93 /// See <see cref="IDefaultBootstrapperApplication.DetectUpdateBegin"/>.
94 /// </summary>
95 [PreserveSig]
96 [return: MarshalAs(UnmanagedType.I4)]
97 int OnDetectUpdateBegin(
98 [MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation,
99 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
100 [MarshalAs(UnmanagedType.Bool)] ref bool fSkip
101 );
102
103 /// <summary>
104 /// See <see cref="IDefaultBootstrapperApplication.DetectUpdate"/>.
105 /// </summary>
106 [PreserveSig]
107 [return: MarshalAs(UnmanagedType.I4)]
108 int OnDetectUpdate(
109 [MarshalAs(UnmanagedType.LPWStr)] string wzUpdateLocation,
110 [MarshalAs(UnmanagedType.U8)] long dw64Size,
111 [MarshalAs(UnmanagedType.LPWStr)] string wzHash,
112 [MarshalAs(UnmanagedType.U4)] UpdateHashType hashAlgorithm,
113 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
114 [MarshalAs(UnmanagedType.LPWStr)] string wzTitle,
115 [MarshalAs(UnmanagedType.LPWStr)] string wzSummary,
116 [MarshalAs(UnmanagedType.LPWStr)] string wzContentType,
117 [MarshalAs(UnmanagedType.LPWStr)] string wzContent,
118 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
119 [MarshalAs(UnmanagedType.Bool)] ref bool fStopProcessingUpdates
120 );
121
122 /// <summary>
123 /// See <see cref="IDefaultBootstrapperApplication.DetectUpdateComplete"/>.
124 /// </summary>
125 [PreserveSig]
126 [return: MarshalAs(UnmanagedType.I4)]
127 int OnDetectUpdateComplete(
128 int hrStatus,
129 [MarshalAs(UnmanagedType.Bool)] ref bool fIgnoreError
130 );
131
132 /// <summary>
133 /// See <see cref="IDefaultBootstrapperApplication.DetectRelatedBundle"/>.
134 /// </summary>
135 [PreserveSig]
136 [return: MarshalAs(UnmanagedType.I4)]
137 int OnDetectRelatedBundle(
138 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
139 [MarshalAs(UnmanagedType.U4)] RelationType relationType,
140 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
141 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
142 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
143 [MarshalAs(UnmanagedType.Bool)] bool fMissingFromCache,
144 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
145 );
146
147 /// <summary>
148 /// See <see cref="IDefaultBootstrapperApplication.DetectPackageBegin"/>.
149 /// </summary>
150 [PreserveSig]
151 [return: MarshalAs(UnmanagedType.I4)]
152 int OnDetectPackageBegin(
153 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
154 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
155 );
156
157 /// <summary>
158 /// See <see cref="IDefaultBootstrapperApplication.DetectCompatibleMsiPackage"/>.
159 /// </summary>
160 [PreserveSig]
161 [return: MarshalAs(UnmanagedType.I4)]
162 int OnDetectCompatibleMsiPackage(
163 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
164 [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageId,
165 [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageVersion,
166 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
167 );
168
169 /// <summary>
170 /// See <see cref="IDefaultBootstrapperApplication.DetectRelatedMsiPackage"/>.
171 /// </summary>
172 [PreserveSig]
173 [return: MarshalAs(UnmanagedType.I4)]
174 int OnDetectRelatedMsiPackage(
175 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
176 [MarshalAs(UnmanagedType.LPWStr)] string wzUpgradeCode,
177 [MarshalAs(UnmanagedType.LPWStr)] string wzProductCode,
178 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
179 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
180 [MarshalAs(UnmanagedType.U4)] RelatedOperation operation,
181 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
182 );
183
184 /// <summary>
185 /// See <see cref="IDefaultBootstrapperApplication.DetectPatchTarget"/>.
186 /// </summary>
187 [PreserveSig]
188 [return: MarshalAs(UnmanagedType.I4)]
189 int OnDetectPatchTarget(
190 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
191 [MarshalAs(UnmanagedType.LPWStr)] string wzProductCode,
192 [MarshalAs(UnmanagedType.U4)] PackageState patchState,
193 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
194 );
195
196 /// <summary>
197 /// See <see cref="IDefaultBootstrapperApplication.DetectMsiFeature"/>.
198 /// </summary>
199 [PreserveSig]
200 [return: MarshalAs(UnmanagedType.I4)]
201 int OnDetectMsiFeature(
202 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
203 [MarshalAs(UnmanagedType.LPWStr)] string wzFeatureId,
204 [MarshalAs(UnmanagedType.U4)] FeatureState state,
205 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
206 );
207
208 /// <summary>
209 /// See <see cref="IDefaultBootstrapperApplication.DetectPackageComplete"/>.
210 /// </summary>
211 [PreserveSig]
212 [return: MarshalAs(UnmanagedType.I4)]
213 int OnDetectPackageComplete(
214 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
215 int hrStatus,
216 [MarshalAs(UnmanagedType.U4)] PackageState state,
217 [MarshalAs(UnmanagedType.Bool)] bool fCached
218 );
219
220 /// <summary>
221 /// See <see cref="IDefaultBootstrapperApplication.DetectComplete"/>.
222 /// </summary>
223 [PreserveSig]
224 [return: MarshalAs(UnmanagedType.I4)]
225 int OnDetectComplete(
226 int hrStatus,
227 [MarshalAs(UnmanagedType.Bool)] bool fEligibleForCleanup
228 );
229
230 /// <summary>
231 /// See <see cref="IDefaultBootstrapperApplication.PlanBegin"/>.
232 /// </summary>
233 [PreserveSig]
234 [return: MarshalAs(UnmanagedType.I4)]
235 int OnPlanBegin(
236 [MarshalAs(UnmanagedType.U4)] int cPackages,
237 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
238 );
239
240 /// <summary>
241 /// See <see cref="IDefaultBootstrapperApplication.PlanRelatedBundle"/>.
242 /// </summary>
243 [PreserveSig]
244 [return: MarshalAs(UnmanagedType.I4)]
245 int OnPlanRelatedBundle(
246 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
247 [MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
248 [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
249 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
250 );
251
252 /// <summary>
253 /// See <see cref="IDefaultBootstrapperApplication.PlanRollbackBoundary"/>.
254 /// </summary>
255 [PreserveSig]
256 [return: MarshalAs(UnmanagedType.I4)]
257 int OnPlanRollbackBoundary(
258 [MarshalAs(UnmanagedType.LPWStr)] string wzRollbackBoundaryId,
259 [MarshalAs(UnmanagedType.Bool)] bool fRecommendedTransaction,
260 [MarshalAs(UnmanagedType.Bool)] ref bool fTransaction,
261 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
262 );
263
264 /// <summary>
265 /// See <see cref="IDefaultBootstrapperApplication.PlanPackageBegin"/>.
266 /// </summary>
267 [PreserveSig]
268 [return: MarshalAs(UnmanagedType.I4)]
269 int OnPlanPackageBegin(
270 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
271 [MarshalAs(UnmanagedType.U4)] PackageState state,
272 [MarshalAs(UnmanagedType.Bool)] bool fCached,
273 [MarshalAs(UnmanagedType.U4)] BOOTSTRAPPER_PACKAGE_CONDITION_RESULT installCondition,
274 [MarshalAs(UnmanagedType.U4)] BOOTSTRAPPER_PACKAGE_CONDITION_RESULT repairCondition,
275 [MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
276 [MarshalAs(UnmanagedType.U4)] BOOTSTRAPPER_CACHE_TYPE recommendedCacheType,
277 [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
278 [MarshalAs(UnmanagedType.U4)] ref BOOTSTRAPPER_CACHE_TYPE pRequestedCacheType,
279 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
280 );
281
282 /// <summary>
283 /// See <see cref="IDefaultBootstrapperApplication.PlanCompatibleMsiPackageBegin"/>.
284 /// </summary>
285 [PreserveSig]
286 [return: MarshalAs(UnmanagedType.I4)]
287 int OnPlanCompatibleMsiPackageBegin(
288 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
289 [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageId,
290 [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageVersion,
291 [MarshalAs(UnmanagedType.Bool)] bool fRecommendedRemove,
292 [MarshalAs(UnmanagedType.Bool)] ref bool fRequestRemove,
293 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
294 );
295
296 /// <summary>
297 /// See <see cref="IDefaultBootstrapperApplication.PlanCompatibleMsiPackageComplete"/>.
298 /// </summary>
299 [PreserveSig]
300 [return: MarshalAs(UnmanagedType.I4)]
301 int OnPlanCompatibleMsiPackageComplete(
302 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
303 [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageId,
304 int hrStatus,
305 [MarshalAs(UnmanagedType.Bool)] bool fRequestedRemove
306 );
307
308 /// <summary>
309 /// See <see cref="IDefaultBootstrapperApplication.PlanPatchTarget"/>.
310 /// </summary>
311 [PreserveSig]
312 [return: MarshalAs(UnmanagedType.I4)]
313 int OnPlanPatchTarget(
314 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
315 [MarshalAs(UnmanagedType.LPWStr)] string wzProductCode,
316 [MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
317 [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
318 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
319 );
320
321 /// <summary>
322 /// See <see cref="IDefaultBootstrapperApplication.PlanMsiFeature"/>.
323 /// </summary>
324 [PreserveSig]
325 [return: MarshalAs(UnmanagedType.I4)]
326 int OnPlanMsiFeature(
327 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
328 [MarshalAs(UnmanagedType.LPWStr)] string wzFeatureId,
329 [MarshalAs(UnmanagedType.U4)] FeatureState recommendedState,
330 [MarshalAs(UnmanagedType.U4)] ref FeatureState pRequestedState,
331 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
332 );
333
334 /// <summary>
335 /// See <see cref="IDefaultBootstrapperApplication.PlanMsiPackage"/>.
336 /// </summary>
337 [PreserveSig]
338 [return: MarshalAs(UnmanagedType.I4)]
339 int OnPlanMsiPackage(
340 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
341 [MarshalAs(UnmanagedType.Bool)] bool fExecute,
342 [MarshalAs(UnmanagedType.U4)] ActionState action,
343 [MarshalAs(UnmanagedType.U4)] BOOTSTRAPPER_MSI_FILE_VERSIONING recommendedFileVersioning,
344 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
345 [MarshalAs(UnmanagedType.U4)] ref BURN_MSI_PROPERTY actionMsiProperty,
346 [MarshalAs(UnmanagedType.U4)] ref INSTALLUILEVEL uiLevel,
347 [MarshalAs(UnmanagedType.Bool)] ref bool fDisableExternalUiHandler,
348 [MarshalAs(UnmanagedType.U4)] ref BOOTSTRAPPER_MSI_FILE_VERSIONING fileVersioning
349 );
350
351 /// <summary>
352 /// See <see cref="IDefaultBootstrapperApplication.PlanPackageComplete"/>.
353 /// </summary>
354 [PreserveSig]
355 [return: MarshalAs(UnmanagedType.I4)]
356 int OnPlanPackageComplete(
357 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
358 int hrStatus,
359 [MarshalAs(UnmanagedType.U4)] RequestState requested
360 );
361
362 /// <summary>
363 /// See <see cref="IDefaultBootstrapperApplication.PlannedCompatiblePackage"/>.
364 /// </summary>
365 [PreserveSig]
366 [return: MarshalAs(UnmanagedType.I4)]
367 int OnPlannedCompatiblePackage(
368 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
369 [MarshalAs(UnmanagedType.LPWStr)] string wzCompatiblePackageId,
370 [MarshalAs(UnmanagedType.Bool)] bool fRemove
371 );
372
373 /// <summary>
374 /// See <see cref="IDefaultBootstrapperApplication.PlannedPackage"/>.
375 /// </summary>
376 [PreserveSig]
377 [return: MarshalAs(UnmanagedType.I4)]
378 int OnPlannedPackage(
379 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
380 [MarshalAs(UnmanagedType.U4)] ActionState execute,
381 [MarshalAs(UnmanagedType.U4)] ActionState rollback,
382 [MarshalAs(UnmanagedType.Bool)] bool fPlannedCache,
383 [MarshalAs(UnmanagedType.Bool)] bool fPlannedUncache
384 );
385
386 /// <summary>
387 /// See <see cref="IDefaultBootstrapperApplication.PlanComplete"/>.
388 /// </summary>
389 [PreserveSig]
390 [return: MarshalAs(UnmanagedType.I4)]
391 int OnPlanComplete(
392 int hrStatus
393 );
394
395 /// <summary>
396 /// See <see cref="IDefaultBootstrapperApplication.ApplyBegin"/>.
397 /// </summary>
398 [PreserveSig]
399 [return: MarshalAs(UnmanagedType.I4)]
400 int OnApplyBegin(
401 [MarshalAs(UnmanagedType.U4)] int dwPhaseCount,
402 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
403 );
404
405 /// <summary>
406 /// See <see cref="IDefaultBootstrapperApplication.ElevateBegin"/>.
407 /// </summary>
408 [PreserveSig]
409 [return: MarshalAs(UnmanagedType.I4)]
410 int OnElevateBegin(
411 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
412 );
413
414 /// <summary>
415 /// See <see cref="IDefaultBootstrapperApplication.ElevateComplete"/>.
416 /// </summary>
417 [PreserveSig]
418 [return: MarshalAs(UnmanagedType.I4)]
419 int OnElevateComplete(
420 int hrStatus
421 );
422
423 /// <summary>
424 /// See <see cref="IDefaultBootstrapperApplication.Progress"/>.
425 /// </summary>
426 [PreserveSig]
427 [return: MarshalAs(UnmanagedType.I4)]
428 int OnProgress(
429 [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage,
430 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
431 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
432 );
433
434 /// <summary>
435 /// See <see cref="IDefaultBootstrapperApplication.Error"/>.
436 /// </summary>
437 [PreserveSig]
438 [return: MarshalAs(UnmanagedType.I4)]
439 int OnError(
440 [MarshalAs(UnmanagedType.U4)] ErrorType errorType,
441 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
442 [MarshalAs(UnmanagedType.U4)] int dwCode,
443 [MarshalAs(UnmanagedType.LPWStr)] string wzError,
444 [MarshalAs(UnmanagedType.I4)] int dwUIHint,
445 [MarshalAs(UnmanagedType.U4)] int cData,
446 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 5, ArraySubType = UnmanagedType.LPWStr), In] string[] rgwzData,
447 [MarshalAs(UnmanagedType.I4)] Result nRecommendation,
448 [MarshalAs(UnmanagedType.I4)] ref Result pResult
449 );
450
451 /// <summary>
452 /// See <see cref="IDefaultBootstrapperApplication.RegisterBegin"/>.
453 /// </summary>
454 [PreserveSig]
455 [return: MarshalAs(UnmanagedType.I4)]
456 int OnRegisterBegin(
457 [MarshalAs(UnmanagedType.I4)] RegistrationType recommendedRegistrationType,
458 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
459 [MarshalAs(UnmanagedType.I4)] ref RegistrationType pRegistrationType
460 );
461
462 /// <summary>
463 /// See <see cref="IDefaultBootstrapperApplication.RegisterComplete"/>.
464 /// </summary>
465 [PreserveSig]
466 [return: MarshalAs(UnmanagedType.I4)]
467 int OnRegisterComplete(
468 int hrStatus
469 );
470
471 /// <summary>
472 /// See <see cref="IDefaultBootstrapperApplication.CacheBegin"/>.
473 /// </summary>
474 [PreserveSig]
475 [return: MarshalAs(UnmanagedType.I4)]
476 int OnCacheBegin(
477 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
478 );
479
480 /// <summary>
481 /// See <see cref="IDefaultBootstrapperApplication.CachePackageBegin"/>.
482 /// </summary>
483 [PreserveSig]
484 [return: MarshalAs(UnmanagedType.I4)]
485 int OnCachePackageBegin(
486 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
487 [MarshalAs(UnmanagedType.U4)] int cCachePayloads,
488 [MarshalAs(UnmanagedType.U8)] long dw64PackageCacheSize,
489 [MarshalAs(UnmanagedType.Bool)] bool fVital,
490 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
491 );
492
493 /// <summary>
494 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireBegin"/>.
495 /// </summary>
496 [PreserveSig]
497 [return: MarshalAs(UnmanagedType.I4)]
498 int OnCacheAcquireBegin(
499 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
500 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
501 [MarshalAs(UnmanagedType.LPWStr)] string wzSource,
502 [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadUrl,
503 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadContainerId,
504 [MarshalAs(UnmanagedType.U4)] CacheOperation recommendation,
505 [MarshalAs(UnmanagedType.I4)] ref CacheOperation action,
506 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
507 );
508
509 /// <summary>
510 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireProgress"/>.
511 /// </summary>
512 [PreserveSig]
513 [return: MarshalAs(UnmanagedType.I4)]
514 int OnCacheAcquireProgress(
515 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
516 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
517 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
518 [MarshalAs(UnmanagedType.U8)] long dw64Total,
519 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
520 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
521 );
522
523 /// <summary>
524 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>.
525 /// </summary>
526 [PreserveSig]
527 [return: MarshalAs(UnmanagedType.I4)]
528 int OnCacheAcquireResolving(
529 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
530 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
531 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3, ArraySubType = UnmanagedType.LPWStr), In] string[] searchPaths,
532 [MarshalAs(UnmanagedType.U4)] int cSearchPaths,
533 [MarshalAs(UnmanagedType.Bool)] bool fFoundLocal,
534 [MarshalAs(UnmanagedType.U4)] int dwRecommendedSearchPath,
535 [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadUrl,
536 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadContainerId,
537 [MarshalAs(UnmanagedType.I4)] CacheResolveOperation recommendation,
538 [MarshalAs(UnmanagedType.U4)] ref int dwChosenSearchPath,
539 [MarshalAs(UnmanagedType.I4)] ref CacheResolveOperation action,
540 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
541 );
542
543 /// <summary>
544 /// See <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>.
545 /// </summary>
546 [PreserveSig]
547 [return: MarshalAs(UnmanagedType.I4)]
548 int OnCacheAcquireComplete(
549 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
550 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
551 int hrStatus,
552 BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION recommendation,
553 ref BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION pAction
554 );
555
556 /// <summary>
557 /// See <see cref="IDefaultBootstrapperApplication.CacheVerifyBegin"/>.
558 /// </summary>
559 [PreserveSig]
560 [return: MarshalAs(UnmanagedType.I4)]
561 int OnCacheVerifyBegin(
562 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
563 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
564 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
565 );
566
567 /// <summary>
568 /// See <see cref="IDefaultBootstrapperApplication.CacheVerifyProgress"/>.
569 /// </summary>
570 [PreserveSig]
571 [return: MarshalAs(UnmanagedType.I4)]
572 int OnCacheVerifyProgress(
573 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
574 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
575 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
576 [MarshalAs(UnmanagedType.U8)] long dw64Total,
577 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
578 [MarshalAs(UnmanagedType.I4)] CacheVerifyStep verifyStep,
579 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
580 );
581
582 /// <summary>
583 /// See <see cref="IDefaultBootstrapperApplication.CacheVerifyComplete"/>.
584 /// </summary>
585 [PreserveSig]
586 [return: MarshalAs(UnmanagedType.I4)]
587 int OnCacheVerifyComplete(
588 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
589 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
590 int hrStatus,
591 BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION recommendation,
592 ref BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION action
593 );
594
595 /// <summary>
596 /// See <see cref="IDefaultBootstrapperApplication.CachePackageComplete"/>.
597 /// </summary>
598 [PreserveSig]
599 [return: MarshalAs(UnmanagedType.I4)]
600 int OnCachePackageComplete(
601 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
602 int hrStatus,
603 BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION recommendation,
604 ref BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION action
605 );
606
607 /// <summary>
608 /// See <see cref="IDefaultBootstrapperApplication.CacheComplete"/>.
609 /// </summary>
610 /// <param name="hrStatus"></param>
611 /// <returns></returns>
612 [PreserveSig]
613 [return: MarshalAs(UnmanagedType.I4)]
614 int OnCacheComplete(
615 int hrStatus
616 );
617
618 /// <summary>
619 /// See <see cref="IDefaultBootstrapperApplication.ExecuteBegin"/>.
620 /// </summary>
621 [PreserveSig]
622 [return: MarshalAs(UnmanagedType.I4)]
623 int OnExecuteBegin(
624 [MarshalAs(UnmanagedType.U4)] int cExecutingPackages,
625 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
626 );
627
628 /// <summary>
629 /// See <see cref="IDefaultBootstrapperApplication.ExecutePackageBegin"/>.
630 /// </summary>
631 [PreserveSig]
632 [return: MarshalAs(UnmanagedType.I4)]
633 int OnExecutePackageBegin(
634 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
635 [MarshalAs(UnmanagedType.Bool)] bool fExecute,
636 [MarshalAs(UnmanagedType.U4)] ActionState action,
637 [MarshalAs(UnmanagedType.U4)] INSTALLUILEVEL uiLevel,
638 [MarshalAs(UnmanagedType.Bool)] bool fDisableExternalUiHandler,
639 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
640 );
641
642 /// <summary>
643 /// See <see cref="IDefaultBootstrapperApplication.ExecutePatchTarget"/>.
644 /// </summary>
645 [PreserveSig]
646 [return: MarshalAs(UnmanagedType.I4)]
647 int OnExecutePatchTarget(
648 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
649 [MarshalAs(UnmanagedType.LPWStr)] string wzTargetProductCode,
650 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
651 );
652
653 /// <summary>
654 /// See <see cref="IDefaultBootstrapperApplication.ExecuteProgress"/>.
655 /// </summary>
656 [PreserveSig]
657 [return: MarshalAs(UnmanagedType.I4)]
658 int OnExecuteProgress(
659 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
660 [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage,
661 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
662 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
663 );
664
665 /// <summary>
666 /// See <see cref="IDefaultBootstrapperApplication.ExecuteMsiMessage"/>.
667 /// </summary>
668 [PreserveSig]
669 [return: MarshalAs(UnmanagedType.I4)]
670 int OnExecuteMsiMessage(
671 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
672 [MarshalAs(UnmanagedType.U4)] InstallMessage messageType,
673 [MarshalAs(UnmanagedType.I4)] int dwUIHint,
674 [MarshalAs(UnmanagedType.LPWStr)] string wzMessage,
675 [MarshalAs(UnmanagedType.U4)] int cData,
676 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.LPWStr), In] string[] rgwzData,
677 [MarshalAs(UnmanagedType.I4)] Result nRecommendation,
678 [MarshalAs(UnmanagedType.I4)] ref Result pResult
679 );
680
681 /// <summary>
682 /// See <see cref="IDefaultBootstrapperApplication.ExecuteFilesInUse"/>.
683 /// </summary>
684 [PreserveSig]
685 [return: MarshalAs(UnmanagedType.I4)]
686 int OnExecuteFilesInUse(
687 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
688 [MarshalAs(UnmanagedType.U4)] int cFiles,
689 [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.LPWStr), In] string[] rgwzFiles,
690 [MarshalAs(UnmanagedType.I4)] Result nRecommendation,
691 [MarshalAs(UnmanagedType.I4)] FilesInUseType source,
692 [MarshalAs(UnmanagedType.I4)] ref Result pResult
693 );
694
695 /// <summary>
696 /// See <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
697 /// </summary>
698 [PreserveSig]
699 [return: MarshalAs(UnmanagedType.I4)]
700 int OnExecutePackageComplete(
701 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
702 int hrStatus,
703 [MarshalAs(UnmanagedType.U4)] ApplyRestart restart,
704 [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION recommendation,
705 [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION pAction
706 );
707
708 /// <summary>
709 /// See <see cref="IDefaultBootstrapperApplication.ExecuteComplete"/>.
710 /// </summary>
711 [PreserveSig]
712 [return: MarshalAs(UnmanagedType.I4)]
713 int OnExecuteComplete(
714 int hrStatus
715 );
716
717 /// <summary>
718 /// See <see cref="IDefaultBootstrapperApplication.UnregisterBegin"/>.
719 /// </summary>
720 [PreserveSig]
721 [return: MarshalAs(UnmanagedType.I4)]
722 int OnUnregisterBegin(
723 [MarshalAs(UnmanagedType.I4)] RegistrationType recommendedRegistrationType,
724 [MarshalAs(UnmanagedType.I4)] ref RegistrationType pRegistrationType
725 );
726
727 /// <summary>
728 /// See <see cref="IDefaultBootstrapperApplication.UnregisterComplete"/>.
729 /// </summary>
730 [PreserveSig]
731 [return: MarshalAs(UnmanagedType.I4)]
732 int OnUnregisterComplete(
733 int hrStatus
734 );
735
736 /// <summary>
737 /// See <see cref="IDefaultBootstrapperApplication.ApplyComplete"/>.
738 /// </summary>
739 [PreserveSig]
740 [return: MarshalAs(UnmanagedType.I4)]
741 int OnApplyComplete(
742 int hrStatus,
743 [MarshalAs(UnmanagedType.U4)] ApplyRestart restart,
744 [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_APPLYCOMPLETE_ACTION recommendation,
745 [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_APPLYCOMPLETE_ACTION pAction
746 );
747
748 /// <summary>
749 /// See <see cref="IDefaultBootstrapperApplication.LaunchApprovedExeBegin"/>.
750 /// </summary>
751 [PreserveSig]
752 [return: MarshalAs(UnmanagedType.I4)]
753 int OnLaunchApprovedExeBegin(
754 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
755 );
756
757 /// <summary>
758 /// See <see cref="IDefaultBootstrapperApplication.LaunchApprovedExeComplete"/>.
759 /// </summary>
760 [PreserveSig]
761 [return: MarshalAs(UnmanagedType.I4)]
762 int OnLaunchApprovedExeComplete(
763 int hrStatus,
764 int processId
765 );
766
767 /// <summary>
768 /// See <see cref="IDefaultBootstrapperApplication.BeginMsiTransactionBegin"/>.
769 /// </summary>
770 [PreserveSig]
771 [return: MarshalAs(UnmanagedType.I4)]
772 int OnBeginMsiTransactionBegin(
773 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
774 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
775 );
776
777 /// <summary>
778 /// See <see cref="IDefaultBootstrapperApplication.BeginMsiTransactionComplete"/>.
779 /// </summary>
780 [PreserveSig]
781 [return: MarshalAs(UnmanagedType.I4)]
782 int OnBeginMsiTransactionComplete(
783 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
784 int hrStatus
785 );
786
787 /// <summary>
788 /// See <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionBegin"/>.
789 /// </summary>
790 [PreserveSig]
791 [return: MarshalAs(UnmanagedType.I4)]
792 int OnCommitMsiTransactionBegin(
793 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
794 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
795 );
796
797 /// <summary>
798 /// See <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionComplete"/>.
799 /// </summary>
800 [PreserveSig]
801 [return: MarshalAs(UnmanagedType.I4)]
802 int OnCommitMsiTransactionComplete(
803 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
804 int hrStatus,
805 [MarshalAs(UnmanagedType.U4)] ApplyRestart restart,
806 [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation,
807 [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction
808 );
809
810 /// <summary>
811 /// See <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionBegin"/>.
812 /// </summary>
813 [PreserveSig]
814 [return: MarshalAs(UnmanagedType.I4)]
815 int OnRollbackMsiTransactionBegin(
816 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId
817 );
818
819 /// <summary>
820 /// See <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionComplete"/>.
821 /// </summary>
822 [PreserveSig]
823 [return: MarshalAs(UnmanagedType.I4)]
824 int OnRollbackMsiTransactionComplete(
825 [MarshalAs(UnmanagedType.LPWStr)] string wzTransactionId,
826 int hrStatus,
827 [MarshalAs(UnmanagedType.U4)] ApplyRestart restart,
828 [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION recommendation,
829 [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION pAction
830 );
831
832 /// <summary>
833 /// See <see cref="IDefaultBootstrapperApplication.PauseAutomaticUpdatesBegin"/>.
834 /// </summary>
835 [PreserveSig]
836 [return: MarshalAs(UnmanagedType.I4)]
837 int OnPauseAutomaticUpdatesBegin(
838 );
839
840 /// <summary>
841 /// See <see cref="IDefaultBootstrapperApplication.PauseAutomaticUpdatesComplete"/>.
842 /// </summary>
843 [PreserveSig]
844 [return: MarshalAs(UnmanagedType.I4)]
845 int OnPauseAutomaticUpdatesComplete(
846 int hrStatus
847 );
848
849 /// <summary>
850 /// See <see cref="IDefaultBootstrapperApplication.SystemRestorePointBegin"/>.
851 /// </summary>
852 [PreserveSig]
853 [return: MarshalAs(UnmanagedType.I4)]
854 int OnSystemRestorePointBegin(
855 );
856
857 /// <summary>
858 /// See <see cref="IDefaultBootstrapperApplication.SystemRestorePointComplete"/>.
859 /// </summary>
860 [PreserveSig]
861 [return: MarshalAs(UnmanagedType.I4)]
862 int OnSystemRestorePointComplete(
863 int hrStatus
864 );
865
866 /// <summary>
867 /// See <see cref="IDefaultBootstrapperApplication.PlanForwardCompatibleBundle"/>.
868 /// </summary>
869 [PreserveSig]
870 [return: MarshalAs(UnmanagedType.I4)]
871 int OnPlanForwardCompatibleBundle(
872 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
873 [MarshalAs(UnmanagedType.U4)] RelationType relationType,
874 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleTag,
875 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
876 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
877 [MarshalAs(UnmanagedType.Bool)] bool fRecommendedIgnoreBundle,
878 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel,
879 [MarshalAs(UnmanagedType.Bool)] ref bool fIgnoreBundle
880 );
881
882 /// <summary>
883 /// See <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyBegin"/>.
884 /// </summary>
885 [PreserveSig]
886 [return: MarshalAs(UnmanagedType.I4)]
887 int OnCacheContainerOrPayloadVerifyBegin(
888 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
889 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
890 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
891 );
892
893 /// <summary>
894 /// See <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyProgress"/>.
895 /// </summary>
896 [PreserveSig]
897 [return: MarshalAs(UnmanagedType.I4)]
898 int OnCacheContainerOrPayloadVerifyProgress(
899 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
900 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
901 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
902 [MarshalAs(UnmanagedType.U8)] long dw64Total,
903 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
904 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
905 );
906
907 /// <summary>
908 /// See <see cref="IDefaultBootstrapperApplication.CacheContainerOrPayloadVerifyComplete"/>.
909 /// </summary>
910 [PreserveSig]
911 [return: MarshalAs(UnmanagedType.I4)]
912 int OnCacheContainerOrPayloadVerifyComplete(
913 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
914 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
915 int hrStatus
916 );
917
918 /// <summary>
919 /// See <see cref="IDefaultBootstrapperApplication.CachePayloadExtractBegin"/>.
920 /// </summary>
921 [PreserveSig]
922 [return: MarshalAs(UnmanagedType.I4)]
923 int OnCachePayloadExtractBegin(
924 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
925 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
926 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
927 );
928
929 /// <summary>
930 /// See <see cref="IDefaultBootstrapperApplication.CachePayloadExtractProgress"/>.
931 /// </summary>
932 [PreserveSig]
933 [return: MarshalAs(UnmanagedType.I4)]
934 int OnCachePayloadExtractProgress(
935 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
936 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
937 [MarshalAs(UnmanagedType.U8)] long dw64Progress,
938 [MarshalAs(UnmanagedType.U8)] long dw64Total,
939 [MarshalAs(UnmanagedType.U4)] int dwOverallPercentage,
940 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
941 );
942
943 /// <summary>
944 /// See <see cref="IDefaultBootstrapperApplication.CachePayloadExtractComplete"/>.
945 /// </summary>
946 [PreserveSig]
947 [return: MarshalAs(UnmanagedType.I4)]
948 int OnCachePayloadExtractComplete(
949 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
950 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
951 int hrStatus
952 );
953
954 /// <summary>
955 /// See <see cref="IDefaultBootstrapperApplication.PlanRestoreRelatedBundle"/>.
956 /// </summary>
957 [PreserveSig]
958 [return: MarshalAs(UnmanagedType.I4)]
959 int OnPlanRestoreRelatedBundle(
960 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
961 [MarshalAs(UnmanagedType.U4)] RequestState recommendedState,
962 [MarshalAs(UnmanagedType.U4)] ref RequestState pRequestedState,
963 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
964 );
965
966 /// <summary>
967 /// See <see cref="IDefaultBootstrapperApplication.PlanRelatedBundleType"/>.
968 /// </summary>
969 [PreserveSig]
970 [return: MarshalAs(UnmanagedType.I4)]
971 int OnPlanRelatedBundleType(
972 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
973 [MarshalAs(UnmanagedType.U4)] RelatedBundlePlanType recommendedType,
974 [MarshalAs(UnmanagedType.U4)] ref RelatedBundlePlanType pRequestedType,
975 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
976 );
977
978 /// <summary>
979 /// See <see cref="IDefaultBootstrapperApplication.ApplyDowngrade"/>.
980 /// </summary>
981 [PreserveSig]
982 [return: MarshalAs(UnmanagedType.I4)]
983 int OnApplyDowngrade(
984 [MarshalAs(UnmanagedType.I4)] int hrRecommended,
985 [MarshalAs(UnmanagedType.I4)] ref int hrStatus
986 );
987
988 /// <summary>
989 /// See <see cref="IDefaultBootstrapperApplication.ExecuteProcessCancel"/>.
990 /// </summary>
991 [PreserveSig]
992 [return: MarshalAs(UnmanagedType.I4)]
993 int OnExecuteProcessCancel(
994 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
995 int processId,
996 [MarshalAs(UnmanagedType.I4)] BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION recommendation,
997 [MarshalAs(UnmanagedType.I4)] ref BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION pAction
998 );
999
1000 /// <summary>
1001 /// See <see cref="IDefaultBootstrapperApplication.DetectRelatedBundlePackage"/>.
1002 /// </summary>
1003 [PreserveSig]
1004 [return: MarshalAs(UnmanagedType.I4)]
1005 int OnDetectRelatedBundlePackage(
1006 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
1007 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
1008 [MarshalAs(UnmanagedType.U4)] RelationType relationType,
1009 [MarshalAs(UnmanagedType.Bool)] bool fPerMachine,
1010 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion,
1011 [MarshalAs(UnmanagedType.Bool)] ref bool fCancel
1012 );
1013
1014 /// <summary>
1015 /// See <see cref="IDefaultBootstrapperApplication.CachePackageNonVitalValidationFailure"/>.
1016 /// </summary>
1017 [PreserveSig]
1018 [return: MarshalAs(UnmanagedType.I4)]
1019 int OnCachePackageNonVitalValidationFailure(
1020 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageId,
1021 int hrStatus,
1022 BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION recommendation,
1023 ref BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION action
1024 );
1025 }
1026
1027 /// <summary>
1028 /// The display level for the BA.
1029 /// </summary>
1030 public enum Display
1031 {
1032 /// <summary>
1033 /// Invalid value.
1034 /// </summary>
1035 Unknown,
1036
1037 /// <summary>
1038 /// The bundle is being run through the Burn protocol by an external application.
1039 /// </summary>
1040 Embedded,
1041
1042 /// <summary>
1043 /// No UI should be shown.
1044 /// </summary>
1045 None,
1046
1047 /// <summary>
1048 /// The UI should not require any interaction from the user.
1049 /// </summary>
1050 Passive,
1051
1052 /// <summary>
1053 /// The UI should be fully interactive.
1054 /// </summary>
1055 Full,
1056 }
1057
1058 /// <summary>
1059 /// Messages from Windows Installer (msi.h).
1060 /// </summary>
1061 public enum InstallMessage
1062 {
1063 /// <summary>
1064 /// premature termination, possibly fatal OOM
1065 /// </summary>
1066 FatalExit,
1067
1068 /// <summary>
1069 /// formatted error message
1070 /// </summary>
1071 Error = 0x01000000,
1072
1073 /// <summary>
1074 /// formatted warning message
1075 /// </summary>
1076 Warning = 0x02000000,
1077
1078 /// <summary>
1079 /// user request message
1080 /// </summary>
1081 User = 0x03000000,
1082
1083 /// <summary>
1084 /// informative message for log
1085 /// </summary>
1086 Info = 0x04000000,
1087
1088 /// <summary>
1089 /// list of files in use that need to be replaced
1090 /// </summary>
1091 FilesInUse = 0x05000000,
1092
1093 /// <summary>
1094 /// request to determine a valid source location
1095 /// </summary>
1096 ResolveSource = 0x06000000,
1097
1098 /// <summary>
1099 /// insufficient disk space message
1100 /// </summary>
1101 OutOfDiskSpace = 0x07000000,
1102
1103 /// <summary>
1104 /// start of action: action name &amp; description
1105 /// </summary>
1106 ActionStart = 0x08000000,
1107
1108 /// <summary>
1109 /// formatted data associated with individual action item
1110 /// </summary>
1111 ActionData = 0x09000000,
1112
1113 /// <summary>
1114 /// progress gauge info: units so far, total
1115 /// </summary>
1116 Progress = 0x0a000000,
1117
1118 /// <summary>
1119 /// product info for dialog: language Id, dialog caption
1120 /// </summary>
1121 CommonData = 0x0b000000,
1122
1123 /// <summary>
1124 /// sent prior to UI initialization, no string data
1125 /// </summary>
1126 Initialize = 0x0c000000,
1127
1128 /// <summary>
1129 /// sent after UI termination, no string data
1130 /// </summary>
1131 Terminate = 0x0d000000,
1132
1133 /// <summary>
1134 /// sent prior to display or authored dialog or wizard
1135 /// </summary>
1136 ShowDialog = 0x0e000000,
1137
1138 /// <summary>
1139 /// log only, to log performance number like action time
1140 /// </summary>
1141 Performance = 0x0f000000,
1142
1143 /// <summary>
1144 /// the list of apps that the user can request Restart Manager to shut down and restart
1145 /// </summary>
1146 RMFilesInUse = 0x19000000,
1147
1148 /// <summary>
1149 /// sent prior to server-side install of a product
1150 /// </summary>
1151 InstallStart = 0x1a000000,
1152
1153 /// <summary>
1154 /// sent after server-side install
1155 /// </summary>
1156 InstallEnd = 0x1B000000,
1157 }
1158
1159 /// <summary>
1160 /// The action to perform when a reboot is necessary.
1161 /// </summary>
1162 public enum Restart
1163 {
1164 /// <summary>
1165 /// Invalid value.
1166 /// </summary>
1167 Unknown,
1168
1169 /// <summary>
1170 /// The bundle should never initiate a restart.
1171 /// </summary>
1172 Never,
1173
1174 /// <summary>
1175 /// The bundle should prompt the user whether to restart.
1176 /// </summary>
1177 Prompt,
1178
1179 /// <summary>
1180 /// The bundle should restart if necessary.
1181 /// </summary>
1182 Automatic,
1183
1184 /// <summary>
1185 /// The bundle should always restart when given the option.
1186 /// </summary>
1187 Always,
1188 }
1189
1190 /// <summary>
1191 /// The display name to use when registering in Add/Remove Programs.
1192 /// </summary>
1193 public enum RegistrationType
1194 {
1195 /// <summary>
1196 /// No registration.
1197 /// The engine will ignore None if it recommended InProgress or Full.
1198 /// </summary>
1199 None,
1200
1201 /// <summary>
1202 /// The in-progress display name.
1203 /// </summary>
1204 InProgress,
1205
1206 /// <summary>
1207 /// The default display name.
1208 /// </summary>
1209 Full,
1210 }
1211
1212 /// <summary>
1213 /// Result codes (based on Dialog Box Command IDs from WinUser.h).
1214 /// </summary>
1215 public enum Result
1216 {
1217 /// <summary>
1218 /// An error occurred.
1219 /// </summary>
1220 Error = -1,
1221
1222 /// <summary>
1223 /// Invalid value.
1224 /// </summary>
1225 None,
1226
1227 /// <summary>
1228 /// IDOK
1229 /// </summary>
1230 Ok,
1231
1232 /// <summary>
1233 /// IDCANCEL
1234 /// </summary>
1235 Cancel,
1236
1237 /// <summary>
1238 /// IDABORT
1239 /// </summary>
1240 Abort,
1241
1242 /// <summary>
1243 /// IDRETRY
1244 /// </summary>
1245 Retry,
1246
1247 /// <summary>
1248 /// IDIGNORE
1249 /// </summary>
1250 Ignore,
1251
1252 /// <summary>
1253 /// IDYES
1254 /// </summary>
1255 Yes,
1256
1257 /// <summary>
1258 /// IDNO
1259 /// </summary>
1260 No,
1261
1262 /// <summary>
1263 /// IDCLOSE
1264 /// </summary>
1265 Close,
1266
1267 /// <summary>
1268 /// IDHELP
1269 /// </summary>
1270 Help,
1271
1272 /// <summary>
1273 /// IDTRYAGAIN
1274 /// </summary>
1275 TryAgain,
1276
1277 /// <summary>
1278 /// IDCONTINUE
1279 /// </summary>
1280 Continue,
1281 }
1282
1283 /// <summary>
1284 /// Describes why a bundle or packaged is being resumed.
1285 /// </summary>
1286 public enum ResumeType
1287 {
1288 /// <summary>
1289 /// No resume information.
1290 /// </summary>
1291 None,
1292
1293 /// <summary>
1294 /// Resume information exists but is invalid.
1295 /// </summary>
1296 Invalid,
1297
1298 /// <summary>
1299 /// The bundle was re-launched after an unexpected interruption.
1300 /// </summary>
1301 Interrupted,
1302
1303 /// <summary>
1304 /// The bundle was re-launched after a reboot.
1305 /// </summary>
1306 Reboot,
1307
1308 /// <summary>
1309 /// The bundle was re-launched after being suspended.
1310 /// </summary>
1311 Suspend,
1312
1313 /// <summary>
1314 /// The bundle was launched from Add/Remove Programs.
1315 /// </summary>
1316 Arp,
1317 }
1318
1319 /// <summary>
1320 /// Indicates what caused the error.
1321 /// </summary>
1322 public enum ErrorType
1323 {
1324 /// <summary>
1325 /// The error occurred trying to elevate.
1326 /// </summary>
1327 Elevate,
1328
1329 /// <summary>
1330 /// The error came from the Windows Installer.
1331 /// </summary>
1332 WindowsInstaller,
1333
1334 /// <summary>
1335 /// The error came from an EXE Package.
1336 /// </summary>
1337 ExePackage,
1338
1339 /// <summary>
1340 /// The error came while trying to authenticate with an HTTP server.
1341 /// </summary>
1342 HttpServerAuthentication,
1343
1344 /// <summary>
1345 /// The error came while trying to authenticate with an HTTP proxy.
1346 /// </summary>
1347 HttpProxyAuthentication,
1348
1349 /// <summary>
1350 /// The error occurred during apply.
1351 /// </summary>
1352 Apply,
1353 };
1354
1355 /// <summary>
1356 /// Indicates the source of the FilesInUse message.
1357 /// </summary>
1358 public enum FilesInUseType
1359 {
1360 /// <summary>
1361 /// Generated from INSTALLMESSAGE_FILESINUSE.
1362 /// </summary>
1363 Msi,
1364 /// <summary>
1365 /// Generated from INSTALLMESSAGE_RMFILESINUSE.
1366 /// </summary>
1367 MsiRm,
1368 /// <summary>
1369 /// Generated from MMIO_CLOSE_APPS.
1370 /// </summary>
1371 Netfx,
1372 }
1373
1374 /// <summary>
1375 /// The calculated operation for the related MSI package.
1376 /// </summary>
1377 public enum RelatedOperation
1378 {
1379 /// <summary>
1380 /// No relation.
1381 /// </summary>
1382 None,
1383
1384 /// <summary>
1385 /// The related bundle or package will be downgraded.
1386 /// </summary>
1387 Downgrade,
1388
1389 /// <summary>
1390 /// The related package will be upgraded as a minor revision.
1391 /// </summary>
1392 MinorUpdate,
1393
1394 /// <summary>
1395 /// The related bundle or package will be upgraded as a major revision.
1396 /// </summary>
1397 MajorUpgrade,
1398
1399 /// <summary>
1400 /// The related bundle will be removed.
1401 /// </summary>
1402 Remove,
1403
1404 /// <summary>
1405 /// The related bundle will be installed.
1406 /// </summary>
1407 Install,
1408
1409 /// <summary>
1410 /// The related bundle will be repaired.
1411 /// </summary>
1412 Repair,
1413 };
1414
1415 /// <summary>
1416 /// The cache operation used to acquire a container or payload.
1417 /// </summary>
1418 public enum CacheOperation
1419 {
1420 /// <summary>
1421 /// There is no source available.
1422 /// </summary>
1423 None,
1424
1425 /// <summary>
1426 /// Copy the payload or container from the chosen local source.
1427 /// </summary>
1428 Copy,
1429
1430 /// <summary>
1431 /// Download the payload or container using the download URL.
1432 /// </summary>
1433 Download,
1434
1435 /// <summary>
1436 /// Extract the payload from the container.
1437 /// </summary>
1438 Extract,
1439 }
1440
1441 /// <summary>
1442 /// The source to be used to acquire a container or payload.
1443 /// </summary>
1444 public enum CacheResolveOperation
1445 {
1446 /// <summary>
1447 /// There is no source available.
1448 /// </summary>
1449 None,
1450
1451 /// <summary>
1452 /// Copy the payload or container from the chosen local source.
1453 /// </summary>
1454 Local,
1455
1456 /// <summary>
1457 /// Download the payload or container from the download URL.
1458 /// </summary>
1459 Download,
1460
1461 /// <summary>
1462 /// Extract the payload from the container.
1463 /// </summary>
1464 Container,
1465
1466 /// <summary>
1467 /// Look again for the payload or container locally.
1468 /// </summary>
1469 Retry,
1470 }
1471
1472 /// <summary>
1473 /// The current step when verifying a container or payload.
1474 /// </summary>
1475 public enum CacheVerifyStep
1476 {
1477 /// <summary>
1478 /// Copying or moving the file from the working path to the unverified path.
1479 /// Not used during Layout.
1480 /// </summary>
1481 Stage,
1482 /// <summary>
1483 /// Hashing the file.
1484 /// </summary>
1485 Hash,
1486 /// <summary>
1487 /// Copying or moving the file to the final location.
1488 /// </summary>
1489 Finalize,
1490 }
1491
1492 /// <summary>
1493 /// The restart state after a package or all packages were applied.
1494 /// </summary>
1495 public enum ApplyRestart
1496 {
1497 /// <summary>
1498 /// Package or chain does not require a restart.
1499 /// </summary>
1500 None,
1501
1502 /// <summary>
1503 /// Package or chain requires a restart but it has not been initiated yet.
1504 /// </summary>
1505 RestartRequired,
1506
1507 /// <summary>
1508 /// Package or chain has already initiated the restart.
1509 /// </summary>
1510 RestartInitiated
1511 }
1512
1513 /// <summary>
1514 /// The relation type for related bundles.
1515 /// </summary>
1516 public enum RelationType
1517 {
1518 /// <summary>
1519 /// No relation.
1520 /// </summary>
1521 None,
1522
1523 /// <summary>
1524 /// The related bundle is detected by the running bundle.
1525 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1526 /// </summary>
1527 Detect,
1528
1529 /// <summary>
1530 /// The related bundle shares an upgrade code with the running bundle.
1531 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1532 /// </summary>
1533 Upgrade,
1534
1535 /// <summary>
1536 /// The related bundle is an add-on for the running bundle.
1537 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1538 /// </summary>
1539 Addon,
1540
1541 /// <summary>
1542 /// The related bundle is a patch for the running bundle.
1543 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1544 /// </summary>
1545 Patch,
1546
1547 /// <summary>
1548 /// The running bundle is an add-on for the related bundle.
1549 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1550 /// </summary>
1551 DependentAddon,
1552
1553 /// <summary>
1554 /// The running bundle is a patch for the related bundle.
1555 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1556 /// </summary>
1557 DependentPatch,
1558
1559 /// <summary>
1560 /// The related bundle is a newer version of the running bundle.
1561 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1562 /// </summary>
1563 Update,
1564
1565 /// <summary>
1566 /// The related bundle is in the running bundle's chain.
1567 /// This relationship is reversed for <see cref="IBootstrapperCommand.Relation" />
1568 /// </summary>
1569 ChainPackage,
1570 }
1571
1572 /// <summary>
1573 /// The planned relation type for related bundles.
1574 /// </summary>
1575 public enum RelatedBundlePlanType
1576 {
1577 /// <summary>
1578 /// Don't execute the related bundle.
1579 /// </summary>
1580 None,
1581
1582 /// <summary>
1583 /// The running bundle is a downgrade for the related bundle.
1584 /// </summary>
1585 Downgrade,
1586
1587 /// <summary>
1588 /// The running bundle is an upgrade for the related bundle.
1589 /// </summary>
1590 Upgrade,
1591
1592 /// <summary>
1593 /// The related bundle is an add-on of the running bundle.
1594 /// </summary>
1595 Addon,
1596
1597 /// <summary>
1598 /// The related bundle is a patch for the running bundle.
1599 /// </summary>
1600 Patch,
1601
1602 /// <summary>
1603 /// The running bundle is an add-on for the related bundle.
1604 /// </summary>
1605 DependentAddon,
1606
1607 /// <summary>
1608 /// The running bundle is a patch for the related bundle.
1609 /// </summary>
1610 DependentPatch,
1611 }
1612
1613 /// <summary>
1614 /// One or more reasons why the application is requested to be closed or is being closed.
1615 /// </summary>
1616 [Flags]
1617 public enum EndSessionReasons
1618 {
1619 /// <summary>
1620 /// The system is shutting down or restarting (it is not possible to determine which event is occurring).
1621 /// </summary>
1622 Unknown,
1623
1624 /// <summary>
1625 /// The application is using a file that must be replaced, the system is being serviced, or system resources are exhausted.
1626 /// </summary>
1627 CloseApplication,
1628
1629 /// <summary>
1630 /// The application is forced to shut down.
1631 /// </summary>
1632 Critical = 0x40000000,
1633
1634 /// <summary>
1635 /// The user is logging off.
1636 /// </summary>
1637 Logoff = unchecked((int)0x80000000)
1638 }
1639
1640 /// <summary>
1641 /// The available actions for <see cref="IDefaultBootstrapperApplication.ApplyComplete"/>.
1642 /// </summary>
1643 public enum BOOTSTRAPPER_APPLYCOMPLETE_ACTION
1644 {
1645 /// <summary>
1646 /// Instructs the engine to not take any special action.
1647 /// </summary>
1648 None,
1649
1650 /// <summary>
1651 /// Instructs the engine to restart.
1652 /// The engine will not launch again after the machine is rebooted.
1653 /// Ignored if reboot was already initiated by <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
1654 /// </summary>
1655 Restart,
1656 }
1657
1658 /// <summary>
1659 /// The cache strategy to be used for the package.
1660 /// </summary>
1661 public enum BOOTSTRAPPER_CACHE_TYPE
1662 {
1663 /// <summary>
1664 /// The package will be cached in order to securely run the package, but will always be cleaned from the cache at the end.
1665 /// </summary>
1666 Remove,
1667
1668 /// <summary>
1669 /// The package will be cached in order to run the package, and then kept in the cache until the package is uninstalled.
1670 /// </summary>
1671 Keep,
1672
1673 /// <summary>
1674 /// The package will always be cached and stay in the cache, unless the package and bundle are both being uninstalled.
1675 /// </summary>
1676 Force,
1677 }
1678
1679 /// <summary>
1680 /// The available actions for <see cref="IDefaultBootstrapperApplication.CacheAcquireComplete"/>.
1681 /// </summary>
1682 public enum BOOTSTRAPPER_CACHEACQUIRECOMPLETE_ACTION
1683 {
1684 /// <summary>
1685 /// Instructs the engine to not take any special action.
1686 /// </summary>
1687 None,
1688
1689 /// <summary>
1690 /// Instructs the engine to try the acquisition of the payload again.
1691 /// Ignored if hrStatus is a success.
1692 /// </summary>
1693 Retry,
1694 }
1695
1696 /// <summary>
1697 /// The available actions for <see cref="IDefaultBootstrapperApplication.CachePackageComplete"/>.
1698 /// </summary>
1699 public enum BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION
1700 {
1701 /// <summary>
1702 /// Instructs the engine to not take any special action.
1703 /// </summary>
1704 None,
1705
1706 /// <summary>
1707 /// Instructs the engine to ignore non-vital package failures and continue with the caching.
1708 /// Ignored if hrStatus is a success or the package is vital.
1709 /// </summary>
1710 Ignore,
1711
1712 /// <summary>
1713 /// Instructs the engine to try the acquisition and verification of the package again.
1714 /// Ignored if hrStatus is a success.
1715 /// </summary>
1716 Retry,
1717 }
1718
1719 /// <summary>
1720 /// The available actions for <see cref="IDefaultBootstrapperApplication.CachePackageNonVitalValidationFailure"/>
1721 /// </summary>
1722 public enum BOOTSTRAPPER_CACHEPACKAGENONVITALVALIDATIONFAILURE_ACTION
1723 {
1724 /// <summary>
1725 /// Instructs the engine to not take any special action.
1726 /// </summary>
1727 None,
1728
1729 /// <summary>
1730 /// Instructs the engine to try to acquire the package so execution can use it.
1731 /// Most of the time this is used for installing the package during rollback.
1732 /// </summary>
1733 Acquire,
1734 }
1735
1736 /// <summary>
1737 /// The available actions for <see cref="IDefaultBootstrapperApplication.CacheVerifyComplete"/>.
1738 /// </summary>
1739 public enum BOOTSTRAPPER_CACHEVERIFYCOMPLETE_ACTION
1740 {
1741 /// <summary>
1742 /// Instructs the engine to not take any special action.
1743 /// </summary>
1744 None,
1745
1746 /// <summary>
1747 /// Ignored if hrStatus is a success.
1748 /// </summary>
1749 RetryVerification,
1750
1751 /// <summary>
1752 /// Ignored if hrStatus is a success.
1753 /// </summary>
1754 RetryAcquisition,
1755 }
1756
1757 /// <summary>
1758 /// The available actions for <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
1759 /// </summary>
1760 public enum BOOTSTRAPPER_EXECUTEPACKAGECOMPLETE_ACTION
1761 {
1762 /// <summary>
1763 /// Instructs the engine to not take any special action.
1764 /// </summary>
1765 None,
1766
1767 /// <summary>
1768 /// Instructs the engine to ignore non-vital package failures and continue with the install.
1769 /// Ignored if hrStatus is a success or the package is vital.
1770 /// </summary>
1771 Ignore,
1772
1773 /// <summary>
1774 /// Instructs the engine to try the execution of the package again.
1775 /// Ignored if hrStatus is a success.
1776 /// </summary>
1777 Retry,
1778
1779 /// <summary>
1780 /// Instructs the engine to stop processing the chain and restart.
1781 /// The engine will launch again after the machine is restarted.
1782 /// </summary>
1783 Restart,
1784
1785 /// <summary>
1786 /// Instructs the engine to stop processing the chain and suspend the current state.
1787 /// </summary>
1788 Suspend,
1789 }
1790
1791 /// <summary>
1792 /// The available actions for <see cref="IDefaultBootstrapperApplication.CommitMsiTransactionComplete"/> and <see cref="IDefaultBootstrapperApplication.RollbackMsiTransactionComplete"/>.
1793 /// </summary>
1794 public enum BOOTSTRAPPER_EXECUTEMSITRANSACTIONCOMPLETE_ACTION
1795 {
1796 /// <summary>
1797 /// Instructs the engine to not take any special action.
1798 /// </summary>
1799 None,
1800
1801 /// <summary>
1802 /// Instructs the engine to stop processing the chain and restart.
1803 /// The engine will launch again after the machine is restarted.
1804 /// </summary>
1805 Restart,
1806 };
1807
1808 /// <summary>
1809 /// The available actions for <see cref="IDefaultBootstrapperApplication.ExecuteProcessCancel"/>.
1810 /// </summary>
1811 public enum BOOTSTRAPPER_EXECUTEPROCESSCANCEL_ACTION
1812 {
1813 /// <summary>
1814 /// Instructs the engine to stop waiting for the process to exit.
1815 /// The package is immediately considered to have failed with ERROR_INSTALL_USEREXIT.
1816 /// The engine will never rollback the package.
1817 /// </summary>
1818 Abandon,
1819
1820 /// <summary>
1821 /// Instructs the engine to wait for the process to exit.
1822 /// Once the process has exited, the package is considered to have failed with ERROR_INSTALL_USEREXIT.
1823 /// This allows the engine to rollback the package if necessary.
1824 /// </summary>
1825 Wait,
1826 }
1827
1828 /// <summary>
1829 /// The result of evaluating a condition from a package.
1830 /// </summary>
1831 public enum BOOTSTRAPPER_PACKAGE_CONDITION_RESULT
1832 {
1833 /// <summary>
1834 /// No condition was authored.
1835 /// </summary>
1836 Default,
1837
1838 /// <summary>
1839 /// Evaluated to false.
1840 /// </summary>
1841 False,
1842
1843 /// <summary>
1844 /// Evaluated to true.
1845 /// </summary>
1846 True,
1847 }
1848
1849 /// <summary>
1850 /// The available actions for <see cref="IDefaultBootstrapperApplication.CacheAcquireResolving"/>.
1851 /// </summary>
1852 public enum BOOTSTRAPPER_RESOLVESOURCE_ACTION
1853 {
1854 /// <summary>
1855 /// Instructs the engine that the source can't be found.
1856 /// </summary>
1857 None,
1858
1859 /// <summary>
1860 /// Instructs the engine to try the local source again.
1861 /// </summary>
1862 Retry,
1863
1864 /// <summary>
1865 /// Instructs the engine to try the download source.
1866 /// </summary>
1867 Download,
1868 }
1869
1870 /// <summary>
1871 /// The available actions for <see cref="IDefaultBootstrapperApplication.Shutdown"/>.
1872 /// </summary>
1873 public enum BOOTSTRAPPER_SHUTDOWN_ACTION
1874 {
1875 /// <summary>
1876 /// Instructs the engine to not take any special action.
1877 /// </summary>
1878 None,
1879
1880 /// <summary>
1881 /// Instructs the engine to restart.
1882 /// The engine will not launch again after the machine is rebooted.
1883 /// Ignored if reboot was already initiated by <see cref="IDefaultBootstrapperApplication.ExecutePackageComplete"/>.
1884 /// </summary>
1885 Restart,
1886
1887 /// <summary>
1888 /// Instructs the engine to unload the bootstrapper application and
1889 /// restart the engine which will load the bootstrapper application again.
1890 /// Typically used to switch from a native bootstrapper application to a managed one.
1891 /// </summary>
1892 ReloadBootstrapper,
1893
1894 /// <summary>
1895 /// Opts out of the engine behavior of trying to uninstall itself when no non-permanent packages are installed.
1896 /// </summary>
1897 SkipCleanup,
1898 }
1899
1900 /// <summary>
1901 /// The file versioning options for REINSTALLMODE, see https://docs.microsoft.com/en-us/windows/win32/msi/reinstallmode.
1902 /// </summary>
1903 public enum BOOTSTRAPPER_MSI_FILE_VERSIONING
1904 {
1905 /// <summary>
1906 /// o
1907 /// </summary>
1908 Older,
1909 /// <summary>
1910 /// e
1911 /// </summary>
1912 Equal,
1913 /// <summary>
1914 /// a
1915 /// </summary>
1916 All,
1917 }
1918
1919 /// <summary>
1920 /// The property Burn will add so the MSI can know the planned action for the package.
1921 /// </summary>
1922 public enum BURN_MSI_PROPERTY
1923 {
1924 /// <summary>
1925 /// No property will be added.
1926 /// </summary>
1927 None,
1928
1929 /// <summary>
1930 /// Add BURNMSIINSTALL=1
1931 /// </summary>
1932 Install,
1933
1934 /// <summary>
1935 /// Add BURNMSIMODFIY=1
1936 /// </summary>
1937 Modify,
1938
1939 /// <summary>
1940 /// Add BURNMSIREPAIR=1
1941 /// </summary>
1942 Repair,
1943
1944 /// <summary>
1945 /// Add BURNMSIUNINSTALL=1
1946 /// </summary>
1947 Uninstall,
1948 }
1949
1950 /// <summary>
1951 /// From msi.h
1952 /// https://docs.microsoft.com/en-us/windows/win32/api/msi/nf-msi-msisetinternalui
1953 /// </summary>
1954 [Flags]
1955 public enum INSTALLUILEVEL
1956 {
1957 /// <summary>
1958 /// UI level is unchanged
1959 /// </summary>
1960 NoChange = 0,
1961
1962 /// <summary>
1963 /// default UI is used
1964 /// </summary>
1965 Default = 1,
1966
1967 /// <summary>
1968 /// completely silent installation
1969 /// </summary>
1970 None = 2,
1971
1972 /// <summary>
1973 /// simple progress and error handling
1974 /// </summary>
1975 Basic = 3,
1976
1977 /// <summary>
1978 /// authored UI, wizard dialogs suppressed
1979 /// </summary>
1980 Reduced = 4,
1981
1982 /// <summary>
1983 /// authored UI with wizards, progress, errors
1984 /// </summary>
1985 Full = 5,
1986
1987 /// <summary>
1988 /// display success/failure dialog at end of install
1989 /// </summary>
1990 EndDialog = 0x80,
1991
1992 /// <summary>
1993 /// display only progress dialog
1994 /// </summary>
1995 ProgressOnly = 0x40,
1996
1997 /// <summary>
1998 /// do not display the cancel button in basic UI
1999 /// </summary>
2000 HideCancel = 0x20,
2001
2002 /// <summary>
2003 /// force display of source resolution even if quiet
2004 /// </summary>
2005 SourceResOnly = 0x100,
2006
2007 /// <summary>
2008 /// show UAC prompt even if quiet
2009 /// Can only be used if on Windows Installer 5.0 or later
2010 /// </summary>
2011 UacOnly = 0x200,
2012 }
2013}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplicationData.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplicationData.cs
new file mode 100644
index 00000000..d26d89c1
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/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.BootstrapperApplicationApi
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}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplicationFactory.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplicationFactory.cs
new file mode 100644
index 00000000..ac90c0b7
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperApplicationFactory.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.BootstrapperApplicationApi
4{
5 using System;
6 using System.CodeDom.Compiler;
7 using System.Runtime.InteropServices;
8
9 /// <summary>
10 /// This is no longer used.
11 /// </summary>
12 [Obsolete("Bootstrapper applications now run out of proc and do not use a BootstrapperApplicationFactory. Remove your BootstrapperApplicationFactory class. See https://wixtoolset.org/docs/fiveforfour/ for more details.")]
13 public interface IBootstrapperApplicationFactory
14 {
15 /// <summary>
16 /// This is no longer used.
17 /// </summary>
18 /// <param name="pArgs">This is no longer used.</param>
19 /// <param name="pResults">This is no longer used.</param>
20 void Create(IntPtr pArgs, IntPtr pResults);
21 }
22}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs
new file mode 100644
index 00000000..a1f8bfe0
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperCommand.cs
@@ -0,0 +1,79 @@
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.BootstrapperApplicationApi
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 command line arguments.
24 /// </summary>
25 /// <returns>
26 /// Command line arguments not handled by the engine.
27 /// </returns>
28 string CommandLine { get; }
29
30 /// <summary>
31 /// Hint for the initial visibility of the window.
32 /// </summary>
33 int CmdShow { get; }
34
35 /// <summary>
36 /// Gets the method of how the engine was resumed from a previous installation step.
37 /// </summary>
38 ResumeType Resume { get; }
39
40 /// <summary>
41 /// Gets the handle to the splash screen window. If no splash screen was displayed this value will be IntPtr.Zero.
42 /// </summary>
43 IntPtr SplashScreen { get; }
44
45 /// <summary>
46 /// If this was run from a related bundle, specifies the relation type.
47 /// </summary>
48 RelationType Relation { get; }
49
50 /// <summary>
51 /// If this was run from a backward compatible bundle.
52 /// </summary>
53 bool Passthrough { get; }
54
55 /// <summary>
56 /// Gets layout directory.
57 /// </summary>
58 string LayoutDirectory { get; }
59
60 /// <summary>
61 /// Gets bootstrapper working folder.
62 /// </summary>
63 string BootstrapperWorkingFolder { get; }
64
65 /// <summary>
66 /// Gets path to BootstrapperApplicationData.xml.
67 /// </summary>
68 string BootstrapperApplicationDataPath { get; }
69
70 /// <summary>
71 /// Parses the command line arguments into an <see cref="IMbaCommand"/>.
72 /// </summary>
73 /// <returns>
74 /// The parsed information.
75 /// </returns>
76 /// <exception type="Win32Exception">The command line could not be parsed.</exception>
77 IMbaCommand ParseCommandLine();
78 }
79}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs
new file mode 100644
index 00000000..1e91cd31
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBootstrapperEngine.cs
@@ -0,0 +1,501 @@
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.BootstrapperApplicationApi
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 void GetPackageCount(
23 [MarshalAs(UnmanagedType.U4)] out int pcPackages
24 );
25
26 /// <summary>
27 /// See <see cref="IEngine.GetVariableNumeric(string)"/>.
28 /// </summary>
29 [PreserveSig]
30 int GetVariableNumeric(
31 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
32 out long pllValue
33 );
34
35 /// <summary>
36 /// See <see cref="IEngine.GetVariableString(string)"/>.
37 /// </summary>
38 [PreserveSig]
39 int GetVariableString(
40 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
41 IntPtr wzValue,
42 ref IntPtr pcchValue
43 );
44
45 /// <summary>
46 /// See <see cref="IEngine.GetVariableVersion(string)"/>.
47 /// </summary>
48 [PreserveSig]
49 int GetVariableVersion(
50 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
51 IntPtr wzValue,
52 ref IntPtr pcchValue
53 );
54
55 /// <summary>
56 /// See <see cref="IEngine.FormatString(string)"/>.
57 /// </summary>
58 [PreserveSig]
59 int FormatString(
60 [MarshalAs(UnmanagedType.LPWStr)] string wzIn,
61 [MarshalAs(UnmanagedType.LPWStr), Out] StringBuilder wzOut,
62 ref IntPtr pcchOut
63 );
64
65 /// <summary>
66 /// See <see cref="IEngine.EscapeString(string)"/>.
67 /// </summary>
68 [PreserveSig]
69 int EscapeString(
70 [MarshalAs(UnmanagedType.LPWStr)] string wzIn,
71 [MarshalAs(UnmanagedType.LPWStr), Out] StringBuilder wzOut,
72 ref IntPtr pcchOut
73 );
74
75 /// <summary>
76 /// See <see cref="IEngine.EvaluateCondition(string)"/>.
77 /// </summary>
78 void EvaluateCondition(
79 [MarshalAs(UnmanagedType.LPWStr)] string wzCondition,
80 [MarshalAs(UnmanagedType.Bool)] out bool pf
81 );
82
83 /// <summary>
84 /// See <see cref="IEngine.Log(LogLevel, string)"/>.
85 /// </summary>
86 void Log(
87 [MarshalAs(UnmanagedType.U4)] LogLevel level,
88 [MarshalAs(UnmanagedType.LPWStr)] string wzMessage
89 );
90
91 /// <summary>
92 /// See <see cref="IEngine.SendEmbeddedError(int, string, int)"/>.
93 /// </summary>
94 void SendEmbeddedError(
95 [MarshalAs(UnmanagedType.U4)] int dwErrorCode,
96 [MarshalAs(UnmanagedType.LPWStr)] string wzMessage,
97 [MarshalAs(UnmanagedType.U4)] int dwUIHint,
98 [MarshalAs(UnmanagedType.I4)] out int pnResult
99 );
100
101 /// <summary>
102 /// See <see cref="IEngine.SendEmbeddedProgress(int, int)"/>.
103 /// </summary>
104 void SendEmbeddedProgress(
105 [MarshalAs(UnmanagedType.U4)] int dwProgressPercentage,
106 [MarshalAs(UnmanagedType.U4)] int dwOverallProgressPercentage,
107 [MarshalAs(UnmanagedType.I4)] out int pnResult
108 );
109
110 /// <summary>
111 /// See <see cref="IEngine.SetUpdate(string, string, long, UpdateHashType, string, string)"/>.
112 /// </summary>
113 void SetUpdate(
114 [MarshalAs(UnmanagedType.LPWStr)] string wzLocalSource,
115 [MarshalAs(UnmanagedType.LPWStr)] string wzDownloadSource,
116 [MarshalAs(UnmanagedType.U8)] long qwValue,
117 [MarshalAs(UnmanagedType.U4)] UpdateHashType hashType,
118 [MarshalAs(UnmanagedType.LPWStr)] string wzHash,
119 [MarshalAs(UnmanagedType.LPWStr)] string wzUpdatePackageId
120 );
121
122 /// <summary>
123 /// See <see cref="IEngine.SetLocalSource(string, string, string)"/>.
124 /// </summary>
125 void SetLocalSource(
126 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
127 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
128 [MarshalAs(UnmanagedType.LPWStr)] string wzPath
129 );
130
131 /// <summary>
132 /// See <see cref="IEngine.SetDownloadSource(string, string, string, string, string)"/>.
133 /// </summary>
134 void SetDownloadSource(
135 [MarshalAs(UnmanagedType.LPWStr)] string wzPackageOrContainerId,
136 [MarshalAs(UnmanagedType.LPWStr)] string wzPayloadId,
137 [MarshalAs(UnmanagedType.LPWStr)] string wzUrl,
138 [MarshalAs(UnmanagedType.LPWStr)] string wzUser,
139 [MarshalAs(UnmanagedType.LPWStr)] string wzPassword
140 );
141
142 /// <summary>
143 /// See <see cref="IEngine.SetVariableNumeric(string, long)"/>.
144 /// </summary>
145 void SetVariableNumeric(
146 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
147 long llValue
148 );
149
150 /// <summary>
151 /// See <see cref="IEngine.SetVariableString(string, string, bool)"/>.
152 /// </summary>
153 void SetVariableString(
154 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
155 IntPtr wzValue,
156 [MarshalAs(UnmanagedType.Bool)] bool fFormatted
157 );
158
159 /// <summary>
160 /// See <see cref="IEngine.SetVariableVersion(string, string)"/>.
161 /// </summary>
162 void SetVariableVersion(
163 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
164 IntPtr wzValue
165 );
166
167 /// <summary>
168 /// See <see cref="IEngine.CloseSplashScreen"/>.
169 /// </summary>
170 void CloseSplashScreen();
171
172 /// <summary>
173 /// See <see cref="IEngine.Detect(IntPtr)"/>.
174 /// </summary>
175 void Detect(
176 IntPtr hwndParent
177 );
178
179 /// <summary>
180 /// See <see cref="IEngine.Plan(LaunchAction)"/>.
181 /// </summary>
182 void Plan(
183 [MarshalAs(UnmanagedType.U4)] LaunchAction action
184 );
185
186 /// <summary>
187 /// See <see cref="IEngine.Elevate(IntPtr)"/>.
188 /// </summary>
189 [PreserveSig]
190 int Elevate(
191 IntPtr hwndParent
192 );
193
194 /// <summary>
195 /// See <see cref="IEngine.Apply(IntPtr)"/>.
196 /// </summary>
197 void Apply(
198 IntPtr hwndParent
199 );
200
201 /// <summary>
202 /// See <see cref="IEngine.Quit(int)"/>.
203 /// </summary>
204 void Quit(
205 [MarshalAs(UnmanagedType.U4)] int dwExitCode
206 );
207
208 /// <summary>
209 /// See <see cref="IEngine.LaunchApprovedExe(IntPtr, string, string, int)"/>.
210 /// </summary>
211 void LaunchApprovedExe(
212 IntPtr hwndParent,
213 [MarshalAs(UnmanagedType.LPWStr)] string wzApprovedExeForElevationId,
214 [MarshalAs(UnmanagedType.LPWStr)] string wzArguments,
215 [MarshalAs(UnmanagedType.U4)] int dwWaitForInputIdleTimeout
216 );
217
218 /// <summary>
219 /// Sets the URL to the update feed.
220 /// </summary>
221 void SetUpdateSource(
222 [MarshalAs(UnmanagedType.LPWStr)] string url
223 );
224
225 /// <summary>
226 /// See <see cref="IEngine.CompareVersions(string, string)"/>.
227 /// </summary>
228 void CompareVersions(
229 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion1,
230 [MarshalAs(UnmanagedType.LPWStr)] string wzVersion2,
231 [MarshalAs(UnmanagedType.I4)] out int pnResult
232 );
233
234 /// <summary>
235 /// See <see cref="IEngine.GetRelatedBundleVariable(string, string)"/>.
236 /// </summary>
237 [PreserveSig]
238 int GetRelatedBundleVariable(
239 [MarshalAs(UnmanagedType.LPWStr)] string wzBundleId,
240 [MarshalAs(UnmanagedType.LPWStr)] string wzVariable,
241 IntPtr wzValue,
242 ref IntPtr pcchValue
243 );
244 }
245
246 /// <summary>
247 /// The installation action for the bundle or current package.
248 /// </summary>
249 public enum ActionState
250 {
251 /// <summary>
252 /// No action.
253 /// </summary>
254 None,
255
256 /// <summary>
257 /// Uninstall action.
258 /// </summary>
259 Uninstall,
260
261 /// <summary>
262 /// Install action.
263 /// </summary>
264 Install,
265
266 /// <summary>
267 /// Modify action.
268 /// </summary>
269 Modify,
270
271 /// <summary>
272 /// Repair action.
273 /// </summary>
274 Repair,
275
276 /// <summary>
277 /// Minor upgrade action.
278 /// </summary>
279 MinorUpgrade,
280 }
281
282 /// <summary>
283 /// The action for the bundle to perform.
284 /// </summary>
285 public enum LaunchAction
286 {
287 /// <summary>
288 /// Invalid action.
289 /// </summary>
290 Unknown,
291
292 /// <summary>
293 /// Provide help information.
294 /// </summary>
295 Help,
296
297 /// <summary>
298 /// Layout the bundle on disk, normally to prepare for offline installation.
299 /// </summary>
300 Layout,
301
302 /// <summary>
303 /// Same as Uninstall, except it will always remove itself from the package cache and Add/Remove Programs.
304 /// This should only be used to remove corrupt bundles since it might not properly clean up its packages.
305 /// </summary>
306 UnsafeUninstall,
307
308 /// <summary>
309 /// Uninstall the bundle.
310 /// </summary>
311 Uninstall,
312
313 /// <summary>
314 /// Cache the bundle and its packages.
315 /// </summary>
316 Cache,
317
318 /// <summary>
319 /// Install the bundle.
320 /// </summary>
321 Install,
322
323 /// <summary>
324 /// Modify the bundle.
325 /// </summary>
326 Modify,
327
328 /// <summary>
329 /// Repair the bundle
330 /// </summary>
331 Repair,
332
333 /// <summary>
334 /// Launch the update registered with <see cref="IEngine.SetUpdate(string, string, long, UpdateHashType, string, string)"/> and then exit without waiting for it to complete.
335 /// </summary>
336 UpdateReplace,
337
338 /// <summary>
339 /// Launch the update registered with <see cref="IEngine.SetUpdate(string, string, long, UpdateHashType, string, string)"/> as an embedded bundle.
340 /// </summary>
341 UpdateReplaceEmbedded,
342 }
343
344 /// <summary>
345 /// The message log level.
346 /// </summary>
347 public enum LogLevel
348 {
349 /// <summary>
350 /// No logging level (generic).
351 /// </summary>
352 None,
353
354 /// <summary>
355 /// User messages.
356 /// </summary>
357 Standard,
358
359 /// <summary>
360 /// Verbose messages.
361 /// </summary>
362 Verbose,
363
364 /// <summary>
365 /// Messages for debugging.
366 /// </summary>
367 Debug,
368
369 /// <summary>
370 /// Error messages.
371 /// </summary>
372 Error,
373 }
374
375 /// <summary>
376 /// Type of hash used for update bundle.
377 /// </summary>
378 public enum UpdateHashType
379 {
380 /// <summary>
381 /// No hash provided.
382 /// </summary>
383 None,
384
385 /// <summary>
386 /// SHA-512 based hash provided.
387 /// </summary>
388 Sha512,
389 }
390
391 /// <summary>
392 /// Describes the state of an installation package.
393 /// </summary>
394 public enum PackageState
395 {
396 /// <summary>
397 /// Invalid state.
398 /// </summary>
399 Unknown,
400
401 /// <summary>
402 /// The package is not on the machine (except possibly MspPackage) and should not be installed.
403 /// </summary>
404 Obsolete,
405
406 /// <summary>
407 /// The package is not installed.
408 /// </summary>
409 Absent,
410
411 /// <summary>
412 /// The package is installed.
413 /// </summary>
414 Present,
415
416 /// <summary>
417 /// The package is on the machine but not active, so only uninstall operations are allowed.
418 /// </summary>
419 Superseded,
420
421 /// <summary>
422 /// This value is no longer used. See the DetectPackageCompleteEventArgs.Cached value instead.
423 /// </summary>
424 [Obsolete("Use DetectPackageCompleteEventArgs.Cached instead.")]
425 Cached = Present,
426 }
427
428 /// <summary>
429 /// Indicates the state desired for an installation package.
430 /// </summary>
431 public enum RequestState
432 {
433 /// <summary>
434 /// No change requested.
435 /// </summary>
436 None,
437
438 /// <summary>
439 /// As long as there are no dependents, the package will be uninstalled.
440 /// There are some packages that can't be uninstalled, such as an ExePackage without an UninstallCommand.
441 /// </summary>
442 ForceAbsent,
443
444 /// <summary>
445 /// Request the package to not be installed on the machine.
446 /// </summary>
447 Absent,
448
449 /// <summary>
450 /// Request the package to be cached and not be installed on the machine.
451 /// </summary>
452 Cache,
453
454 /// <summary>
455 /// Request the package to be installed on the machine.
456 /// </summary>
457 Present,
458
459 /// <summary>
460 /// Force the bundle to install the package.
461 /// </summary>
462 ForcePresent,
463
464 /// <summary>
465 /// Request the package to be repaired.
466 /// </summary>
467 Repair,
468 }
469
470 /// <summary>
471 /// Indicates the state of a feature.
472 /// See https://learn.microsoft.com/en-us/windows/win32/api/msi/nf-msi-msiqueryfeaturestatew.
473 /// </summary>
474 public enum FeatureState
475 {
476 /// <summary>
477 /// Invalid state.
478 /// </summary>
479 Unknown,
480
481 /// <summary>
482 /// INSTALLSTATE_ABSENT
483 /// </summary>
484 Absent,
485
486 /// <summary>
487 /// INSTALLSTATE_ADVERTISED
488 /// </summary>
489 Advertised,
490
491 /// <summary>
492 /// INSTALLSTATE_LOCAL
493 /// </summary>
494 Local,
495
496 /// <summary>
497 /// INSTALLSTATE_SOURCE
498 /// </summary>
499 Source,
500 }
501}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IBundleInfo.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBundleInfo.cs
new file mode 100644
index 00000000..a4d07597
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IBundleInfo.cs
@@ -0,0 +1,54 @@
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.BootstrapperApplicationApi
4{
5 using System.Collections.Generic;
6
7 /// <summary>
8 /// BA manifest data.
9 /// </summary>
10 public interface IBundleInfo
11 {
12 /// <summary>
13 /// The name of the variable that contains the path to the bundle's log.
14 /// </summary>
15 string LogVariable { get; }
16
17 /// <summary>
18 /// Bundle/@Name
19 /// </summary>
20 string Name { get; }
21
22 /// <summary>
23 /// Variables that were marked with bal:Overridable="yes".
24 /// </summary>
25 IOverridableVariables OverridableVariables { get; }
26
27 /// <summary>
28 /// The packages in the bundle's chain.
29 /// </summary>
30 IDictionary<string, IPackageInfo> Packages { get; }
31
32 /// <summary>
33 /// Whether the bundle is per-machine or per-user.
34 /// </summary>
35 bool PerMachine { get; }
36
37 /// <summary>
38 /// Adds a related bundle as a package.
39 /// </summary>
40 /// <param name="productCode"></param>
41 /// <param name="relationType"></param>
42 /// <param name="perMachine"></param>
43 /// <param name="version"></param>
44 /// <returns>The created <see cref="IPackageInfo"/>.</returns>
45 IPackageInfo AddRelatedBundleAsPackage(string productCode, RelationType relationType, bool perMachine, string version);
46
47 /// <summary>
48 /// Adds an update bundle as a package.
49 /// </summary>
50 /// <param name="packageId">Package id added as update bundle.</param>
51 /// <returns>The created <see cref="IPackageInfo"/>.</returns>
52 IPackageInfo AddUpdateBundleAsPackage(string packageId);
53 }
54}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IDefaultBootstrapperApplication.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IDefaultBootstrapperApplication.cs
new file mode 100644
index 00000000..ad51b2be
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IDefaultBootstrapperApplication.cs
@@ -0,0 +1,436 @@
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.BootstrapperApplicationApi
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 plan determined that nothing should happen to prevent downgrading.
24 /// </summary>
25 event EventHandler<ApplyDowngradeEventArgs> ApplyDowngrade;
26
27 /// <summary>
28 /// Fired when the engine is about to begin an MSI transaction.
29 /// </summary>
30 event EventHandler<BeginMsiTransactionBeginEventArgs> BeginMsiTransactionBegin;
31
32 /// <summary>
33 /// Fired when the engine has completed beginning an MSI transaction.
34 /// </summary>
35 event EventHandler<BeginMsiTransactionCompleteEventArgs> BeginMsiTransactionComplete;
36
37 /// <summary>
38 /// Fired when the engine has begun acquiring the payload or container.
39 /// The BA can change the source using <see cref="IEngine.SetLocalSource(String, String, String)"/>
40 /// or <see cref="IEngine.SetDownloadSource(String, String, String, String, String)"/>.
41 /// </summary>
42 event EventHandler<CacheAcquireBeginEventArgs> CacheAcquireBegin;
43
44 /// <summary>
45 /// Fired when the engine has completed the acquisition of the payload or container.
46 /// The BA can change the source using <see cref="IEngine.SetLocalSource(String, String, String)"/>
47 /// or <see cref="IEngine.SetDownloadSource(String, String, String, String, String)"/>.
48 /// </summary>
49 event EventHandler<CacheAcquireCompleteEventArgs> CacheAcquireComplete;
50
51 /// <summary>
52 /// Fired when the engine has progress acquiring the payload or container.
53 /// </summary>
54 event EventHandler<CacheAcquireProgressEventArgs> CacheAcquireProgress;
55
56 /// <summary>
57 /// Fired by the engine to allow the BA to override the acquisition action.
58 /// </summary>
59 event EventHandler<CacheAcquireResolvingEventArgs> CacheAcquireResolving;
60
61 /// <summary>
62 /// Fired when the engine has begun caching the installation sources.
63 /// </summary>
64 event EventHandler<CacheBeginEventArgs> CacheBegin;
65
66 /// <summary>
67 /// Fired after the engine has cached the installation sources.
68 /// </summary>
69 event EventHandler<CacheCompleteEventArgs> CacheComplete;
70
71 /// <summary>
72 /// Fired when the engine begins the verification of the payload or container that was already in the package cache.
73 /// </summary>
74 event EventHandler<CacheContainerOrPayloadVerifyBeginEventArgs> CacheContainerOrPayloadVerifyBegin;
75
76 /// <summary>
77 /// Fired when the engine has completed the verification of the payload or container that was already in the package cache.
78 /// </summary>
79 event EventHandler<CacheContainerOrPayloadVerifyCompleteEventArgs> CacheContainerOrPayloadVerifyComplete;
80
81 /// <summary>
82 /// Fired when the engine has progress verifying the payload or container that was already in the package cache.
83 /// </summary>
84 event EventHandler<CacheContainerOrPayloadVerifyProgressEventArgs> CacheContainerOrPayloadVerifyProgress;
85
86 /// <summary>
87 /// Fired when the engine has begun caching a specific package.
88 /// </summary>
89 event EventHandler<CachePackageBeginEventArgs> CachePackageBegin;
90
91 /// <summary>
92 /// Fired when the engine has completed caching a specific package.
93 /// </summary>
94 event EventHandler<CachePackageCompleteEventArgs> CachePackageComplete;
95
96 /// <summary>
97 /// Fired when the engine failed validating a package in the package cache that is non-vital to execution.
98 /// </summary>
99 event EventHandler<CachePackageNonVitalValidationFailureEventArgs> CachePackageNonVitalValidationFailure;
100
101 /// <summary>
102 /// Fired when the engine begins the extraction of the payload from the container.
103 /// </summary>
104 event EventHandler<CachePayloadExtractBeginEventArgs> CachePayloadExtractBegin;
105
106 /// <summary>
107 /// Fired when the engine has completed the extraction of the payload from the container.
108 /// </summary>
109 event EventHandler<CachePayloadExtractCompleteEventArgs> CachePayloadExtractComplete;
110
111 /// <summary>
112 /// Fired when the engine has progress extracting the payload from the container.
113 /// </summary>
114 event EventHandler<CachePayloadExtractProgressEventArgs> CachePayloadExtractProgress;
115
116 /// <summary>
117 /// Fired when the engine begins the verification of the acquired payload or container.
118 /// </summary>
119 event EventHandler<CacheVerifyBeginEventArgs> CacheVerifyBegin;
120
121 /// <summary>
122 /// Fired when the engine has completed the verification of the acquired payload or container.
123 /// </summary>
124 event EventHandler<CacheVerifyCompleteEventArgs> CacheVerifyComplete;
125
126 /// <summary>
127 /// Fired when the engine has progress verifying the payload or container.
128 /// </summary>
129 event EventHandler<CacheVerifyProgressEventArgs> CacheVerifyProgress;
130
131 /// <summary>
132 /// Fired when the engine is about to commit an MSI transaction.
133 /// </summary>
134 event EventHandler<CommitMsiTransactionBeginEventArgs> CommitMsiTransactionBegin;
135
136 /// <summary>
137 /// Fired when the engine has completed comitting an MSI transaction.
138 /// </summary>
139 event EventHandler<CommitMsiTransactionCompleteEventArgs> CommitMsiTransactionComplete;
140
141 /// <summary>
142 /// Fired when the application is being created.
143 /// </summary>
144 event EventHandler<CreateEventArgs> Create;
145
146 /// <summary>
147 /// Fired when the application is being destroyed.
148 /// </summary>
149 event EventHandler<DestroyEventArgs> Destroy;
150
151 /// <summary>
152 /// Fired when the overall detection phase has begun.
153 /// </summary>
154 event EventHandler<DetectBeginEventArgs> DetectBegin;
155
156 /// <summary>
157 /// Fired when a package was not detected but a package using the same provider key was.
158 /// </summary>
159 event EventHandler<DetectCompatibleMsiPackageEventArgs> DetectCompatibleMsiPackage;
160
161 /// <summary>
162 /// Fired when the detection phase has completed.
163 /// </summary>
164 event EventHandler<DetectCompleteEventArgs> DetectComplete;
165
166 /// <summary>
167 /// Fired when a forward compatible bundle is detected.
168 /// </summary>
169 event EventHandler<DetectForwardCompatibleBundleEventArgs> DetectForwardCompatibleBundle;
170
171 /// <summary>
172 /// Fired when a feature in an MSI package has been detected.
173 /// </summary>
174 event EventHandler<DetectMsiFeatureEventArgs> DetectMsiFeature;
175
176 /// <summary>
177 /// Fired when the detection for a specific package has begun.
178 /// </summary>
179 event EventHandler<DetectPackageBeginEventArgs> DetectPackageBegin;
180
181 /// <summary>
182 /// Fired when the detection for a specific package has completed.
183 /// </summary>
184 event EventHandler<DetectPackageCompleteEventArgs> DetectPackageComplete;
185
186 /// <summary>
187 /// Fired when the engine detects a target product for an MSP package.
188 /// </summary>
189 event EventHandler<DetectPatchTargetEventArgs> DetectPatchTarget;
190
191 /// <summary>
192 /// Fired when a related bundle has been detected for a bundle.
193 /// </summary>
194 event EventHandler<DetectRelatedBundleEventArgs> DetectRelatedBundle;
195
196 /// <summary>
197 /// Fired when a related bundle has been detected for a bundle package.
198 /// </summary>
199 event EventHandler<DetectRelatedBundlePackageEventArgs> DetectRelatedBundlePackage;
200
201 /// <summary>
202 /// Fired when a related MSI package has been detected for a package.
203 /// </summary>
204 event EventHandler<DetectRelatedMsiPackageEventArgs> DetectRelatedMsiPackage;
205
206 /// <summary>
207 /// Fired when the update detection has found a potential update candidate.
208 /// </summary>
209 event EventHandler<DetectUpdateEventArgs> DetectUpdate;
210
211 /// <summary>
212 /// Fired when the update detection phase has begun.
213 /// </summary>
214 event EventHandler<DetectUpdateBeginEventArgs> DetectUpdateBegin;
215
216 /// <summary>
217 /// Fired when the update detection phase has completed.
218 /// </summary>
219 event EventHandler<DetectUpdateCompleteEventArgs> DetectUpdateComplete;
220
221 /// <summary>
222 /// Fired when the engine is about to start the elevated process.
223 /// </summary>
224 event EventHandler<ElevateBeginEventArgs> ElevateBegin;
225
226 /// <summary>
227 /// Fired when the engine has completed starting the elevated process.
228 /// </summary>
229 event EventHandler<ElevateCompleteEventArgs> ElevateComplete;
230
231 /// <summary>
232 /// Fired when the engine has encountered an error.
233 /// </summary>
234 event EventHandler<ErrorEventArgs> Error;
235
236 /// <summary>
237 /// Fired when the engine has begun installing packages.
238 /// </summary>
239 event EventHandler<ExecuteBeginEventArgs> ExecuteBegin;
240
241 /// <summary>
242 /// Fired when the engine has completed installing packages.
243 /// </summary>
244 event EventHandler<ExecuteCompleteEventArgs> ExecuteComplete;
245
246 /// <summary>
247 /// Fired when a package sends a files in use installation message.
248 /// </summary>
249 event EventHandler<ExecuteFilesInUseEventArgs> ExecuteFilesInUse;
250
251 /// <summary>
252 /// Fired when Windows Installer sends an installation message.
253 /// </summary>
254 event EventHandler<ExecuteMsiMessageEventArgs> ExecuteMsiMessage;
255
256 /// <summary>
257 /// Fired when the engine has begun installing a specific package.
258 /// </summary>
259 event EventHandler<ExecutePackageBeginEventArgs> ExecutePackageBegin;
260
261 /// <summary>
262 /// Fired when the engine has completed installing a specific package.
263 /// </summary>
264 event EventHandler<ExecutePackageCompleteEventArgs> ExecutePackageComplete;
265
266 /// <summary>
267 /// Fired when a package that spawned a process is cancelled.
268 /// </summary>
269 event EventHandler<ExecuteProcessCancelEventArgs> ExecuteProcessCancel;
270
271 /// <summary>
272 /// Fired when the engine executes one or more patches targeting a product.
273 /// </summary>
274 event EventHandler<ExecutePatchTargetEventArgs> ExecutePatchTarget;
275
276 /// <summary>
277 /// Fired by the engine while executing a package.
278 /// </summary>
279 event EventHandler<ExecuteProgressEventArgs> ExecuteProgress;
280
281 /// <summary>
282 /// Fired when the engine is about to launch the preapproved executable.
283 /// </summary>
284 event EventHandler<LaunchApprovedExeBeginEventArgs> LaunchApprovedExeBegin;
285
286 /// <summary>
287 /// Fired when the engine has completed launching the preapproved executable.
288 /// </summary>
289 event EventHandler<LaunchApprovedExeCompleteEventArgs> LaunchApprovedExeComplete;
290
291 /// <summary>
292 /// Fired when the engine is about to pause Windows automatic updates.
293 /// </summary>
294 event EventHandler<PauseAutomaticUpdatesBeginEventArgs> PauseAutomaticUpdatesBegin;
295
296 /// <summary>
297 /// Fired when the engine has completed pausing Windows automatic updates.
298 /// </summary>
299 event EventHandler<PauseAutomaticUpdatesCompleteEventArgs> PauseAutomaticUpdatesComplete;
300
301 /// <summary>
302 /// Fired when the engine has begun planning the installation.
303 /// </summary>
304 event EventHandler<PlanBeginEventArgs> PlanBegin;
305
306 /// <summary>
307 /// Fired when the engine plans a new, compatible package using the same provider key.
308 /// </summary>
309 event EventHandler<PlanCompatibleMsiPackageBeginEventArgs> PlanCompatibleMsiPackageBegin;
310
311 /// <summary>
312 /// Fired when the engine has completed planning the installation of a specific package.
313 /// </summary>
314 event EventHandler<PlanCompatibleMsiPackageCompleteEventArgs> PlanCompatibleMsiPackageComplete;
315
316 /// <summary>
317 /// Fired when the engine has completed planning the installation.
318 /// </summary>
319 event EventHandler<PlanCompleteEventArgs> PlanComplete;
320
321 /// <summary>
322 /// Fired when the engine is about to plan a forward compatible bundle.
323 /// </summary>
324 event EventHandler<PlanForwardCompatibleBundleEventArgs> PlanForwardCompatibleBundle;
325
326 /// <summary>
327 /// Fired when the engine has completed planning a compatible package.
328 /// </summary>
329 event EventHandler<PlannedCompatiblePackageEventArgs> PlannedCompatiblePackage;
330
331 /// <summary>
332 /// Fired when the engine has completed planning a package.
333 /// </summary>
334 event EventHandler<PlannedPackageEventArgs> PlannedPackage;
335
336 /// <summary>
337 /// Fired when the engine is about to plan a feature in an MSI package.
338 /// </summary>
339 event EventHandler<PlanMsiFeatureEventArgs> PlanMsiFeature;
340
341 /// <summary>
342 /// Fired when the engine is planning an MSI or MSP package.
343 /// </summary>
344 event EventHandler<PlanMsiPackageEventArgs> PlanMsiPackage;
345
346 /// <summary>
347 /// Fired when the engine has begun getting the BA's input for planning a package.
348 /// </summary>
349 event EventHandler<PlanPackageBeginEventArgs> PlanPackageBegin;
350
351 /// <summary>
352 /// Fired when the engine has completed getting the BA's input for planning a package.
353 /// </summary>
354 event EventHandler<PlanPackageCompleteEventArgs> PlanPackageComplete;
355
356 /// <summary>
357 /// Fired when the engine is about to plan a target of an MSP package.
358 /// </summary>
359 event EventHandler<PlanPatchTargetEventArgs> PlanPatchTarget;
360
361 /// <summary>
362 /// Fired when the engine has begun planning for a related bundle.
363 /// </summary>
364 event EventHandler<PlanRelatedBundleEventArgs> PlanRelatedBundle;
365
366 /// <summary>
367 /// Fired when the engine has begun planning the related bundle relation type.
368 /// </summary>
369 event EventHandler<PlanRelatedBundleTypeEventArgs> PlanRelatedBundleType;
370
371 /// <summary>
372 /// Fired when the engine has begun planning an upgrade related bundle for restoring in case of failure.
373 /// </summary>
374 event EventHandler<PlanRestoreRelatedBundleEventArgs> PlanRestoreRelatedBundle;
375
376 /// <summary>
377 /// Fired when the engine is planning a rollback boundary.
378 /// </summary>
379 event EventHandler<PlanRollbackBoundaryEventArgs> PlanRollbackBoundary;
380
381 /// <summary>
382 /// Fired when the engine has changed progress for the bundle installation.
383 /// </summary>
384 event EventHandler<ProgressEventArgs> Progress;
385
386 /// <summary>
387 /// Fired when the engine has begun registering the location and visibility of the bundle.
388 /// </summary>
389 event EventHandler<RegisterBeginEventArgs> RegisterBegin;
390
391 /// <summary>
392 /// Fired when the engine has completed registering the location and visibility of the bundle.
393 /// </summary>
394 event EventHandler<RegisterCompleteEventArgs> RegisterComplete;
395
396 /// <summary>
397 /// Fired when the engine is about to rollback an MSI transaction.
398 /// </summary>
399 event EventHandler<RollbackMsiTransactionBeginEventArgs> RollbackMsiTransactionBegin;
400
401 /// <summary>
402 /// Fired when the engine has completed rolling back an MSI transaction.
403 /// </summary>
404 event EventHandler<RollbackMsiTransactionCompleteEventArgs> RollbackMsiTransactionComplete;
405
406 /// <summary>
407 /// Fired when the engine is shutting down the bootstrapper application.
408 /// </summary>
409 event EventHandler<ShutdownEventArgs> Shutdown;
410
411 /// <summary>
412 /// Fired when the engine is starting up the bootstrapper application.
413 /// </summary>
414 event EventHandler<StartupEventArgs> Startup;
415
416 /// <summary>
417 /// Fired when the engine is about to take a system restore point.
418 /// </summary>
419 event EventHandler<SystemRestorePointBeginEventArgs> SystemRestorePointBegin;
420
421 /// <summary>
422 /// Fired when the engine has completed taking a system restore point.
423 /// </summary>
424 event EventHandler<SystemRestorePointCompleteEventArgs> SystemRestorePointComplete;
425
426 /// <summary>
427 /// Fired when the engine unregisters the bundle.
428 /// </summary>
429 event EventHandler<UnregisterBeginEventArgs> UnregisterBegin;
430
431 /// <summary>
432 /// Fired when the engine unregistration is complete.
433 /// </summary>
434 event EventHandler<UnregisterCompleteEventArgs> UnregisterComplete;
435 }
436}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs
new file mode 100644
index 00000000..8e6a293b
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IEngine.cs
@@ -0,0 +1,230 @@
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.BootstrapperApplicationApi
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 /// Gets persisted variables from a related bundle.
109 /// </summary>
110 /// <param name="bundleId">The BundleId of the related bundle.</param>
111 /// <param name="name">The name of the variable.</param>
112 string GetRelatedBundleVariable(string bundleId, string name);
113
114 /// <summary>
115 /// Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.
116 /// </summary>
117 /// <param name="hwndParent">The parent window of the elevation dialog (if the engine hasn't elevated yet).</param>
118 /// <param name="approvedExeForElevationId">Id of the ApprovedExeForElevation element specified when the bundle was authored.</param>
119 /// <param name="arguments">Optional arguments.</param>
120 void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments);
121
122 /// <summary>
123 /// Launches a preapproved executable elevated. As long as the engine already elevated, there will be no UAC prompt.
124 /// </summary>
125 /// <param name="hwndParent">The parent window of the elevation dialog (if the engine hasn't elevated yet).</param>
126 /// <param name="approvedExeForElevationId">Id of the ApprovedExeForElevation element specified when the bundle was authored.</param>
127 /// <param name="arguments">Optional arguments.</param>
128 /// <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>
129 void LaunchApprovedExe(IntPtr hwndParent, string approvedExeForElevationId, string arguments, int waitForInputIdleTimeout);
130
131 /// <summary>
132 /// Logs the <paramref name="message"/>.
133 /// </summary>
134 /// <param name="level">The logging level.</param>
135 /// <param name="message">The message to log.</param>
136 void Log(LogLevel level, string message);
137
138 /// <summary>
139 /// Determine the installation sequencing and costing.
140 /// </summary>
141 /// <param name="action">The action to perform when planning.</param>
142 void Plan(LaunchAction action);
143
144 /// <summary>
145 /// Set the update information for a bundle.
146 /// </summary>
147 /// <param name="localSource">Optional local source path for the update. Default is "update\[OriginalNameOfBundle].exe".</param>
148 /// <param name="downloadSource">Optional download source for the update.</param>
149 /// <param name="size">Size of the expected update.</param>
150 /// <param name="hashType">Type of the hash expected on the update.</param>
151 /// <param name="hash">Optional hash expected for the update.</param>
152 /// <param name="updatePackageId">Optional package id for the update.</param>
153 void SetUpdate(string localSource, string downloadSource, long size, UpdateHashType hashType, string hash, string updatePackageId);
154
155 /// <summary>
156 /// Sets the URL to the update feed.
157 /// </summary>
158 /// <param name="url">URL of the update feed.</param>
159 void SetUpdateSource(string url);
160
161 /// <summary>
162 /// Set the local source 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="path">The new source path.</param>
167 void SetLocalSource(string packageOrContainerId, string payloadId, string path);
168
169 /// <summary>
170 /// Set the new download URL for a package or container.
171 /// </summary>
172 /// <param name="packageOrContainerId">The id that uniquely identifies the package or container.</param>
173 /// <param name="payloadId">The id that uniquely identifies the payload.</param>
174 /// <param name="url">The new url.</param>
175 /// <param name="user">The user name for proxy authentication.</param>
176 /// <param name="password">The password for proxy authentication.</param>
177 void SetDownloadSource(string packageOrContainerId, string payloadId, string url, string user, string password);
178
179 /// <summary>
180 /// Sets numeric variables for the engine.
181 /// </summary>
182 /// <param name="name">The name of the variable.</param>
183 /// <param name="value">The value to set.</param>
184 void SetVariableNumeric(string name, long value);
185
186 /// <summary>
187 /// Sets string variables for the engine using SecureStrings.
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, SecureString value, bool formatted);
193
194 /// <summary>
195 /// Sets string 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 /// <param name="formatted">False if the value is a literal string.</param>
200 void SetVariableString(string name, string value, bool formatted);
201
202 /// <summary>
203 /// Sets version variables for the engine.
204 /// </summary>
205 /// <param name="name">The name of the variable.</param>
206 /// <param name="value">The value to set.</param>
207 void SetVariableVersion(string name, string value);
208
209 /// <summary>
210 /// Sends error message when embedded.
211 /// </summary>
212 /// <param name="errorCode">Error code.</param>
213 /// <param name="message">Error message.</param>
214 /// <param name="uiHint">UI buttons to show on error dialog.</param>
215 int SendEmbeddedError(int errorCode, string message, int uiHint);
216
217 /// <summary>
218 /// Sends progress percentages when embedded.
219 /// </summary>
220 /// <param name="progressPercentage">Percentage completed thus far.</param>
221 /// <param name="overallPercentage">Overall percentage completed.</param>
222 int SendEmbeddedProgress(int progressPercentage, int overallPercentage);
223
224 /// <summary>
225 /// Shuts down the engine.
226 /// </summary>
227 /// <param name="exitCode">Exit code indicating reason for shut down.</param>
228 void Quit(int exitCode);
229 }
230}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IMbaCommand.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IMbaCommand.cs
new file mode 100644
index 00000000..37640a87
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IMbaCommand.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.BootstrapperApplicationApi
4{
5 using System.Collections.Generic;
6
7 /// <summary>
8 /// Command information parsed from the command line.
9 /// </summary>
10 public interface IMbaCommand
11 {
12 /// <summary>
13 /// Gets the action to perform if a reboot is required.
14 /// </summary>
15 Restart Restart { get; }
16
17 /// <summary>
18 /// The command line arguments not parsed into <see cref="IBootstrapperCommand"/> or <see cref="IMbaCommand"/>.
19 /// </summary>
20 string[] UnknownCommandLineArgs { get; }
21
22 /// <summary>
23 /// The variables that were parsed from the command line.
24 /// Key = variable name, Value = variable value.
25 /// </summary>
26 KeyValuePair<string, string>[] Variables { get; }
27
28 /// <summary>
29 /// Sets overridable variables from the command line.
30 /// </summary>
31 /// <param name="overridableVariables">The overridable variable information from <see cref="IBootstrapperApplicationData"/>.</param>
32 /// <param name="engine">The engine.</param>
33 void SetOverridableVariables(IOverridableVariables overridableVariables, IEngine engine);
34 }
35}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariableInfo.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariableInfo.cs
new file mode 100644
index 00000000..173963a8
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariableInfo.cs
@@ -0,0 +1,15 @@
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.BootstrapperApplicationApi
4{
5 /// <summary>
6 /// Overridable variable from the BA manifest.
7 /// </summary>
8 public interface IOverridableVariableInfo
9 {
10 /// <summary>
11 /// The Variable name.
12 /// </summary>
13 string Name { get; }
14 }
15}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariables.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariables.cs
new file mode 100644
index 00000000..2cf7b8d9
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IOverridableVariables.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.BootstrapperApplicationApi
4{
5 using System.Collections.Generic;
6
7 /// <summary>
8 /// The case sensitivity of variables from the command line.
9 /// </summary>
10 public enum VariableCommandLineType
11 {
12 /// <summary>
13 /// All variable names specified on the command line must match the case specified when building the bundle.
14 /// </summary>
15 CaseSensitive,
16 /// <summary>
17 /// Variable names specified on the command line do not have to match the case specified when building the bundle.
18 /// </summary>
19 CaseInsensitive,
20 }
21
22 /// <summary>
23 /// Overridable variable information from the BA manifest.
24 /// </summary>
25 public interface IOverridableVariables
26 {
27 /// <summary>
28 /// The <see cref="VariableCommandLineType"/> of the bundle.
29 /// </summary>
30 VariableCommandLineType CommandLineType { get; }
31
32 /// <summary>
33 /// Variable Dictionary of variable name to <see cref="IOverridableVariableInfo"/>.
34 /// </summary>
35 IDictionary<string, IOverridableVariableInfo> Variables { get; }
36 }
37}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/IPackageInfo.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/IPackageInfo.cs
new file mode 100644
index 00000000..e2512584
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/IPackageInfo.cs
@@ -0,0 +1,100 @@
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.BootstrapperApplicationApi
4{
5 /// <summary>
6 /// Package information from the BA manifest.
7 /// </summary>
8 public interface IPackageInfo
9 {
10 /// <summary>
11 /// The authored cache strategy for this package.
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 /// The package's description.
22 /// </summary>
23 string Description { get; }
24
25 /// <summary>
26 /// The authored bal:DisplayInternalUICondition.
27 /// </summary>
28 string DisplayInternalUICondition { get; }
29
30 /// <summary>
31 /// The package's display name.
32 /// </summary>
33 string DisplayName { get; }
34
35 /// <summary>
36 /// The package's Id.
37 /// </summary>
38 string Id { get; }
39
40 /// <summary>
41 /// The authored InstallCondition.
42 /// </summary>
43 string InstallCondition { get; }
44
45 /// <summary>
46 /// The authored RepairCondition.
47 /// </summary>
48 string RepairCondition { get; }
49
50 /// <summary>
51 /// Whether the bundle should ever recommend the package to be uninstalled.
52 /// </summary>
53 bool Permanent { get; }
54
55 /// <summary>
56 /// Whether the package should be installed by the prereq BA for managed bootstrapper applications.
57 /// </summary>
58 bool PrereqPackage { get; }
59
60 /// <summary>
61 /// The file name of the license file to be shown by the prereq BA.
62 /// </summary>
63 string PrereqLicenseFile { get; }
64
65 /// <summary>
66 /// The URL of the license to be shown by the prereq BA.
67 /// </summary>
68 string PrereqLicenseUrl { get; }
69
70 /// <summary>
71 /// See <see cref="WixToolset.BootstrapperApplicationApi.PrimaryPackageType"/>
72 /// </summary>
73 PrimaryPackageType PrimaryPackageType { get; }
74
75 /// <summary>
76 /// The package's ProductCode.
77 /// </summary>
78 string ProductCode { get; }
79
80 /// <summary>
81 /// The type of the package.
82 /// </summary>
83 PackageType Type { get; }
84
85 /// <summary>
86 /// The package's UpgradeCode.
87 /// </summary>
88 string UpgradeCode { get; }
89
90 /// <summary>
91 /// The package's version.
92 /// </summary>
93 string Version { get; }
94
95 /// <summary>
96 /// Whether the package's failure can be ignored while executing the chain.
97 /// </summary>
98 bool Vital { get; }
99 }
100}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/ManagedBootstrapperApplication.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/ManagedBootstrapperApplication.cs
new file mode 100644
index 00000000..77c5eaca
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/ManagedBootstrapperApplication.cs
@@ -0,0 +1,19 @@
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.BootstrapperApplicationApi
4{
5 /// <summary>
6 /// Managed bootstrapper application entry point.
7 /// </summary>
8 public static class ManagedBootstrapperApplication
9 {
10 /// <summary>
11 /// Run the managed bootstrapper application.
12 /// </summary>
13 /// <param name="application">Bootstrapper applciation to run.</param>
14 public static void Run(IBootstrapperApplication application)
15 {
16 MbaNative.BootstrapperApplicationRun(application);
17 }
18 }
19}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/MbaCommand.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/MbaCommand.cs
new file mode 100644
index 00000000..c46b5844
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/MbaCommand.cs
@@ -0,0 +1,38 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Collections.Generic;
7
8 /// <summary>
9 /// Default implementation of <see cref="IMbaCommand"/>.
10 /// </summary>
11 internal sealed class MbaCommand : IMbaCommand
12 {
13 public Restart Restart { get; internal set; }
14
15 public string[] UnknownCommandLineArgs { get; internal set; }
16
17 public KeyValuePair<string, string>[] Variables { get; internal set; }
18
19 internal MbaCommand() { }
20
21 public void SetOverridableVariables(IOverridableVariables overridableVariables, IEngine engine)
22 {
23 foreach (var kvp in this.Variables)
24 {
25 var key = kvp.Key;
26
27 if (!overridableVariables.Variables.TryGetValue(key, out var overridableVariable))
28 {
29 engine.Log(LogLevel.Error, String.Format("Ignoring attempt to set non-overridable variable: '{0}'.", key));
30 }
31 else
32 {
33 engine.SetVariableString(overridableVariable.Name, kvp.Value, false);
34 }
35 }
36 }
37 }
38}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/MbaNative.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/MbaNative.cs
new file mode 100644
index 00000000..6e135fc3
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/MbaNative.cs
@@ -0,0 +1,18 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Runtime.InteropServices;
7
8 internal static class MbaNative
9 {
10 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
11 internal static extern void BalDebuggerCheck();
12
13 [DllImport("mbanative.dll", ExactSpelling = true, PreserveSig = false)]
14 internal static extern void BootstrapperApplicationRun(
15 [MarshalAs(UnmanagedType.Interface)] IBootstrapperApplication pBA
16 );
17 }
18}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs
new file mode 100644
index 00000000..4ef9f35e
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/NativeMethods.cs
@@ -0,0 +1,49 @@
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.BootstrapperApplicationApi
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
38 #region SafeHandles
39 internal abstract class SafeHandleZeroIsDefaultAndInvalid : SafeHandle
40 {
41 public SafeHandleZeroIsDefaultAndInvalid() : base(IntPtr.Zero, true) { }
42
43 public override bool IsInvalid
44 {
45 get { return this.handle == IntPtr.Zero; }
46 }
47 }
48 #endregion
49}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariableInfo.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariableInfo.cs
new file mode 100644
index 00000000..8b90c588
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariableInfo.cs
@@ -0,0 +1,15 @@
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.BootstrapperApplicationApi
4{
5 /// <summary>
6 /// Default implementation of <see cref="IOverridableVariableInfo"/>.
7 /// </summary>
8 internal class OverridableVariableInfo : IOverridableVariableInfo
9 {
10 /// <inheritdoc />
11 public string Name { get; internal set; }
12
13 internal OverridableVariableInfo() { }
14 }
15}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariables.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariables.cs
new file mode 100644
index 00000000..98f8ec81
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/OverridableVariables.cs
@@ -0,0 +1,87 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Xml;
8 using System.Xml.XPath;
9
10 /// <summary>
11 /// Default implementation of <see cref="IOverridableVariables"/>.
12 /// </summary>
13 public class OverridableVariablesInfo : IOverridableVariables
14 {
15 /// <inheritdoc />
16 public VariableCommandLineType CommandLineType { get; internal set; }
17
18 /// <inheritdoc />
19 public IDictionary<string, IOverridableVariableInfo> Variables { get; internal set; }
20
21 internal OverridableVariablesInfo() { }
22
23 /// <summary>
24 /// Parses the overridable variable info from the BA manifest.
25 /// </summary>
26 /// <param name="root">XML root</param>
27 /// <returns>The parsed information.</returns>
28 public static IOverridableVariables ParseFromXml(XPathNavigator root)
29 {
30 XmlNamespaceManager namespaceManager = new XmlNamespaceManager(root.NameTable);
31 namespaceManager.AddNamespace("p", BootstrapperApplicationData.XMLNamespace);
32 XPathNavigator commandLineNode = root.SelectSingleNode("/p:BootstrapperApplicationData/p:WixStdbaCommandLine", namespaceManager);
33 XPathNodeIterator nodes = root.Select("/p:BootstrapperApplicationData/p:WixStdbaOverridableVariable", namespaceManager);
34
35 var overridableVariables = new OverridableVariablesInfo();
36 IEqualityComparer<string> variableNameComparer;
37
38 if (commandLineNode == null)
39 {
40 overridableVariables.CommandLineType = VariableCommandLineType.CaseSensitive;
41 variableNameComparer = StringComparer.InvariantCulture;
42 }
43 else
44 {
45 string variablesValue = BootstrapperApplicationData.GetAttribute(commandLineNode, "Variables");
46
47 if (variablesValue == null)
48 {
49 throw new Exception("Failed to get command line variable type.");
50 }
51
52 if (variablesValue.Equals("caseInsensitive", StringComparison.InvariantCulture))
53 {
54 overridableVariables.CommandLineType = VariableCommandLineType.CaseInsensitive;
55 variableNameComparer = StringComparer.InvariantCultureIgnoreCase;
56 }
57 else if (variablesValue.Equals("caseSensitive", StringComparison.InvariantCulture))
58 {
59 overridableVariables.CommandLineType = VariableCommandLineType.CaseSensitive;
60 variableNameComparer = StringComparer.InvariantCulture;
61 }
62 else
63 {
64 throw new Exception(String.Format("Unknown command line variable type: '{0}'", variablesValue));
65 }
66 }
67
68 overridableVariables.Variables = new Dictionary<string, IOverridableVariableInfo>(variableNameComparer);
69
70 foreach (XPathNavigator node in nodes)
71 {
72 var variable = new OverridableVariableInfo();
73
74 string name = BootstrapperApplicationData.GetAttribute(node, "Name");
75 if (name == null)
76 {
77 throw new Exception("Failed to get name for overridable variable.");
78 }
79 variable.Name = name;
80
81 overridableVariables.Variables.Add(variable.Name, variable);
82 }
83
84 return overridableVariables;
85 }
86 }
87}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/PackageInfo.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/PackageInfo.cs
new file mode 100644
index 00000000..e835f9ea
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/PackageInfo.cs
@@ -0,0 +1,391 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Xml;
8 using System.Xml.XPath;
9
10 /// <summary>
11 /// The type of package.
12 /// </summary>
13 public enum PackageType
14 {
15 /// <summary>
16 /// Invalid type.
17 /// </summary>
18 Unknown,
19
20 /// <summary>
21 /// ExePackage
22 /// </summary>
23 Exe,
24
25 /// <summary>
26 /// MsiPackage
27 /// </summary>
28 Msi,
29
30 /// <summary>
31 /// MspPackage
32 /// </summary>
33 Msp,
34
35 /// <summary>
36 /// MsuPackage
37 /// </summary>
38 Msu,
39
40 /// <summary>
41 /// Related bundle of type Upgrade
42 /// </summary>
43 UpgradeBundle,
44
45 /// <summary>
46 /// Related bundle of type Addon
47 /// </summary>
48 AddonBundle,
49
50 /// <summary>
51 /// Related bundle of type Patch
52 /// </summary>
53 PatchBundle,
54
55 /// <summary>
56 /// Related bundle of type Update
57 /// </summary>
58 UpdateBundle,
59
60 /// <summary>
61 /// BundlePackage
62 /// </summary>
63 ChainBundle,
64 }
65
66 /// <summary>
67 /// Metadata for BAs like WixInternalUIBootstrapperApplication that only support one main package.
68 /// </summary>
69 public enum PrimaryPackageType
70 {
71 /// <summary>
72 /// Not a primary package.
73 /// </summary>
74 None,
75
76 /// <summary>
77 /// The default package if no architecture specific package is available for the current architecture.
78 /// </summary>
79 Default,
80
81 /// <summary>
82 /// The package to use on x86 machines.
83 /// </summary>
84 X86,
85
86 /// <summary>
87 /// The package to use on x64 machines.
88 /// </summary>
89 X64,
90
91 /// <summary>
92 /// The package to use on ARM64 machines.
93 /// </summary>
94 ARM64,
95 }
96
97 /// <summary>
98 /// Default implementation of <see cref="IPackageInfo"/>.
99 /// </summary>
100 public class PackageInfo : IPackageInfo
101 {
102 /// <inheritdoc/>
103 public string Id { get; internal set; }
104
105 /// <inheritdoc/>
106 public string DisplayName { get; internal set; }
107
108 /// <inheritdoc/>
109 public string Description { get; internal set; }
110
111 /// <inheritdoc/>
112 public PackageType Type { get; internal set; }
113
114 /// <inheritdoc/>
115 public bool Permanent { get; internal set; }
116
117 /// <inheritdoc/>
118 public bool Vital { get; internal set; }
119
120 /// <inheritdoc/>
121 public string DisplayInternalUICondition { get; internal set; }
122
123 /// <inheritdoc/>
124 public string ProductCode { get; internal set; }
125
126 /// <inheritdoc/>
127 public string UpgradeCode { get; internal set; }
128
129 /// <inheritdoc/>
130 public string Version { get; internal set; }
131
132 /// <inheritdoc/>
133 public string InstallCondition { get; internal set; }
134
135 /// <inheritdoc/>
136 public string RepairCondition { get; internal set; }
137
138 /// <inheritdoc/>
139 public BOOTSTRAPPER_CACHE_TYPE CacheType { get; internal set; }
140
141 /// <inheritdoc/>
142 public bool PrereqPackage { get; internal set; }
143
144 /// <inheritdoc/>
145 public string PrereqLicenseFile { get; internal set; }
146
147 /// <inheritdoc/>
148 public string PrereqLicenseUrl { get; internal set; }
149
150 /// <inheritdoc/>
151 public PrimaryPackageType PrimaryPackageType { get; internal set; }
152
153 /// <inheritdoc/>
154 public object CustomData { get; set; }
155
156 internal PackageInfo() { }
157
158 /// <summary>
159 /// Parse packages from BootstrapperApplicationData.xml.
160 /// </summary>
161 /// <param name="root">The root node.</param>
162 /// <returns>A dictionary of the packages by Id.</returns>
163 public static IDictionary<string, IPackageInfo> ParsePackagesFromXml(XPathNavigator root)
164 {
165 var packagesById = new Dictionary<string, IPackageInfo>();
166 XmlNamespaceManager namespaceManager = new XmlNamespaceManager(root.NameTable);
167 namespaceManager.AddNamespace("p", BootstrapperApplicationData.XMLNamespace);
168 XPathNodeIterator nodes = root.Select("/p:BootstrapperApplicationData/p:WixPackageProperties", namespaceManager);
169
170 foreach (XPathNavigator node in nodes)
171 {
172 var package = new PackageInfo();
173
174 string id = BootstrapperApplicationData.GetAttribute(node, "Package");
175 if (id == null)
176 {
177 throw new Exception("Failed to get package identifier for package.");
178 }
179 package.Id = id;
180
181 package.DisplayName = BootstrapperApplicationData.GetAttribute(node, "DisplayName");
182
183 package.Description = BootstrapperApplicationData.GetAttribute(node, "Description");
184
185 PackageType? packageType = GetPackageTypeAttribute(node, "PackageType");
186 if (!packageType.HasValue)
187 {
188 throw new Exception("Failed to get package type for package.");
189 }
190 package.Type = packageType.Value;
191
192 bool? permanent = BootstrapperApplicationData.GetYesNoAttribute(node, "Permanent");
193 if (!permanent.HasValue)
194 {
195 throw new Exception("Failed to get permanent settings for package.");
196 }
197 package.Permanent = permanent.Value;
198
199 bool? vital = BootstrapperApplicationData.GetYesNoAttribute(node, "Vital");
200 if (!vital.HasValue)
201 {
202 throw new Exception("Failed to get vital setting for package.");
203 }
204 package.Vital = vital.Value;
205
206 package.ProductCode = BootstrapperApplicationData.GetAttribute(node, "ProductCode");
207
208 package.UpgradeCode = BootstrapperApplicationData.GetAttribute(node, "UpgradeCode");
209
210 package.Version = BootstrapperApplicationData.GetAttribute(node, "Version");
211
212 package.InstallCondition = BootstrapperApplicationData.GetAttribute(node, "InstallCondition");
213
214 package.RepairCondition = BootstrapperApplicationData.GetAttribute(node, "RepairCondition");
215
216 BOOTSTRAPPER_CACHE_TYPE? cacheType = GetCacheTypeAttribute(node, "Cache");
217 if (!cacheType.HasValue)
218 {
219 throw new Exception("Failed to get cache type for package.");
220 }
221 package.CacheType = cacheType.Value;
222
223 packagesById.Add(package.Id, package);
224 }
225
226 ParseBalPackageInfoFromXml(root, namespaceManager, packagesById);
227 return packagesById;
228 }
229
230 /// <summary>
231 /// Parse the cache type attribute.
232 /// </summary>
233 /// <param name="node">Package node</param>
234 /// <param name="attributeName">Attribute name</param>
235 /// <returns>The cache type</returns>
236 public static BOOTSTRAPPER_CACHE_TYPE? GetCacheTypeAttribute(XPathNavigator node, string attributeName)
237 {
238 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName);
239
240 if (attributeValue == null)
241 {
242 return null;
243 }
244
245 if (attributeValue.Equals("keep", StringComparison.InvariantCulture))
246 {
247 return BOOTSTRAPPER_CACHE_TYPE.Keep;
248 }
249 else if (attributeValue.Equals("force", StringComparison.InvariantCulture))
250 {
251 return BOOTSTRAPPER_CACHE_TYPE.Force;
252 }
253 else
254 {
255 return BOOTSTRAPPER_CACHE_TYPE.Remove;
256 }
257 }
258
259 /// <summary>
260 /// Parse the package type attribute
261 /// </summary>
262 /// <param name="node">Package node</param>
263 /// <param name="attributeName">Attribute name</param>
264 /// <returns>The package type</returns>
265 public static PackageType? GetPackageTypeAttribute(XPathNavigator node, string attributeName)
266 {
267 string attributeValue = BootstrapperApplicationData.GetAttribute(node, attributeName);
268
269 if (attributeValue == null)
270 {
271 return null;
272 }
273
274 if (attributeValue.Equals("Bundle", StringComparison.InvariantCulture))
275 {
276 return PackageType.ChainBundle;
277 }
278 else if (attributeValue.Equals("Exe", StringComparison.InvariantCulture))
279 {
280 return PackageType.Exe;
281 }
282 else if (attributeValue.Equals("Msi", StringComparison.InvariantCulture))
283 {
284 return PackageType.Msi;
285 }
286 else if (attributeValue.Equals("Msp", StringComparison.InvariantCulture))
287 {
288 return PackageType.Msp;
289 }
290 else if (attributeValue.Equals("Msu", StringComparison.InvariantCulture))
291 {
292 return PackageType.Msu;
293 }
294 else
295 {
296 return PackageType.Unknown;
297 }
298 }
299
300 /// <summary>
301 /// Create <see cref="IPackageInfo"/> from a related bundle.
302 /// </summary>
303 /// <param name="id">Package id</param>
304 /// <param name="relationType">Relation type</param>
305 /// <param name="perMachine">Whether the related bundle is per-machine</param>
306 /// <param name="version">The related bundle's version</param>
307 /// <returns>The package info</returns>
308 public static IPackageInfo GetRelatedBundleAsPackage(string id, RelationType relationType, bool perMachine, string version)
309 {
310 PackageInfo package = new PackageInfo();
311 package.Id = id;
312 package.Version = version;
313
314 switch (relationType)
315 {
316 case RelationType.Addon:
317 package.Type = PackageType.AddonBundle;
318 break;
319 case RelationType.Patch:
320 package.Type = PackageType.PatchBundle;
321 break;
322 case RelationType.Upgrade:
323 package.Type = PackageType.UpgradeBundle;
324 break;
325 default:
326 throw new Exception(String.Format("Unknown related bundle type: {0}", relationType));
327 }
328
329 return package;
330 }
331
332 /// <summary>
333 /// Create <see cref="IPackageInfo"/> from an update bundle.
334 /// </summary>
335 /// <param name="id">Package id</param>
336 /// <returns>The package info</returns>
337 public static IPackageInfo GetUpdateBundleAsPackage(string id)
338 {
339 PackageInfo package = new PackageInfo();
340 package.Id = id;
341 package.Type = PackageType.UpdateBundle;
342
343 return package;
344 }
345
346 internal static void ParseBalPackageInfoFromXml(XPathNavigator root, XmlNamespaceManager namespaceManager, Dictionary<string, IPackageInfo> packagesById)
347 {
348 XPathNodeIterator nodes = root.Select("/p:BootstrapperApplicationData/p:WixBalPackageInfo", namespaceManager);
349
350 foreach (XPathNavigator node in nodes)
351 {
352 string id = BootstrapperApplicationData.GetAttribute(node, "PackageId");
353 if (id == null)
354 {
355 throw new Exception("Failed to get package identifier for WixBalPackageInfo.");
356 }
357
358 if (!packagesById.TryGetValue(id, out var ipackage))
359 {
360 throw new Exception(String.Format("Failed to find package specified in WixBalPackageInfo: {0}", id));
361 }
362
363 var package = (PackageInfo)ipackage;
364
365 package.DisplayInternalUICondition = BootstrapperApplicationData.GetAttribute(node, "DisplayInternalUICondition");
366 }
367
368 nodes = root.Select("/p:BootstrapperApplicationData/p:WixPrereqInformation", namespaceManager);
369
370 foreach (XPathNavigator node in nodes)
371 {
372 string id = BootstrapperApplicationData.GetAttribute(node, "PackageId");
373 if (id == null)
374 {
375 throw new Exception("Failed to get package identifier for WixPrereqInformation.");
376 }
377
378 if (!packagesById.TryGetValue(id, out var ipackage))
379 {
380 throw new Exception(String.Format("Failed to find package specified in WixPrereqInformation: {0}", id));
381 }
382
383 var package = (PackageInfo)ipackage;
384
385 package.PrereqPackage = true;
386 package.PrereqLicenseFile = BootstrapperApplicationData.GetAttribute(node, "LicenseFile");
387 package.PrereqLicenseUrl = BootstrapperApplicationData.GetAttribute(node, "LicenseUrl");
388 }
389 }
390 }
391}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/StrUtil.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/StrUtil.cs
new file mode 100644
index 00000000..aeeaac47
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/StrUtil.cs
@@ -0,0 +1,54 @@
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.BootstrapperApplicationApi
4{
5 using System;
6 using System.Runtime.InteropServices;
7 using System.Security;
8 using System.Text;
9
10 internal static class StrUtil
11 {
12 [DllImport("mbanative.dll", ExactSpelling = true)]
13 internal static extern void StrFree(
14 IntPtr scz
15 );
16
17 internal sealed class StrHandle : SafeHandleZeroIsDefaultAndInvalid
18 {
19 protected override bool ReleaseHandle()
20 {
21 StrFree(this.handle);
22 return true;
23 }
24
25 public string ToUniString()
26 {
27 return Marshal.PtrToStringUni(this.handle);
28 }
29
30 public SecureString ToSecureString()
31 {
32 if (this.handle == IntPtr.Zero)
33 {
34 return null;
35 }
36
37 SecureString value = new SecureString();
38 char c;
39 for (int charIndex = 0; ; charIndex++)
40 {
41 c = (char)Marshal.ReadInt16(this.handle, charIndex * UnicodeEncoding.CharSize);
42 if (c == '\0')
43 {
44 break;
45 }
46
47 value.AppendChar(c);
48 }
49
50 return value;
51 }
52 }
53 }
54}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtil.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtil.cs
new file mode 100644
index 00000000..082ee06c
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtil.cs
@@ -0,0 +1,146 @@
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.BootstrapperApplicationApi
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 char chPrefix;
63 public uint dwMajor;
64 public uint dwMinor;
65 public uint dwPatch;
66 public uint dwRevision;
67 public int cReleaseLabels;
68 public IntPtr rgReleaseLabels;
69 public IntPtr cchMetadataOffset;
70 public bool fInvalid;
71 public bool fHasMajor;
72 public bool fHasMinor;
73 public bool fHasPatch;
74 public bool fHasRevision;
75 }
76
77 internal static string VersionStringFromOffset(IntPtr wzVersion, IntPtr cchOffset, int? cchLength = null)
78 {
79 var offset = cchOffset.ToInt64() * UnicodeEncoding.CharSize;
80 var wz = new IntPtr(wzVersion.ToInt64() + offset);
81 if (cchLength.HasValue)
82 {
83 return Marshal.PtrToStringUni(wz, (int)cchLength);
84 }
85 else
86 {
87 return Marshal.PtrToStringUni(wz);
88 }
89 }
90
91 internal sealed class VersionHandle : SafeHandleZeroIsDefaultAndInvalid
92 {
93 protected override bool ReleaseHandle()
94 {
95 VerFreeVersion(this.handle);
96 return true;
97 }
98 }
99
100 /// <returns>0 if equal, 1 if version1 &gt; version2, -1 if version1 &lt; version2</returns>
101 public static int CompareParsedVersions(VerUtilVersion version1, VerUtilVersion version2)
102 {
103 return VerCompareParsedVersions(version1.GetHandle(), version2.GetHandle());
104 }
105
106 /// <returns>0 if equal, 1 if version1 &gt; version2, -1 if version1 &lt; version2</returns>
107 public static int CompareStringVersions(string version1, string version2, bool strict)
108 {
109 return VerCompareStringVersions(version1, version2, strict);
110 }
111
112 /// <summary>
113 /// Clone the version.
114 /// </summary>
115 /// <param name="version">Source version</param>
116 /// <returns>Cloned version</returns>
117 public static VerUtilVersion CopyVersion(VerUtilVersion version)
118 {
119 var handle = VerCopyVersion(version.GetHandle());
120 return new VerUtilVersion(handle);
121 }
122
123 /// <summary>
124 /// Parse a version.
125 /// </summary>
126 /// <param name="version">Source version</param>
127 /// <param name="strict">Whether to throw exception on invalid version.</param>
128 /// <returns>Parsed version</returns>
129 public static VerUtilVersion ParseVersion(string version, bool strict)
130 {
131 var handle = VerParseVersion(version, 0, strict);
132 return new VerUtilVersion(handle);
133 }
134
135 /// <summary>
136 /// Parse version from qword.
137 /// </summary>
138 /// <param name="version">Source version</param>
139 /// <returns>Parsed version</returns>
140 public static VerUtilVersion VersionFromQword(long version)
141 {
142 var handle = VerVersionFromQword(version);
143 return new VerUtilVersion(handle);
144 }
145 }
146}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtilVersion.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtilVersion.cs
new file mode 100644
index 00000000..65b195a4
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtilVersion.cs
@@ -0,0 +1,129 @@
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.BootstrapperApplicationApi
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.Prefix = version.chPrefix;
21 this.Major = version.dwMajor;
22 this.Minor = version.dwMinor;
23 this.Patch = version.dwPatch;
24 this.Revision = version.dwRevision;
25 this.ReleaseLabels = new VerUtilVersionReleaseLabel[version.cReleaseLabels];
26 this.Metadata = VerUtil.VersionStringFromOffset(version.sczVersion, version.cchMetadataOffset);
27 this.IsInvalid = version.fInvalid;
28 this.HasMajor = version.fHasMajor;
29 this.HasMinor = version.fHasMinor;
30 this.HasPatch = version.fHasPatch;
31 this.HasRevision = version.fHasRevision;
32
33 for (var i = 0; i < version.cReleaseLabels; ++i)
34 {
35 var offset = i * Marshal.SizeOf(typeof(VerUtil.VersionReleaseLabelStruct));
36 var pReleaseLabel = new IntPtr(version.rgReleaseLabels.ToInt64() + offset);
37 this.ReleaseLabels[i] = new VerUtilVersionReleaseLabel(pReleaseLabel, version.sczVersion);
38 }
39 }
40
41 /// <summary>
42 /// String version, which would have stripped the leading 'v'.
43 /// </summary>
44 public string Version { get; private set; }
45
46 /// <summary>
47 /// Prefix character that was stripped from <c>Version</c>, or the null character if there was no prefix.
48 /// </summary>
49 public char Prefix { get; private set; }
50
51 /// <summary>
52 /// For version A.B.C.D, Major is A. It is 0 if not specified.
53 /// </summary>
54 public uint Major { get; private set; }
55
56 /// <summary>
57 /// For version A.B.C.D, Minor is B. It is 0 if not specified.
58 /// </summary>
59 public uint Minor { get; private set; }
60
61 /// <summary>
62 /// For version A.B.C.D, Patch is C. It is 0 if not specified.
63 /// </summary>
64 public uint Patch { get; private set; }
65
66 /// <summary>
67 /// For version A.B.C.D, Revision is D. It is 0 if not specified.
68 /// </summary>
69 public uint Revision { get; private set; }
70
71 /// <summary>
72 /// For version X.Y.Z-releaselabels+metadata, ReleaseLabels is the parsed information for releaselabels.
73 /// </summary>
74 public VerUtilVersionReleaseLabel[] ReleaseLabels { get; private set; }
75
76 /// <summary>
77 /// For version X.Y.Z-releaselabels+metadata, Metadata is the rest of the string after +.
78 /// For invalid versions, it is all of the string after the point where it was an invalid string.
79 /// </summary>
80 public string Metadata { get; private set; }
81
82 /// <summary>
83 /// Whether the version conformed to the spec.
84 /// </summary>
85 public bool IsInvalid { get; private set; }
86
87 /// <summary>
88 /// Whether the Major part was specified.
89 /// </summary>
90 public bool HasMajor { get; private set; }
91
92 /// <summary>
93 /// Whether the Minor part was specified.
94 /// </summary>
95 public bool HasMinor { get; private set; }
96
97 /// <summary>
98 /// Whether the Patch part was specified.
99 /// </summary>
100 public bool HasPatch { get; private set; }
101
102 /// <summary>
103 /// Whether the Revision part was specified.
104 /// </summary>
105 public bool HasRevision { get; private set; }
106
107 /// <inheritdoc/>
108 public void Dispose()
109 {
110 if (this.Handle != null)
111 {
112 this.Handle.Dispose();
113 this.Handle = null;
114 }
115 }
116
117 private VerUtil.VersionHandle Handle { get; set; }
118
119 internal VerUtil.VersionHandle GetHandle()
120 {
121 if (this.Handle == null)
122 {
123 throw new ObjectDisposedException(this.Version);
124 }
125
126 return this.Handle;
127 }
128 }
129}
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtilVersionReleaseLabel.cs b/src/api/burn/WixToolset.BootstrapperApplicationApi/VerUtilVersionReleaseLabel.cs
new file mode 100644
index 00000000..03603714
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/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.BootstrapperApplicationApi
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.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.csproj b/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.csproj
new file mode 100644
index 00000000..2fe6d5bb
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.csproj
@@ -0,0 +1,27 @@
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;net462</TargetFrameworks>
7 <AssemblyName>WixToolset.BootstrapperApplicationApi</AssemblyName>
8 <RootNamespace>WixToolset.BootstrapperApplicationApi</RootNamespace>
9 <DebugType>embedded</DebugType>
10 <Description>Managed Bootstrapper Application API</Description>
11 <NuspecFile>$(MSBuildThisFileName).nuspec</NuspecFile>
12 <CreateDocumentationFile>true</CreateDocumentationFile>
13 </PropertyGroup>
14
15 <ItemGroup Condition=" '$(NCrunch)'=='' ">
16 <ProjectReference Include="..\mbanative\mbanative.vcxproj" ReferenceOutputAssembly="false" PrivateAssets="All" Properties="Platform=x86" />
17 </ItemGroup>
18
19 <ItemGroup Condition=" '$(NCrunch)'=='' ">
20 <None Include="$(BaseOutputPath)$(Configuration)\$(PlatformToolset)\x86\mbanative.dll" CopyToOutputDirectory="PreserveNewest" />
21 <None Include="$(BaseOutputPath)$(Configuration)\$(PlatformToolset)\x86\mbanative.pdb" CopyToOutputDirectory="PreserveNewest" />
22 </ItemGroup>
23 <ItemGroup Condition=" '$(NCrunch)'=='1' ">
24 <None Include="$(NCrunchOriginalProjectDir)..\..\build\$(SegmentName)\$(Configuration)\$(PlatformToolset)\x86\mbanative.dll" CopyToOutputDirectory="PreserveNewest" />
25 <None Include="$(NCrunchOriginalProjectDir)..\..\build\$(SegmentName)\$(Configuration)\$(PlatformToolset)\x86\mbanative.pdb" CopyToOutputDirectory="PreserveNewest" />
26 </ItemGroup>
27</Project>
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec b/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec
new file mode 100644
index 00000000..22099635
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/WixToolset.BootstrapperApplicationApi.nuspec
@@ -0,0 +1,46 @@
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 <title>$title$</title>
7 <description>$description$</description>
8 <authors>$authors$</authors>
9 <icon>wix.png</icon>
10 <license type="expression">MS-RL</license>
11 <requireLicenseAcceptance>false</requireLicenseAcceptance>
12 <copyright>$copyright$</copyright>
13 <projectUrl>$projectUrl$</projectUrl>
14 <repository type="$repositorytype$" url="$repositoryurl$" commit="$repositorycommit$" />
15 <dependencies>
16 <group targetFramework=".NETFramework4.6.2" />
17 <group targetFramework=".NETStandard2.0" />
18 <group targetFramework="Native">
19 <dependency id="WixToolset.DUtil" version="[$version$,5)" />
20 </group>
21 </dependencies>
22 </metadata>
23
24 <files>
25 <file src="$projectFolder$\..\..\..\internal\images\wix.png" />
26
27 <file src="$projectFolder$\build\WixToolset.BootstrapperApplicationApi.props" target="build\" />
28
29 <file src="$projectFolder$\build\_._" target="lib\native" />
30 <file src="net462\$id$.dll" target="lib\net462" />
31 <file src="net462\$id$.xml" target="lib\net462" />
32 <file src="netstandard2.0\$id$.dll" target="lib\netstandard2.0" />
33 <file src="netstandard2.0\$id$.xml" target="lib\netstandard2.0" />
34
35 <file src="v143\ARM64\mbanative.dll" target="runtimes\win-arm64\native" />
36 <file src="v143\x64\mbanative.dll" target="runtimes\win-x64\native" />
37 <file src="v143\x86\mbanative.dll" target="runtimes\win-x86\native" />
38
39 <file src="$projectFolder$\..\balutil\inc\*" target="build\native\include" />
40 <file src="$projectFolder$\..\inc\BootstrapperApplication.h" target="build\native\include" />
41 <file src="$projectFolder$\..\inc\BootstrapperEngine.h" target="build\native\include" />
42 <file src="v141\x86\balutil.lib" target="build\native\v14\x86" />
43 <file src="v141\x64\balutil.lib" target="build\native\v14\x64" />
44 <file src="v141\ARM64\balutil.lib" target="build\native\v14\ARM64" />
45 </files>
46</package>
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/build/WixToolset.BootstrapperApplicationApi.props b/src/api/burn/WixToolset.BootstrapperApplicationApi/build/WixToolset.BootstrapperApplicationApi.props
new file mode 100644
index 00000000..b276574d
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/build/WixToolset.BootstrapperApplicationApi.props
@@ -0,0 +1,18 @@
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 ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5 <ItemDefinitionGroup>
6 <ClCompile>
7 <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)native\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
8 </ClCompile>
9 <ResourceCompile>
10 <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)native\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
11 </ResourceCompile>
12 </ItemDefinitionGroup>
13 <ItemDefinitionGroup Condition=" $(PlatformToolset.ToLower().StartsWith('v14')) ">
14 <Link>
15 <AdditionalDependencies>$(MSBuildThisFileDirectory)native\v14\$(PlatformTarget)\balutil.lib;%(AdditionalDependencies)</AdditionalDependencies>
16 </Link>
17 </ItemDefinitionGroup>
18</Project>
diff --git a/src/api/burn/WixToolset.BootstrapperApplicationApi/build/_._ b/src/api/burn/WixToolset.BootstrapperApplicationApi/build/_._
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/api/burn/WixToolset.BootstrapperApplicationApi/build/_._