main
cs 770 lines 29.3 KB
Raw
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
3 namespace WixTestTools
4 {
5 using System;
6 using System.IO;
7 using System.Text;
8 using WixInternal.TestSupport;
9
10 public class MSIExec : TestTool
11 {
12 /// <summary>
13 /// The expected exit code of the tool
14 /// </summary>
15 public new MSIExecReturnCode ExpectedExitCode
16 {
17 get { return (MSIExecReturnCode)base.ExpectedExitCode; }
18 set { base.ExpectedExitCode = (int?)value; }
19 }
20
21 /// <summary>
22 /// Mode of execution (install, uninstall, or repair)
23 /// </summary>
24 public MSIExecMode ExecutionMode { get; set; }
25
26 /// <summary>
27 /// Path to msi or ProductCode
28 /// </summary>
29 public string Product { get; set; }
30
31 /// <summary>
32 /// Logging Options
33 /// </summary>
34 public MSIExecLoggingOptions LoggingOptions { get; set; }
35
36 /// <summary>
37 /// Path to the log file
38 /// </summary>
39 public string LogFile { get; set; }
40
41 /// <summary>
42 /// Unattended mode - progress bar only
43 /// </summary>
44 public bool Passive { get; set; }
45
46 /// <summary>
47 /// Quiet mode, no user interaction
48 /// </summary>
49 public bool Quiet { get; set; }
50
51 /// <summary>
52 /// Sets user interface level
53 /// </summary>
54 public MSIExecUserInterfaceLevel UserInterfaceLevel { get; set; }
55
56 /// <summary>
57 /// Do not restart after the installation is complete
58 /// </summary>
59 public bool NoRestart { get; set; }
60
61 /// <summary>
62 /// Prompts the user for restart if necessary
63 /// </summary>
64 public bool PromptRestart { get; set; }
65
66 /// <summary>
67 /// Always restart the computer after installation
68 /// </summary>
69 public bool ForceRestart { get; set; }
70
71 /// <summary>
72 /// Other arguments.
73 /// </summary>
74 public string OtherArguments { get; set; }
75
76 /// <summary>
77 /// Constructor that uses the default location for MSIExec.
78 /// </summary>
79 public MSIExec()
80 : this(Environment.SystemDirectory)
81 {
82 }
83
84 /// <summary>
85 /// Constructor that accepts a path to the MSIExec location.
86 /// </summary>
87 /// <param name="toolDirectory">The directory of MSIExec.exe.</param>
88 public MSIExec(string toolDirectory)
89 : base(Path.Combine(toolDirectory, "MSIExec.exe"))
90 {
91 this.SetDefaultArguments();
92 }
93
94 public override ExternalExecutableResult Run(bool assertOnError)
95 {
96 this.Arguments = this.GetArguments();
97 return base.Run(assertOnError);
98 }
99
100 /// <summary>
101 /// Clears all of the assigned arguments and resets them to the default values.
102 /// </summary>
103 public void SetDefaultArguments()
104 {
105 this.ExecutionMode = MSIExecMode.Install;
106 this.Product = String.Empty;
107 this.Quiet = true;
108 this.Passive = false;
109 this.UserInterfaceLevel = MSIExecUserInterfaceLevel.None;
110 this.NoRestart = true;
111 this.ForceRestart = false;
112 this.PromptRestart = false;
113 this.LogFile = String.Empty;
114 this.LoggingOptions = MSIExecLoggingOptions.Log_All_Information | MSIExecLoggingOptions.Verbose_Output | MSIExecLoggingOptions.Extra_Debugging_Information; // `/l*vx`
115 this.OtherArguments = String.Empty;
116 }
117
118 public string GetArguments()
119 {
120 var arguments = new StringBuilder();
121
122 // quiet
123 if (this.Quiet)
124 {
125 arguments.Append(" /quiet ");
126 }
127
128 // passive
129 if (this.Passive)
130 {
131 arguments.Append(" /passive ");
132 }
133
134 // UserInterfaceLevel
135 switch (this.UserInterfaceLevel)
136 {
137 case MSIExecUserInterfaceLevel.None:
138 arguments.Append(" /qn ");
139 break;
140 case MSIExecUserInterfaceLevel.Basic:
141 arguments.Append(" /qb ");
142 break;
143 case MSIExecUserInterfaceLevel.Reduced:
144 arguments.Append(" /qr ");
145 break;
146 case MSIExecUserInterfaceLevel.Full:
147 arguments.Append(" /qf ");
148 break;
149 }
150
151 // NoRestart
152 if (this.NoRestart)
153 {
154 arguments.Append(" /norestart ");
155 }
156
157 // PromptRestart
158 if (this.PromptRestart)
159 {
160 arguments.Append(" /promptrestart ");
161 }
162
163 // ForceRestart
164 if (this.ForceRestart)
165 {
166 arguments.Append(" /forcerestart ");
167 }
168
169 // Logging options
170 var loggingOptionsString = new StringBuilder();
171 if ((this.LoggingOptions & MSIExecLoggingOptions.Status_Messages) == MSIExecLoggingOptions.Status_Messages)
172 {
173 loggingOptionsString.Append("i");
174 }
175 if ((this.LoggingOptions & MSIExecLoggingOptions.Nonfatal_Warnings) == MSIExecLoggingOptions.Nonfatal_Warnings)
176 {
177 loggingOptionsString.Append("w");
178 }
179 if ((this.LoggingOptions & MSIExecLoggingOptions.All_Error_Messages) == MSIExecLoggingOptions.All_Error_Messages)
180 {
181 loggingOptionsString.Append("e");
182 }
183 if ((this.LoggingOptions & MSIExecLoggingOptions.Start_Up_Of_Actions) == MSIExecLoggingOptions.Start_Up_Of_Actions)
184 {
185 loggingOptionsString.Append("a");
186 }
187 if ((this.LoggingOptions & MSIExecLoggingOptions.Action_Specific_Records) == MSIExecLoggingOptions.Action_Specific_Records)
188 {
189 loggingOptionsString.Append("r");
190 }
191 if ((this.LoggingOptions & MSIExecLoggingOptions.User_Requests) == MSIExecLoggingOptions.User_Requests)
192 {
193 loggingOptionsString.Append("u");
194 }
195 if ((this.LoggingOptions & MSIExecLoggingOptions.Initial_UI_Parameters) == MSIExecLoggingOptions.Initial_UI_Parameters)
196 {
197 loggingOptionsString.Append("c");
198 }
199 if ((this.LoggingOptions & MSIExecLoggingOptions.OutOfMemory_Or_Fatal_Exit_Information) == MSIExecLoggingOptions.OutOfMemory_Or_Fatal_Exit_Information)
200 {
201 loggingOptionsString.Append("m");
202 }
203 if ((this.LoggingOptions & MSIExecLoggingOptions.OutOfDiskSpace_Messages) == MSIExecLoggingOptions.OutOfDiskSpace_Messages)
204 {
205 loggingOptionsString.Append("o");
206 }
207 if ((this.LoggingOptions & MSIExecLoggingOptions.Terminal_Properties) == MSIExecLoggingOptions.Terminal_Properties)
208 {
209 loggingOptionsString.Append("p");
210 }
211 if ((this.LoggingOptions & MSIExecLoggingOptions.Verbose_Output) == MSIExecLoggingOptions.Verbose_Output)
212 {
213 loggingOptionsString.Append("v");
214 }
215 if ((this.LoggingOptions & MSIExecLoggingOptions.Extra_Debugging_Information) == MSIExecLoggingOptions.Extra_Debugging_Information)
216 {
217 loggingOptionsString.Append("x");
218 }
219 if ((this.LoggingOptions & MSIExecLoggingOptions.Append_To_Existing_Log_File) == MSIExecLoggingOptions.Append_To_Existing_Log_File)
220 {
221 loggingOptionsString.Append("+");
222 }
223 if ((this.LoggingOptions & MSIExecLoggingOptions.Flush_Each_line) == MSIExecLoggingOptions.Flush_Each_line)
224 {
225 loggingOptionsString.Append("!");
226 }
227 if ((this.LoggingOptions & MSIExecLoggingOptions.Log_All_Information) == MSIExecLoggingOptions.Log_All_Information)
228 {
229 loggingOptionsString.Append("*");
230 }
231
232 // logfile and logging options
233 if (0 != loggingOptionsString.Length || !String.IsNullOrEmpty(this.LogFile))
234 {
235 arguments.Append(" /l");
236 if (0 != loggingOptionsString.Length)
237 {
238 arguments.AppendFormat("{0} ", loggingOptionsString);
239 }
240 if (!String.IsNullOrEmpty(this.LogFile))
241 {
242 arguments.AppendFormat(" \"{0}\" ", this.LogFile);
243 }
244 }
245
246 // OtherArguments
247 if (!String.IsNullOrEmpty(this.OtherArguments))
248 {
249 arguments.AppendFormat(" {0} ", this.OtherArguments);
250 }
251
252 // execution mode
253 switch (this.ExecutionMode)
254 {
255 case MSIExecMode.Install:
256 arguments.Append(" /package ");
257 break;
258 case MSIExecMode.AdministrativeInstall:
259 arguments.Append(" /a ");
260 break;
261 case MSIExecMode.Repair:
262 arguments.Append(" /fvomusa ");
263 break;
264 case MSIExecMode.Cleanup:
265 case MSIExecMode.Uninstall:
266 arguments.Append(" /uninstall ");
267 break;
268 };
269
270 // product
271 if (!String.IsNullOrEmpty(this.Product))
272 {
273 arguments.AppendFormat(" \"{0}\" ", this.Product);
274 }
275
276 return arguments.ToString();
277 }
278
279 /// <summary>
280 /// Return codes from an MSI install or uninstall
281 /// </summary>
282 /// <remarks>
283 /// Error codes indicative of success are:
284 /// ERROR_SUCCESS, ERROR_SUCCESS_REBOOT_INITIATED, and ERROR_SUCCESS_REBOOT_REQUIRED
285 /// </remarks>
286 public enum MSIExecReturnCode
287 {
288 /// <summary>
289 /// ERROR_SUCCESS 0
290 /// Action completed successfully.
291 /// </summary>
292 SUCCESS = 0,
293
294 /// <summary>
295 /// ERROR_INVALID_DATA 13
296 /// The data is invalid.
297 /// </summary>
298 ERROR_INVALID_DATA = 13,
299
300 /// <summary>
301 /// ERROR_INVALID_PARAMETER 87
302 /// One of the parameters was invalid.
303 /// </summary>
304 ERROR_INVALID_PARAMETER = 87,
305
306 /// <summary>
307 /// ERROR_CALL_NOT_IMPLEMENTED 120
308 /// This value is returned when a custom action attempts to call a function that cannot be called from custom actions.
309 /// The function returns the value ERROR_CALL_NOT_IMPLEMENTED. Available beginning with Windows Installer version 3.0.
310 /// </summary>
311 ERROR_CALL_NOT_IMPLEMENTED = 120,
312
313 /// <summary>
314 /// ERROR_FILENAME_EXCED_RANGE 206
315 /// The filename or extension is too long.
316 /// </summary>
317 ERROR_FILENAME_EXCED_RANGE = 206,
318
319 /// <summary>
320 /// ERROR_APPHELP_BLOCK 1259
321 /// If Windows Installer determines a product may be incompatible with the current operating system,
322 /// it displays a dialog box informing the user and asking whether to try to install anyway.
323 /// This error code is returned if the user chooses not to try the installation.
324 /// </summary>
325 ERROR_APPHELP_BLOCK = 1259,
326
327 /// <summary>
328 /// ERROR_INSTALL_SERVICE_FAILURE 1601
329 /// The Windows Installer service could not be accessed.
330 /// Contact your support personnel to verify that the Windows Installer service is properly registered.
331 /// </summary>
332 ERROR_INSTALL_SERVICE_FAILURE = 1601,
333
334
335 /// <summary>
336 /// ERROR_INSTALL_USEREXIT 1602
337 /// The user cancels installation.
338 /// </summary>
339 ERROR_INSTALL_USEREXIT = 1602,
340
341 /// <summary>
342 /// ERROR_INSTALL_FAILURE 1603
343 /// A fatal error occurred during installation.
344 /// </summary>
345 ERROR_INSTALL_FAILURE = 1603,
346
347 /// <summary>
348 /// ERROR_INSTALL_SUSPEND 1604
349 /// Installation suspended, incomplete.
350 /// </summary>
351 ERROR_INSTALL_SUSPEND = 1604,
352
353 /// <summary>
354 /// ERROR_UNKNOWN_PRODUCT 1605
355 /// This action is only valid for products that are currently installed.
356 /// </summary>
357 ERROR_UNKNOWN_PRODUCT = 1605,
358
359 /// <summary>
360 /// ERROR_UNKNOWN_FEATURE 1606
361 /// The feature identifier is not registered.
362 /// </summary>
363 ERROR_UNKNOWN_FEATURE = 1606,
364
365 /// <summary>
366 /// ERROR_UNKNOWN_COMPONENT 1607
367 /// The component identifier is not registered.
368 /// </summary>
369 ERROR_UNKNOWN_COMPONENT = 1607,
370
371 /// <summary>
372 /// ERROR_UNKNOWN_PROPERTY 1608
373 /// This is an unknown property.
374 /// </summary>
375 ERROR_UNKNOWN_PROPERTY = 1608,
376
377 /// <summary>
378 /// ERROR_INVALID_HANDLE_STATE 1609
379 /// The handle is in an invalid state.
380 /// </summary>
381 ERROR_INVALID_HANDLE_STATE = 1609,
382
383 /// <summary>
384 /// ERROR_BAD_CONFIGURATION 1610
385 /// The configuration data for this product is corrupt. Contact your support personnel.
386 /// </summary>
387 ERROR_BAD_CONFIGURATION = 1610,
388
389 /// <summary>
390 /// ERROR_INDEX_ABSENT 1611
391 /// The component qualifier not present.
392 /// </summary>
393 ERROR_INDEX_ABSENT = 1611,
394
395 /// <summary>ERROR_INSTALL_SOURCE_ABSENT 1612
396 /// The installation source for this product is not available.
397 /// Verify that the source exists and that you can access it.
398 /// </summary>
399 ERROR_INSTALL_SOURCE_ABSENT = 1612,
400
401 /// <summary>
402 /// ERROR_INSTALL_PACKAGE_VERSION 1613
403 /// This installation package cannot be installed by the Windows Installer service.
404 /// You must install a Windows service pack that contains a newer version of the Windows Installer service.
405 /// </summary>
406 ERROR_INSTALL_PACKAGE_VERSION = 1613,
407
408 /// <summary>
409 /// ERROR_PRODUCT_UNINSTALLED 1614
410 /// The product is uninstalled.
411 /// </summary>
412 ERROR_PRODUCT_UNINSTALLED = 1614,
413
414 /// <summary>
415 /// ERROR_BAD_QUERY_SYNTAX 1615
416 /// The SQL query syntax is invalid or unsupported.
417 /// </summary>
418 ERROR_BAD_QUERY_SYNTAX = 1615,
419
420 /// <summary>
421 /// ERROR_INVALID_FIELD 1616
422 /// The record field does not exist.
423 /// </summary>
424 ERROR_INVALID_FIELD = 1616,
425
426 /// <summary>
427 /// ERROR_INSTALL_ALREADY_RUNNING 1618
428 /// Another installation is already in progress. Complete that installation before proceeding with this install.
429 /// For information about the mutex, see _MSIExecute Mutex.
430 /// </summary>
431 ERROR_INSTALL_ALREADY_RUNNING = 1618,
432
433 /// <summary>
434 /// ERROR_INSTALL_PACKAGE_OPEN_FAILED 1619
435 /// This installation package could not be opened. Verify that the package exists and is accessible, or contact the
436 /// application vendor to verify that this is a valid Windows Installer package.
437 /// </summary>
438 ERROR_INSTALL_PACKAGE_OPEN_FAILED = 1619,
439
440
441 /// <summary>
442 /// ERROR_INSTALL_PACKAGE_INVALID 1620
443 /// This installation package could not be opened.
444 /// Contact the application vendor to verify that this is a valid Windows Installer package.
445 /// </summary>
446 ERROR_INSTALL_PACKAGE_INVALID = 1620,
447
448 /// <summary>
449 /// ERROR_INSTALL_UI_FAILURE 1621
450 /// There was an error starting the Windows Installer service user interface.
451 /// Contact your support personnel.
452 /// </summary>
453 ERROR_INSTALL_UI_FAILURE = 1621,
454
455 /// <summary>
456 /// ERROR_INSTALL_LOG_FAILURE 1622
457 /// There was an error opening installation log file.
458 /// Verify that the specified log file location exists and is writable.
459 /// </summary>
460 ERROR_INSTALL_LOG_FAILURE = 1622,
461
462 /// <summary>
463 /// ERROR_INSTALL_LANGUAGE_UNSUPPORTED 1623
464 /// This language of this installation package is not supported by your system.
465 /// </summary>
466 ERROR_INSTALL_LANGUAGE_UNSUPPORTED = 1623,
467
468 /// <summary>
469 /// ERROR_INSTALL_TRANSFORM_FAILURE 1624
470 /// There was an error applying transforms.
471 /// Verify that the specified transform paths are valid.
472 /// </summary>
473 ERROR_INSTALL_TRANSFORM_FAILURE = 1624,
474
475
476 /// <summary>
477 /// ERROR_INSTALL_PACKAGE_REJECTED 1625
478 /// This installation is forbidden by system policy.
479 /// Contact your system administrator.
480 /// </summary>
481 ERROR_INSTALL_PACKAGE_REJECTED = 1625,
482
483 /// <summary>
484 /// ERROR_FUNCTION_NOT_CALLED 1626
485 /// The function could not be executed.
486 /// </summary>
487 ERROR_FUNCTION_NOT_CALLED = 1626,
488
489 /// <summary>
490 /// ERROR_FUNCTION_FAILED 1627
491 /// The function failed during execution.
492 /// </summary>
493 ERROR_FUNCTION_FAILED = 1627,
494
495 /// <summary>
496 /// ERROR_INVALID_TABLE 1628
497 /// An invalid or unknown table was specified.
498 /// </summary>
499 ERROR_INVALID_TABLE = 1628,
500
501 /// <summary>
502 /// ERROR_DATATYPE_MISMATCH 1629
503 /// The data supplied is the wrong type.
504 /// </summary>
505 ERROR_DATATYPE_MISMATCH = 1629,
506
507 /// <summary>
508 /// ERROR_UNSUPPORTED_TYPE 1630
509 /// Data of this type is not supported.
510 /// </summary>
511 ERROR_UNSUPPORTED_TYPE = 1630,
512
513 /// <summary>
514 /// ERROR_CREATE_FAILED 1631
515 /// The Windows Installer service failed to start.
516 /// Contact your support personnel.
517 /// </summary>
518 ERROR_CREATE_FAILED = 1631,
519
520 /// <summary>
521 /// ERROR_INSTALL_TEMP_UNWRITABLE 1632
522 /// The Temp folder is either full or inaccessible.
523 /// Verify that the Temp folder exists and that you can write to it.
524 /// </summary>
525 ERROR_INSTALL_TEMP_UNWRITABLE = 1632,
526
527 /// <summary>
528 /// ERROR_INSTALL_PLATFORM_UNSUPPORTED 1633
529 /// This installation package is not supported on this platform. Contact your application vendor. </summary>
530 ERROR_INSTALL_PLATFORM_UNSUPPORTED = 1633,
531
532 /// <summary>
533 /// ERROR_INSTALL_NOTUSED 1634
534 /// Component is not used on this machine.
535 /// </summary>
536 ERROR_INSTALL_NOTUSED = 1634,
537
538 /// <summary>
539 /// ERROR_PATCH_PACKAGE_OPEN_FAILED 1635
540 /// This patch package could not be opened. Verify that the patch package exists and is accessible,
541 /// or contact the application vendor to verify that this is a valid Windows Installer patch package.
542 /// </summary>
543 ERROR_PATCH_PACKAGE_OPEN_FAILED = 1635,
544
545 /// <summary>
546 /// ERROR_PATCH_PACKAGE_INVALID 1636
547 /// This patch package could not be opened.
548 /// Contact the application vendor to verify that this is a valid Windows Installer patch package.
549 /// </summary>
550 ERROR_PATCH_PACKAGE_INVALID = 1636,
551
552 /// <summary>
553 /// ERROR_PATCH_PACKAGE_UNSUPPORTED 1637
554 /// This patch package cannot be processed by the Windows Installer service.
555 /// You must install a Windows service pack that contains a newer version of the Windows Installer service.
556 /// </summary>
557 ERROR_PATCH_PACKAGE_UNSUPPORTED = 1637,
558
559 /// <summary>
560 /// ERROR_PRODUCT_VERSION 1638
561 /// Another version of this product is already installed.
562 /// Installation of this version cannot continue. To configure or remove the existing version of this product,
563 /// use Add/Remove Programs in Control Panel.
564 /// </summary>
565 ERROR_PRODUCT_VERSION = 1638,
566
567 /// <summary>
568 /// ERROR_INVALID_COMMAND_LINE 1639
569 /// Invalid command line argument.
570 /// Consult the Windows Installer SDK for detailed command-line help.
571 /// </summary>
572 ERROR_INVALID_COMMAND_LINE = 1639,
573
574 /// <summary>
575 /// ERROR_INSTALL_REMOTE_DISALLOWED 1640
576 /// The current user is not permitted to perform installations from a client session of a server running the
577 /// Terminal Server role service.
578 /// </summary>
579 ERROR_INSTALL_REMOTE_DISALLOWED = 1640,
580
581 /// <summary>
582 /// ERROR_SUCCESS_REBOOT_INITIATED 1641
583 /// The installer has initiated a restart.
584 /// This message is indicative of a success.
585 /// </summary>
586 ERROR_SUCCESS_REBOOT_INITIATED = 1641,
587
588 /// <summary>
589 /// ERROR_PATCH_TARGET_NOT_FOUND 1642
590 /// The installer cannot install the upgrade patch because the program being upgraded may be missing or the
591 /// upgrade patch updates a different version of the program.
592 /// Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch.
593 /// </summary>
594 ERROR_PATCH_TARGET_NOT_FOUND = 1642,
595
596 /// <summary>
597 /// ERROR_PATCH_PACKAGE_REJECTED 1643
598 /// The patch package is not permitted by system policy.
599 /// </summary>
600 ERROR_PATCH_PACKAGE_REJECTED = 1643,
601
602 /// <summary>
603 /// ERROR_INSTALL_TRANSFORM_REJECTED 1644
604 /// One or more customizations are not permitted by system policy.
605 /// </summary>
606 ERROR_INSTALL_TRANSFORM_REJECTED = 1644,
607
608 /// <summary>
609 /// ERROR_INSTALL_REMOTE_PROHIBITED 1645
610 /// Windows Installer does not permit installation from a Remote Desktop Connection.
611 /// </summary>
612 ERROR_INSTALL_REMOTE_PROHIBITED = 1645,
613
614 /// <summary>
615 /// ERROR_PATCH_REMOVAL_UNSUPPORTED 1646
616 /// The patch package is not a removable patch package. Available beginning with Windows Installer version 3.0.
617 /// </summary>
618 ERROR_PATCH_REMOVAL_UNSUPPORTED = 1646,
619
620 /// <summary>
621 /// ERROR_UNKNOWN_PATCH 1647
622 /// The patch is not applied to this product. Available beginning with Windows Installer version 3.0.
623 /// </summary>
624 ERROR_UNKNOWN_PATCH = 1647,
625
626 /// <summary>
627 /// ERROR_PATCH_NO_SEQUENCE 1648
628 /// No valid sequence could be found for the set of patches. Available beginning with Windows Installer version 3.0.
629 /// </summary>
630 ERROR_PATCH_NO_SEQUENCE = 1648,
631
632 /// <summary>
633 /// ERROR_PATCH_REMOVAL_DISALLOWED 1649
634 /// Patch removal was disallowed by policy. Available beginning with Windows Installer version 3.0. </summary>
635 ERROR_PATCH_REMOVAL_DISALLOWED = 1649,
636
637 /// <summary>
638 /// ERROR_INVALID_PATCH_XML = 1650
639 /// The XML patch data is invalid. Available beginning with Windows Installer version 3.0.
640 /// </summary>
641 ERROR_INVALID_PATCH_XML = 1650,
642
643 /// <summary>
644 /// ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT 1651
645 /// Administrative user failed to apply patch for a per-user managed or a per-machine application that is in advertise state.
646 /// Available beginning with Windows Installer version 3.0. </summary>
647 ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT = 1651,
648
649 /// <summary>
650 /// ERROR_INSTALL_SERVICE_SAFEBOOT 1652
651 /// Windows Installer is not accessible when the computer is in Safe Mode.
652 /// Exit Safe Mode and try again or try using System Restore to return your computer to a previous state.
653 /// Available beginning with Windows Installer version 4.0.
654 /// </summary>
655 ERROR_INSTALL_SERVICE_SAFEBOOT = 1652,
656
657 /// <summary>
658 /// ERROR_ROLLBACK_DISABLED 1653
659 /// Could not perform a multiple-package transaction because rollback has been disabled.
660 /// Multiple-Package Installations cannot run if rollback is disabled. Available beginning with Windows Installer version 4.5.
661 /// </summary>
662 ERROR_ROLLBACK_DISABLED = 1653,
663
664 /// <summary>
665 /// ERROR_SUCCESS_REBOOT_REQUIRED 3010
666 /// A restart is required to complete the install. This message is indicative of a success.
667 /// This does not include installs where the ForceReboot action is run.
668 /// </summary>
669 ERROR_SUCCESS_REBOOT_REQUIRED = 3010,
670
671 /// <summary>
672 /// ERROR_SUCCESS_REBOOT_REQUIRED 3017
673 /// The requested operation failed. A system reboot is required to roll back changes made.
674 /// </summary>
675 ERROR_FAIL_REBOOT_REQUIRED = 3017,
676 }
677
678 /// <summary>
679 /// Modes of operations for MSIExec; install, administrator install, uninstall .. etc
680 /// </summary>
681 public enum MSIExecMode
682 {
683 /// <summary>
684 /// Installs or configures a product
685 /// </summary>
686 Install = 0,
687
688 /// <summary>
689 /// Administrative install - Installs a product on the network
690 /// </summary>
691 AdministrativeInstall,
692
693 /// <summary>
694 /// Uninstalls the product
695 /// </summary>
696 Uninstall,
697
698 /// <summary>
699 /// Repairs a product
700 /// </summary>
701 Repair,
702
703 /// <summary>
704 /// Modifies a product
705 /// </summary>
706 Modify,
707
708 /// <summary>
709 /// Uninstalls the product as part of cleanup
710 /// </summary>
711 Cleanup,
712
713 /// <summary>
714 /// No action automatically added to arguments
715 /// </summary>
716 Custom,
717 }
718
719 /// <summary>
720 /// User interfave levels
721 /// </summary>
722 public enum MSIExecUserInterfaceLevel
723 {
724 /// <summary>
725 /// No UI
726 /// </summary>
727 None = 0,
728
729 /// <summary>
730 /// Basic UI
731 /// </summary>
732 Basic,
733
734 /// <summary>
735 /// Reduced UI
736 /// </summary>
737 Reduced,
738
739 /// <summary>
740 /// Full UI (default)
741 /// </summary>
742 Full
743 }
744
745 /// <summary>
746 /// Logging options
747 /// </summary>
748 [Flags]
749 public enum MSIExecLoggingOptions
750 {
751 Status_Messages = 0x0001,
752 Nonfatal_Warnings = 0x0002,
753 All_Error_Messages = 0x0004,
754 Start_Up_Of_Actions = 0x0008,
755 Action_Specific_Records = 0x0010,
756 User_Requests = 0x0020,
757 Initial_UI_Parameters = 0x0040,
758 OutOfMemory_Or_Fatal_Exit_Information = 0x0080,
759 OutOfDiskSpace_Messages = 0x0100,
760 Terminal_Properties = 0x0200,
761 Verbose_Output = 0x0400,
762 Append_To_Existing_Log_File = 0x0800,
763
764 Flush_Each_line = 0x1000,
765 Extra_Debugging_Information = 0x2000,
766 Log_All_Information = 0x4000,
767 VOICEWARMUP = 0x0FFF
768 }
769 }
770 }