diff options
Diffstat (limited to 'src/WixTestTools/MSIExec.cs')
| -rw-r--r-- | src/WixTestTools/MSIExec.cs | 753 |
1 files changed, 753 insertions, 0 deletions
diff --git a/src/WixTestTools/MSIExec.cs b/src/WixTestTools/MSIExec.cs new file mode 100644 index 00000000..8dce96cf --- /dev/null +++ b/src/WixTestTools/MSIExec.cs | |||
| @@ -0,0 +1,753 @@ | |||
| 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 WixBuildTools.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.VOICEWARMUP; | ||
| 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(" /f "); | ||
| 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_APPHELP_BLOCK 1259 | ||
| 315 | /// If Windows Installer determines a product may be incompatible with the current operating system, | ||
| 316 | /// it displays a dialog box informing the user and asking whether to try to install anyway. | ||
| 317 | /// This error code is returned if the user chooses not to try the installation. | ||
| 318 | /// </summary> | ||
| 319 | ERROR_APPHELP_BLOCK = 1259, | ||
| 320 | |||
| 321 | /// <summary> | ||
| 322 | /// ERROR_INSTALL_SERVICE_FAILURE 1601 | ||
| 323 | /// The Windows Installer service could not be accessed. | ||
| 324 | /// Contact your support personnel to verify that the Windows Installer service is properly registered. | ||
| 325 | /// </summary> | ||
| 326 | ERROR_INSTALL_SERVICE_FAILURE = 1601, | ||
| 327 | |||
| 328 | |||
| 329 | /// <summary> | ||
| 330 | /// ERROR_INSTALL_USEREXIT 1602 | ||
| 331 | /// The user cancels installation. | ||
| 332 | /// </summary> | ||
| 333 | ERROR_INSTALL_USEREXIT = 1602, | ||
| 334 | |||
| 335 | /// <summary> | ||
| 336 | /// ERROR_INSTALL_FAILURE 1603 | ||
| 337 | /// A fatal error occurred during installation. | ||
| 338 | /// </summary> | ||
| 339 | ERROR_INSTALL_FAILURE = 1603, | ||
| 340 | |||
| 341 | /// <summary> | ||
| 342 | /// ERROR_INSTALL_SUSPEND 1604 | ||
| 343 | /// Installation suspended, incomplete. | ||
| 344 | /// </summary> | ||
| 345 | ERROR_INSTALL_SUSPEND = 1604, | ||
| 346 | |||
| 347 | /// <summary> | ||
| 348 | /// ERROR_UNKNOWN_PRODUCT 1605 | ||
| 349 | /// This action is only valid for products that are currently installed. | ||
| 350 | /// </summary> | ||
| 351 | ERROR_UNKNOWN_PRODUCT = 1605, | ||
| 352 | |||
| 353 | /// <summary> | ||
| 354 | /// ERROR_UNKNOWN_FEATURE 1606 | ||
| 355 | /// The feature identifier is not registered. | ||
| 356 | /// </summary> | ||
| 357 | ERROR_UNKNOWN_FEATURE = 1606, | ||
| 358 | |||
| 359 | /// <summary> | ||
| 360 | /// ERROR_UNKNOWN_COMPONENT 1607 | ||
| 361 | /// The component identifier is not registered. | ||
| 362 | /// </summary> | ||
| 363 | ERROR_UNKNOWN_COMPONENT = 1607, | ||
| 364 | |||
| 365 | /// <summary> | ||
| 366 | /// ERROR_UNKNOWN_PROPERTY 1608 | ||
| 367 | /// This is an unknown property. | ||
| 368 | /// </summary> | ||
| 369 | ERROR_UNKNOWN_PROPERTY = 1608, | ||
| 370 | |||
| 371 | /// <summary> | ||
| 372 | /// ERROR_INVALID_HANDLE_STATE 1609 | ||
| 373 | /// The handle is in an invalid state. | ||
| 374 | /// </summary> | ||
| 375 | ERROR_INVALID_HANDLE_STATE = 1609, | ||
| 376 | |||
| 377 | /// <summary> | ||
| 378 | /// ERROR_BAD_CONFIGURATION 1610 | ||
| 379 | /// The configuration data for this product is corrupt. Contact your support personnel. | ||
| 380 | /// </summary> | ||
| 381 | ERROR_BAD_CONFIGURATION = 1610, | ||
| 382 | |||
| 383 | /// <summary> | ||
| 384 | /// ERROR_INDEX_ABSENT 1611 | ||
| 385 | /// The component qualifier not present. | ||
| 386 | /// </summary> | ||
| 387 | ERROR_INDEX_ABSENT = 1611, | ||
| 388 | |||
| 389 | /// <summary>ERROR_INSTALL_SOURCE_ABSENT 1612 | ||
| 390 | /// The installation source for this product is not available. | ||
| 391 | /// Verify that the source exists and that you can access it. | ||
| 392 | /// </summary> | ||
| 393 | ERROR_INSTALL_SOURCE_ABSENT = 1612, | ||
| 394 | |||
| 395 | /// <summary> | ||
| 396 | /// ERROR_INSTALL_PACKAGE_VERSION 1613 | ||
| 397 | /// This installation package cannot be installed by the Windows Installer service. | ||
| 398 | /// You must install a Windows service pack that contains a newer version of the Windows Installer service. | ||
| 399 | /// </summary> | ||
| 400 | ERROR_INSTALL_PACKAGE_VERSION = 1613, | ||
| 401 | |||
| 402 | /// <summary> | ||
| 403 | /// ERROR_PRODUCT_UNINSTALLED 1614 | ||
| 404 | /// The product is uninstalled. | ||
| 405 | /// </summary> | ||
| 406 | ERROR_PRODUCT_UNINSTALLED = 1614, | ||
| 407 | |||
| 408 | /// <summary> | ||
| 409 | /// ERROR_BAD_QUERY_SYNTAX 1615 | ||
| 410 | /// The SQL query syntax is invalid or unsupported. | ||
| 411 | /// </summary> | ||
| 412 | ERROR_BAD_QUERY_SYNTAX = 1615, | ||
| 413 | |||
| 414 | /// <summary> | ||
| 415 | /// ERROR_INVALID_FIELD 1616 | ||
| 416 | /// The record field does not exist. | ||
| 417 | /// </summary> | ||
| 418 | ERROR_INVALID_FIELD = 1616, | ||
| 419 | |||
| 420 | /// <summary> | ||
| 421 | /// ERROR_INSTALL_ALREADY_RUNNING 1618 | ||
| 422 | /// Another installation is already in progress. Complete that installation before proceeding with this install. | ||
| 423 | /// For information about the mutex, see _MSIExecute Mutex. | ||
| 424 | /// </summary> | ||
| 425 | ERROR_INSTALL_ALREADY_RUNNING = 1618, | ||
| 426 | |||
| 427 | /// <summary> | ||
| 428 | /// ERROR_INSTALL_PACKAGE_OPEN_FAILED 1619 | ||
| 429 | /// This installation package could not be opened. Verify that the package exists and is accessible, or contact the | ||
| 430 | /// application vendor to verify that this is a valid Windows Installer package. | ||
| 431 | /// </summary> | ||
| 432 | ERROR_INSTALL_PACKAGE_OPEN_FAILED = 1619, | ||
| 433 | |||
| 434 | |||
| 435 | /// <summary> | ||
| 436 | /// ERROR_INSTALL_PACKAGE_INVALID 1620 | ||
| 437 | /// This installation package could not be opened. | ||
| 438 | /// Contact the application vendor to verify that this is a valid Windows Installer package. | ||
| 439 | /// </summary> | ||
| 440 | ERROR_INSTALL_PACKAGE_INVALID = 1620, | ||
| 441 | |||
| 442 | /// <summary> | ||
| 443 | /// ERROR_INSTALL_UI_FAILURE 1621 | ||
| 444 | /// There was an error starting the Windows Installer service user interface. | ||
| 445 | /// Contact your support personnel. | ||
| 446 | /// </summary> | ||
| 447 | ERROR_INSTALL_UI_FAILURE = 1621, | ||
| 448 | |||
| 449 | /// <summary> | ||
| 450 | /// ERROR_INSTALL_LOG_FAILURE 1622 | ||
| 451 | /// There was an error opening installation log file. | ||
| 452 | /// Verify that the specified log file location exists and is writable. | ||
| 453 | /// </summary> | ||
| 454 | ERROR_INSTALL_LOG_FAILURE = 1622, | ||
| 455 | |||
| 456 | /// <summary> | ||
| 457 | /// ERROR_INSTALL_LANGUAGE_UNSUPPORTED 1623 | ||
| 458 | /// This language of this installation package is not supported by your system. | ||
| 459 | /// </summary> | ||
| 460 | ERROR_INSTALL_LANGUAGE_UNSUPPORTED = 1623, | ||
| 461 | |||
| 462 | /// <summary> | ||
| 463 | /// ERROR_INSTALL_TRANSFORM_FAILURE 1624 | ||
| 464 | /// There was an error applying transforms. | ||
| 465 | /// Verify that the specified transform paths are valid. | ||
| 466 | /// </summary> | ||
| 467 | ERROR_INSTALL_TRANSFORM_FAILURE = 1624, | ||
| 468 | |||
| 469 | |||
| 470 | /// <summary> | ||
| 471 | /// ERROR_INSTALL_PACKAGE_REJECTED 1625 | ||
| 472 | /// This installation is forbidden by system policy. | ||
| 473 | /// Contact your system administrator. | ||
| 474 | /// </summary> | ||
| 475 | ERROR_INSTALL_PACKAGE_REJECTED = 1625, | ||
| 476 | |||
| 477 | /// <summary> | ||
| 478 | /// ERROR_FUNCTION_NOT_CALLED 1626 | ||
| 479 | /// The function could not be executed. | ||
| 480 | /// </summary> | ||
| 481 | ERROR_FUNCTION_NOT_CALLED = 1626, | ||
| 482 | |||
| 483 | /// <summary> | ||
| 484 | /// ERROR_FUNCTION_FAILED 1627 | ||
| 485 | /// The function failed during execution. | ||
| 486 | /// </summary> | ||
| 487 | ERROR_FUNCTION_FAILED = 1627, | ||
| 488 | |||
| 489 | /// <summary> | ||
| 490 | /// ERROR_INVALID_TABLE 1628 | ||
| 491 | /// An invalid or unknown table was specified. | ||
| 492 | /// </summary> | ||
| 493 | ERROR_INVALID_TABLE = 1628, | ||
| 494 | |||
| 495 | /// <summary> | ||
| 496 | /// ERROR_DATATYPE_MISMATCH 1629 | ||
| 497 | /// The data supplied is the wrong type. | ||
| 498 | /// </summary> | ||
| 499 | ERROR_DATATYPE_MISMATCH = 1629, | ||
| 500 | |||
| 501 | /// <summary> | ||
| 502 | /// ERROR_UNSUPPORTED_TYPE 1630 | ||
| 503 | /// Data of this type is not supported. | ||
| 504 | /// </summary> | ||
| 505 | ERROR_UNSUPPORTED_TYPE = 1630, | ||
| 506 | |||
| 507 | /// <summary> | ||
| 508 | /// ERROR_CREATE_FAILED 1631 | ||
| 509 | /// The Windows Installer service failed to start. | ||
| 510 | /// Contact your support personnel. | ||
| 511 | /// </summary> | ||
| 512 | ERROR_CREATE_FAILED = 1631, | ||
| 513 | |||
| 514 | /// <summary> | ||
| 515 | /// ERROR_INSTALL_TEMP_UNWRITABLE 1632 | ||
| 516 | /// The Temp folder is either full or inaccessible. | ||
| 517 | /// Verify that the Temp folder exists and that you can write to it. | ||
| 518 | /// </summary> | ||
| 519 | ERROR_INSTALL_TEMP_UNWRITABLE = 1632, | ||
| 520 | |||
| 521 | /// <summary> | ||
| 522 | /// ERROR_INSTALL_PLATFORM_UNSUPPORTED 1633 | ||
| 523 | /// This installation package is not supported on this platform. Contact your application vendor. </summary> | ||
| 524 | ERROR_INSTALL_PLATFORM_UNSUPPORTED = 1633, | ||
| 525 | |||
| 526 | /// <summary> | ||
| 527 | /// ERROR_INSTALL_NOTUSED 1634 | ||
| 528 | /// Component is not used on this machine. | ||
| 529 | /// </summary> | ||
| 530 | ERROR_INSTALL_NOTUSED = 1634, | ||
| 531 | |||
| 532 | /// <summary> | ||
| 533 | /// ERROR_PATCH_PACKAGE_OPEN_FAILED 1635 | ||
| 534 | /// This patch package could not be opened. Verify that the patch package exists and is accessible, | ||
| 535 | /// or contact the application vendor to verify that this is a valid Windows Installer patch package. | ||
| 536 | /// </summary> | ||
| 537 | ERROR_PATCH_PACKAGE_OPEN_FAILED = 1635, | ||
| 538 | |||
| 539 | /// <summary> | ||
| 540 | /// ERROR_PATCH_PACKAGE_INVALID 1636 | ||
| 541 | /// This patch package could not be opened. | ||
| 542 | /// Contact the application vendor to verify that this is a valid Windows Installer patch package. | ||
| 543 | /// </summary> | ||
| 544 | ERROR_PATCH_PACKAGE_INVALID = 1636, | ||
| 545 | |||
| 546 | /// <summary> | ||
| 547 | /// ERROR_PATCH_PACKAGE_UNSUPPORTED 1637 | ||
| 548 | /// This patch package cannot be processed by the Windows Installer service. | ||
| 549 | /// You must install a Windows service pack that contains a newer version of the Windows Installer service. | ||
| 550 | /// </summary> | ||
| 551 | ERROR_PATCH_PACKAGE_UNSUPPORTED = 1637, | ||
| 552 | |||
| 553 | /// <summary> | ||
| 554 | /// ERROR_PRODUCT_VERSION 1638 | ||
| 555 | /// Another version of this product is already installed. | ||
| 556 | /// Installation of this version cannot continue. To configure or remove the existing version of this product, | ||
| 557 | /// use Add/Remove Programs in Control Panel. | ||
| 558 | /// </summary> | ||
| 559 | ERROR_PRODUCT_VERSION = 1638, | ||
| 560 | |||
| 561 | /// <summary> | ||
| 562 | /// ERROR_INVALID_COMMAND_LINE 1639 | ||
| 563 | /// Invalid command line argument. | ||
| 564 | /// Consult the Windows Installer SDK for detailed command-line help. | ||
| 565 | /// </summary> | ||
| 566 | ERROR_INVALID_COMMAND_LINE = 1639, | ||
| 567 | |||
| 568 | /// <summary> | ||
| 569 | /// ERROR_INSTALL_REMOTE_DISALLOWED 1640 | ||
| 570 | /// The current user is not permitted to perform installations from a client session of a server running the | ||
| 571 | /// Terminal Server role service. | ||
| 572 | /// </summary> | ||
| 573 | ERROR_INSTALL_REMOTE_DISALLOWED = 1640, | ||
| 574 | |||
| 575 | /// <summary> | ||
| 576 | /// ERROR_SUCCESS_REBOOT_INITIATED 1641 | ||
| 577 | /// The installer has initiated a restart. | ||
| 578 | /// This message is indicative of a success. | ||
| 579 | /// </summary> | ||
| 580 | ERROR_SUCCESS_REBOOT_INITIATED = 1641, | ||
| 581 | |||
| 582 | /// <summary> | ||
| 583 | /// ERROR_PATCH_TARGET_NOT_FOUND 1642 | ||
| 584 | /// The installer cannot install the upgrade patch because the program being upgraded may be missing or the | ||
| 585 | /// upgrade patch updates a different version of the program. | ||
| 586 | /// Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch. | ||
| 587 | /// </summary> | ||
| 588 | ERROR_PATCH_TARGET_NOT_FOUND = 1642, | ||
| 589 | |||
| 590 | /// <summary> | ||
| 591 | /// ERROR_PATCH_PACKAGE_REJECTED 1643 | ||
| 592 | /// The patch package is not permitted by system policy. | ||
| 593 | /// </summary> | ||
| 594 | ERROR_PATCH_PACKAGE_REJECTED = 1643, | ||
| 595 | |||
| 596 | /// <summary> | ||
| 597 | /// ERROR_INSTALL_TRANSFORM_REJECTED 1644 | ||
| 598 | /// One or more customizations are not permitted by system policy. | ||
| 599 | /// </summary> | ||
| 600 | ERROR_INSTALL_TRANSFORM_REJECTED = 1644, | ||
| 601 | |||
| 602 | /// <summary> | ||
| 603 | /// ERROR_INSTALL_REMOTE_PROHIBITED 1645 | ||
| 604 | /// Windows Installer does not permit installation from a Remote Desktop Connection. | ||
| 605 | /// </summary> | ||
| 606 | ERROR_INSTALL_REMOTE_PROHIBITED = 1645, | ||
| 607 | |||
| 608 | /// <summary> | ||
| 609 | /// ERROR_PATCH_REMOVAL_UNSUPPORTED 1646 | ||
| 610 | /// The patch package is not a removable patch package. Available beginning with Windows Installer version 3.0. | ||
| 611 | /// </summary> | ||
| 612 | ERROR_PATCH_REMOVAL_UNSUPPORTED = 1646, | ||
| 613 | |||
| 614 | /// <summary> | ||
| 615 | /// ERROR_UNKNOWN_PATCH 1647 | ||
| 616 | /// The patch is not applied to this product. Available beginning with Windows Installer version 3.0. | ||
| 617 | /// </summary> | ||
| 618 | ERROR_UNKNOWN_PATCH = 1647, | ||
| 619 | |||
| 620 | /// <summary> | ||
| 621 | /// ERROR_PATCH_NO_SEQUENCE 1648 | ||
| 622 | /// No valid sequence could be found for the set of patches. Available beginning with Windows Installer version 3.0. | ||
| 623 | /// </summary> | ||
| 624 | ERROR_PATCH_NO_SEQUENCE = 1648, | ||
| 625 | |||
| 626 | /// <summary> | ||
| 627 | /// ERROR_PATCH_REMOVAL_DISALLOWED 1649 | ||
| 628 | /// Patch removal was disallowed by policy. Available beginning with Windows Installer version 3.0. </summary> | ||
| 629 | ERROR_PATCH_REMOVAL_DISALLOWED = 1649, | ||
| 630 | |||
| 631 | /// <summary> | ||
| 632 | /// ERROR_INVALID_PATCH_XML = 1650 | ||
| 633 | /// The XML patch data is invalid. Available beginning with Windows Installer version 3.0. | ||
| 634 | /// </summary> | ||
| 635 | ERROR_INVALID_PATCH_XML = 1650, | ||
| 636 | |||
| 637 | /// <summary> | ||
| 638 | /// ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT 1651 | ||
| 639 | /// Administrative user failed to apply patch for a per-user managed or a per-machine application that is in advertise state. | ||
| 640 | /// Available beginning with Windows Installer version 3.0. </summary> | ||
| 641 | ERROR_PATCH_MANAGED_ADVERTISED_PRODUCT = 1651, | ||
| 642 | |||
| 643 | /// <summary> | ||
| 644 | /// ERROR_INSTALL_SERVICE_SAFEBOOT 1652 | ||
| 645 | /// Windows Installer is not accessible when the computer is in Safe Mode. | ||
| 646 | /// Exit Safe Mode and try again or try using System Restore to return your computer to a previous state. | ||
| 647 | /// Available beginning with Windows Installer version 4.0. | ||
| 648 | /// </summary> | ||
| 649 | ERROR_INSTALL_SERVICE_SAFEBOOT = 1652, | ||
| 650 | |||
| 651 | /// <summary> | ||
| 652 | /// ERROR_ROLLBACK_DISABLED 1653 | ||
| 653 | /// Could not perform a multiple-package transaction because rollback has been disabled. | ||
| 654 | /// Multiple-Package Installations cannot run if rollback is disabled. Available beginning with Windows Installer version 4.5. | ||
| 655 | /// </summary> | ||
| 656 | ERROR_ROLLBACK_DISABLED = 1653, | ||
| 657 | |||
| 658 | /// <summary> | ||
| 659 | /// ERROR_SUCCESS_REBOOT_REQUIRED 3010 | ||
| 660 | /// A restart is required to complete the install. This message is indicative of a success. | ||
| 661 | /// This does not include installs where the ForceReboot action is run. | ||
| 662 | /// </summary> | ||
| 663 | ERROR_SUCCESS_REBOOT_REQUIRED = 3010 | ||
| 664 | } | ||
| 665 | |||
| 666 | /// <summary> | ||
| 667 | /// Modes of operations for MSIExec; install, administrator install, uninstall .. etc | ||
| 668 | /// </summary> | ||
| 669 | public enum MSIExecMode | ||
| 670 | { | ||
| 671 | /// <summary> | ||
| 672 | /// Installs or configures a product | ||
| 673 | /// </summary> | ||
| 674 | Install = 0, | ||
| 675 | |||
| 676 | /// <summary> | ||
| 677 | /// Administrative install - Installs a product on the network | ||
| 678 | /// </summary> | ||
| 679 | AdministrativeInstall, | ||
| 680 | |||
| 681 | /// <summary> | ||
| 682 | /// Uninstalls the product | ||
| 683 | /// </summary> | ||
| 684 | Uninstall, | ||
| 685 | |||
| 686 | /// <summary> | ||
| 687 | /// Repairs a product | ||
| 688 | /// </summary> | ||
| 689 | Repair, | ||
| 690 | |||
| 691 | /// <summary> | ||
| 692 | /// Modifies a product | ||
| 693 | /// </summary> | ||
| 694 | Modify, | ||
| 695 | |||
| 696 | /// <summary> | ||
| 697 | /// Uninstalls the product as part of cleanup | ||
| 698 | /// </summary> | ||
| 699 | Cleanup, | ||
| 700 | } | ||
| 701 | |||
| 702 | /// <summary> | ||
| 703 | /// User interfave levels | ||
| 704 | /// </summary> | ||
| 705 | public enum MSIExecUserInterfaceLevel | ||
| 706 | { | ||
| 707 | /// <summary> | ||
| 708 | /// No UI | ||
| 709 | /// </summary> | ||
| 710 | None = 0, | ||
| 711 | |||
| 712 | /// <summary> | ||
| 713 | /// Basic UI | ||
| 714 | /// </summary> | ||
| 715 | Basic, | ||
| 716 | |||
| 717 | /// <summary> | ||
| 718 | /// Reduced UI | ||
| 719 | /// </summary> | ||
| 720 | Reduced, | ||
| 721 | |||
| 722 | /// <summary> | ||
| 723 | /// Full UI (default) | ||
| 724 | /// </summary> | ||
| 725 | Full | ||
| 726 | } | ||
| 727 | |||
| 728 | /// <summary> | ||
| 729 | /// Logging options | ||
| 730 | /// </summary> | ||
| 731 | [Flags] | ||
| 732 | public enum MSIExecLoggingOptions | ||
| 733 | { | ||
| 734 | Status_Messages = 0x0001, | ||
| 735 | Nonfatal_Warnings = 0x0002, | ||
| 736 | All_Error_Messages = 0x0004, | ||
| 737 | Start_Up_Of_Actions = 0x0008, | ||
| 738 | Action_Specific_Records = 0x0010, | ||
| 739 | User_Requests = 0x0020, | ||
| 740 | Initial_UI_Parameters = 0x0040, | ||
| 741 | OutOfMemory_Or_Fatal_Exit_Information = 0x0080, | ||
| 742 | OutOfDiskSpace_Messages = 0x0100, | ||
| 743 | Terminal_Properties = 0x0200, | ||
| 744 | Verbose_Output = 0x0400, | ||
| 745 | Append_To_Existing_Log_File = 0x0800, | ||
| 746 | |||
| 747 | Flush_Each_line = 0x1000, | ||
| 748 | Extra_Debugging_Information = 0x2000, | ||
| 749 | Log_All_Information = 0x4000, | ||
| 750 | VOICEWARMUP = 0x0FFF | ||
| 751 | } | ||
| 752 | } | ||
| 753 | } | ||
