// 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. namespace WixToolset.Dtf.WindowsInstaller { using System; using System.Diagnostics.CodeAnalysis; // Enumerations are in alphabetical order. /// /// Specifies a return status value for custom actions. /// public enum ActionResult : int { /// Action completed successfully. Success = 0, /// Skip remaining actions, not an error. SkipRemainingActions = 259, /// User terminated prematurely. UserExit = 1602, /// Unrecoverable error or unhandled exception occurred. Failure = 1603, /// Action not executed. NotExecuted = 1626, } /// /// Specifies the open mode for a . /// public enum DatabaseOpenMode : int { /// Open a database read-only, no persistent changes. ReadOnly = 0, /// Open a database read/write in transaction mode. Transact = 1, /// Open a database direct read/write without transaction. Direct = 2, /// Create a new database, transact mode read/write. Create = 3, /// Create a new database, direct mode read/write. CreateDirect = 4, } /// /// Log modes available for /// and . /// [Flags] public enum InstallLogModes : int { /// Disable logging. None = 0, /// Log out of memory or fatal exit information. FatalExit = (1 << ((int) InstallMessage.FatalExit >> 24)), /// Log error messages. Error = (1 << ((int) InstallMessage.Error >> 24)), /// Log warning messages. Warning = (1 << ((int) InstallMessage.Warning >> 24)), /// Log user requests. User = (1 << ((int) InstallMessage.User >> 24)), /// Log status messages that are not displayed. Info = (1 << ((int) InstallMessage.Info >> 24)), /// Log request to determine a valid source location. ResolveSource = (1 << ((int) InstallMessage.ResolveSource >> 24)), /// Log insufficient disk space error. OutOfDiskSpace = (1 << ((int) InstallMessage.OutOfDiskSpace >> 24)), /// Log the start of installation actions. ActionStart = (1 << ((int) InstallMessage.ActionStart >> 24)), /// Log the data record for installation actions. ActionData = (1 << ((int) InstallMessage.ActionData >> 24)), /// Log parameters for user-interface initialization. CommonData = (1 << ((int) InstallMessage.CommonData >> 24)), /// Log the property values at termination. PropertyDump = (1 << ((int) InstallMessage.Progress >> 24)), // log only /// /// Sends large amounts of information to log file not generally useful to users. /// May be used for support. /// Verbose = (1 << ((int) InstallMessage.Initialize >> 24)), // log only /// /// Log extra debugging information. /// ExtraDebug = (1 << ((int) InstallMessage.Terminate >> 24)), // log only /// /// Log only on error. /// LogOnlyOnError = (1 << ((int) InstallMessage.ShowDialog >> 24)), // log only /// /// Log progress bar information. This message includes information on units so far and total number /// of units. See for an explanation of the message format. This message /// is only sent to an external user interface and is not logged. /// Progress = (1 << ((int) InstallMessage.Progress >> 24)), // external handler only /// /// If this is not a quiet installation, then the basic UI has been initialized. If this is a full /// UI installation, the Full UI is not yet initialized. This message is only sent to an external /// user interface and is not logged. /// Initialize = (1 << ((int) InstallMessage.Initialize >> 24)), // external handler only /// /// If a full UI is being used, the full UI has ended. If this is not a quiet installation, the basic /// UI has not yet ended. This message is only sent to an external user interface and is not logged. /// Terminate = (1 << ((int) InstallMessage.Terminate >> 24)), // external handler only /// /// Sent prior to display of the Full UI dialog. This message is only sent to an external user /// interface and is not logged. /// ShowDialog = (1 << ((int) InstallMessage.ShowDialog >> 24)), // external handler only /// /// List of files in use that need to be replaced. /// FilesInUse = (1 << ((int) InstallMessage.FilesInUse >> 24)), // external handler only /// /// [MSI 4.0] List of apps that the user can request Restart Manager to shut down and restart. /// RMFilesInUse = (1 << ((int) InstallMessage.RMFilesInUse >> 24)), // external handler only } /// /// Type of message to be processed by , /// , or . /// [SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")] public enum InstallMessage : int { /// Premature termination, possibly fatal OOM. FatalExit = 0x00000000, /// Formatted error message. Error = 0x01000000, /// Formatted warning message. Warning = 0x02000000, /// User request message. User = 0x03000000, /// Informative message for log. Info = 0x04000000, /// List of files in use that need to be replaced. FilesInUse = 0x05000000, /// Request to determine a valid source location. ResolveSource = 0x06000000, /// Insufficient disk space message. OutOfDiskSpace = 0x07000000, /// Start of action: action name & description. ActionStart = 0x08000000, /// Formatted data associated with individual action item. ActionData = 0x09000000, /// Progress gauge info: units so far, total. Progress = 0x0A000000, /// Product info for dialog: language Id, dialog caption. CommonData = 0x0B000000, /// Sent prior to UI initialization, no string data. Initialize = 0x0C000000, /// Sent after UI termination, no string data. Terminate = 0x0D000000, /// Sent prior to display or authored dialog or wizard. ShowDialog = 0x0E000000, /// [MSI 4.0] List of apps that the user can request Restart Manager to shut down and restart. RMFilesInUse = 0x19000000, /// [MSI 4.5] Sent prior to install of a product. InstallStart = 0x1A000000, /// [MSI 4.5] Sent after install of a product. InstallEnd = 0x1B000000, } /// /// Specifies the install mode for or . /// public enum InstallMode : int { /// Provide the component only if the feature's installation state is . NoSourceResolution = -3, /// Only check that the component is registered, without verifying that the key file of the component exists. NoDetection = -2, /// Provide the component only if the feature exists. Existing = -1, /// Provide the component and perform any installation necessary to provide the component. Default = 0, } /// /// Specifies the run mode for . /// [SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")] public enum InstallRunMode : int { /// The administrative mode is installing, or the product is installing. Admin = 0, /// The advertisements are installing or the product is installing or updating. Advertise = 1, /// An existing installation is being modified or there is a new installation. Maintenance = 2, /// Rollback is enabled. RollbackEnabled = 3, /// The log file is active. It was enabled prior to the installation session. LogEnabled = 4, /// Execute operations are spooling or they are in the determination phase. Operations = 5, /// A reboot is necessary after a successful installation (settable). RebootAtEnd = 6, /// A reboot is necessary to continue the installation (settable). RebootNow = 7, /// Files from cabinets and Media table files are installing. Cabinet = 8, /// The source LongFileNames is suppressed through the PID_MSISOURCE summary property. SourceShortNames = 9, /// The target LongFileNames is suppressed through the SHORTFILENAMES property. TargetShortNames = 10, // Reserved for future use. //Reserved11 = 11, /// The operating system is Windows 95, Windows 98, or Windows ME. [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x")] Windows9x = 12, /// The operating system supports demand installation. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Zaw")] ZawEnabled = 13, // Reserved for future use. //Reserved14 = 14, // Reserved for future use. //Reserved15 = 15, /// A custom action called from install script execution. Scheduled = 16, /// A custom action called from rollback execution script. Rollback = 17, /// A custom action called from commit execution script. Commit = 18, } /// /// Installed state of a Component or Feature. /// public enum InstallState : int { /// The component is disabled. NotUsed = -7, /// The installation configuration data is corrupt. BadConfig = -6, /// The installation is suspended or in progress. Incomplete = -5, /// Component is set to run from source, but source is unavailable. SourceAbsent = -4, /// The buffer overflow is returned. MoreData = -3, /// An invalid parameter was passed to the function. InvalidArgument = -2, /// An unrecognized product or feature name was passed to the function. Unknown = -1, /// The component is broken. Broken = 0, /// The feature is advertised. Advertised = 1, /// The component is being removed. In action state and not settable. Removed = 1, /// The component is not installed, or action state is absent but clients remain. Absent = 2, /// The component is installed on the local drive. Local = 3, /// The component will run from the source, CD, or network. Source = 4, /// The component will be installed in the default location: local or source. Default = 5, } /// /// Specifies the type of installation for . /// public enum InstallType : int { /// Searches system for products to patch. Default = 0, /// Indicates a administrative installation. NetworkImage = 1, /// Indicates a particular instance. SingleInstance = 2, } /// /// Level of the installation user interface, specified with /// . /// [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")] [Flags] public enum InstallUIOptions : int { /// Does not change UI level. NoChange = 0, /// Uses Default UI level. Default = 1, /// Silent installation. Silent = 2, /// Simple progress and error handling. Basic = 3, /// Authored UI, wizard dialogs suppressed. Reduced = 4, /// Authored UI with wizards, progress, and errors. Full = 5, /// /// When combined with the value, the installer does not display /// the cancel button in the progress dialog. /// HideCancel = 0x20, /// /// When combined with the value, the installer displays progress /// dialog boxes but does not display any modal dialog boxes or error dialog boxes. /// ProgressOnly = 0x40, /// /// When combined with another value, the installer displays a modal dialog /// box at the end of a successful installation or if there has been an error. /// No dialog box is displayed if the user cancels. /// EndDialog = 0x80, /// /// Forces display of the source resolution dialog even if the UI is otherwise silent. /// SourceResolutionOnly = 0x100, /// /// [MSI 5.0] Forces display of the UAC dialog even if the UI is otherwise silent. /// UacOnly = 0x200, } /// /// Specifies a return status value for message handlers. These values are returned by /// , , and . /// public enum MessageResult : int { /// An error was found in the message handler. Error = -1, /// No action was taken. None = 0, /// IDOK [SuppressMessage("Microsoft.Naming", "CA1706:ShortAcronymsShouldBeUppercase")] OK = 1, /// IDCANCEL Cancel = 2, /// IDABORT Abort = 3, /// IDRETRY Retry = 4, /// IDIGNORE Ignore = 5, /// IDYES Yes = 6, /// IDNO No = 7, } /// /// Specifies constants defining which buttons to display for a message. This can be cast to /// the MessageBoxButtons enum in System.Windows.Forms and System.Windows. /// public enum MessageButtons { /// /// The message contains an OK button. /// OK = 0, /// /// The message contains OK and Cancel buttons. /// OKCancel = 1, /// /// The message contains Abort, Retry, and Ignore buttons. /// AbortRetryIgnore = 2, /// /// The message contains Yes, No, and Cancel buttons. /// YesNoCancel = 3, /// /// The message contains Yes and No buttons. /// YesNo = 4, /// /// The message contains Retry and Cancel buttons. /// RetryCancel = 5, } /// /// Specifies constants defining which information to display. This can be cast to /// the MessageBoxIcon enum in System.Windows.Forms and System.Windows. /// public enum MessageIcon { /// /// The message contain no symbols. /// None = 0, /// /// The message contains a symbol consisting of white X in a circle with a red background. /// Error = 16, /// /// The message contains a symbol consisting of a white X in a circle with a red background. /// Hand = 16, /// /// The message contains a symbol consisting of white X in a circle with a red background. /// Stop = 16, /// /// The message contains a symbol consisting of a question mark in a circle. /// Question = 32, /// /// The message contains a symbol consisting of an exclamation point in a triangle with a yellow background. /// Exclamation = 48, /// /// The message contains a symbol consisting of an exclamation point in a triangle with a yellow background. /// Warning = 48, /// /// The message contains a symbol consisting of a lowercase letter i in a circle. /// Information = 64, /// /// The message contains a symbol consisting of a lowercase letter i in a circle. /// Asterisk = 64, } /// /// Specifies constants defining the default button on a message. This can be cast to /// the MessageBoxDefaultButton enum in System.Windows.Forms and System.Windows. /// public enum MessageDefaultButton { /// /// The first button on the message is the default button. /// Button1 = 0, /// /// The second button on the message is the default button. /// Button2 = 256, /// /// The third button on the message is the default button. /// Button3 = 512, } /// /// Additional styles for use with message boxes. /// [Flags] internal enum MessageBoxStyles { /// /// The message box is created with the WS_EX_TOPMOST window style. /// TopMost = 0x00040000, /// /// The caller is a service notifying the user of an event. /// The function displays a message box on the current active desktop, even if there is no user logged on to the computer. /// ServiceNotification = 0x00200000, } /// /// Specifies the different patch states for . /// [Flags] public enum PatchStates : int { /// Invalid value. None = 0, /// Patches applied to a product. Applied = 1, /// Patches that are superseded by other patches. Superseded = 2, /// Patches that are obsolesced by other patches. [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Obsoleted")] Obsoleted = 4, /// Patches that are registered to a product but not applied. Registered = 8, /// All valid patch states. All = (Applied | Superseded | Obsoleted | Registered) } /// /// Specifies the reinstall mode for or . /// [Flags] public enum ReinstallModes : int { /// Reinstall only if file is missing. FileMissing = 0x00000002, /// Reinstall if file is missing, or older version. FileOlderVersion = 0x00000004, /// Reinstall if file is missing, or equal or older version. FileEqualVersion = 0x00000008, /// Reinstall if file is missing, or not exact version. FileExact = 0x00000010, /// Checksum executables, reinstall if missing or corrupt. FileVerify = 0x00000020, /// Reinstall all files, regardless of version. FileReplace = 0x00000040, /// Insure required machine reg entries. MachineData = 0x00000080, /// Insure required user reg entries. UserData = 0x00000100, /// Validate shortcuts items. Shortcut = 0x00000200, /// Use re-cache source install package. Package = 0x00000400, } /// /// Attributes for methods. /// [Flags] public enum TransactionAttributes : int { /// No attributes. None = 0x00000000, /// Request that the Windows Installer not shutdown the embedded UI until the transaction is complete. ChainEmbeddedUI = 0x00000001, /// Request that the Windows Installer transfer the embedded UI from the original installation. JoinExistingEmbeddedUI = 0x00000002, } /// /// Transform error conditions available for or /// . /// [Flags] public enum TransformErrors : int { /// No error conditions. None = 0x0000, /// Adding a row that already exists. AddExistingRow = 0x0001, /// Deleting a row that doesn't exist. DelMissingRow = 0x0002, /// Adding a table that already exists. AddExistingTable = 0x0004, /// Deleting a table that doesn't exist. DelMissingTable = 0x0008, /// Updating a row that doesn't exist. UpdateMissingRow = 0x0010, /// Transform and database code pages do not match and neither code page is neutral. ChangeCodePage = 0x0020, /// Create the temporary _TransformView table when applying the transform. ViewTransform = 0x0100, } /// /// Transform validation flags available for . /// [Flags] public enum TransformValidations : int { /// Validate no properties. None = 0x0000, /// Default language must match base database. Language = 0x0001, /// Product must match base database. Product = 0x0002, /// Check major version only. MajorVersion = 0x0008, /// Check major and minor versions only. MinorVersion = 0x0010, /// Check major, minor, and update versions. UpdateVersion = 0x0020, /// Installed version < base version. NewLessBaseVersion = 0x0040, /// Installed version <= base version. NewLessEqualBaseVersion = 0x0080, /// Installed version = base version. NewEqualBaseVersion = 0x0100, /// Installed version >= base version. NewGreaterEqualBaseVersion = 0x0200, /// Installed version > base version. NewGreaterBaseVersion = 0x0400, /// UpgradeCode must match base database. UpgradeCode = 0x0800, } /// /// Specifies the installation context for s, /// es, and /// /// [Flags] public enum UserContexts : int { /// Not installed. None = 0, /// User managed install context. UserManaged = 1, /// User non-managed context. UserUnmanaged = 2, /// Per-machine context. Machine = 4, /// All contexts, or all valid values. All = (UserManaged | UserUnmanaged | Machine), /// All user-managed contexts. AllUserManaged = 8, } /// /// Defines the type of error encountered by the , , /// or methods of the class. /// public enum ValidationError : int { /* InvalidArg = -3, MoreData = -2, FunctionError = -1, */ /// No error. None = 0, /// The new record duplicates primary keys of the existing record in a table. DuplicateKey = 1, /// There are no null values allowed, or the column is about to be deleted but is referenced by another row. Required = 2, /// The corresponding record in a foreign table was not found. BadLink = 3, /// The data is greater than the maximum value allowed. Overflow = 4, /// The data is less than the minimum value allowed. Underflow = 5, /// The data is not a member of the values permitted in the set. NotInSet = 6, /// An invalid version string was supplied. BadVersion = 7, /// The case was invalid. The case must be all uppercase or all lowercase. BadCase = 8, /// An invalid GUID was supplied. BadGuid = 9, /// An invalid wildcard file name was supplied, or the use of wildcards was invalid. BadWildcard = 10, /// An invalid identifier was supplied. BadIdentifier = 11, /// Invalid language IDs were supplied. BadLanguage = 12, /// An invalid file name was supplied. BadFileName = 13, /// An invalid path was supplied. BadPath = 14, /// An invalid conditional statement was supplied. BadCondition = 15, /// An invalid format string was supplied. BadFormatted = 16, /// An invalid template string was supplied. BadTemplate = 17, /// An invalid string was supplied in the DefaultDir column of the Directory table. BadDefaultDir = 18, /// An invalid registry path string was supplied. BadRegPath = 19, /// An invalid string was supplied in the CustomSource column of the CustomAction table. BadCustomSource = 20, /// An invalid property string was supplied. BadProperty = 21, /// The _Validation table is missing a reference to a column. MissingData = 22, /// The category column of the _Validation table for the column is invalid. BadCategory = 23, /// The table in the Keytable column of the _Validation table was not found or loaded. BadKeyTable = 24, /// The value in the MaxValue column of the _Validation table is less than the value in the MinValue column. BadMaxMinValues = 25, /// An invalid cabinet name was supplied. BadCabinet = 26, /// An invalid shortcut target name was supplied. BadShortcut = 27, /// The string is too long for the length specified by the column definition. StringOverflow = 28, /// An invalid localization attribute was supplied. (Primary keys cannot be localized.) BadLocalizeAttrib = 29 } /// /// Specifies the modify mode for . /// public enum ViewModifyMode : int { /// /// Refreshes the information in the supplied record without changing the position /// in the result set and without affecting subsequent fetch operations. /// Seek = -1, /// Refreshes the data in a Record. Refresh = 0, /// Inserts a Record into the view. Insert = 1, /// Updates the View with new data from the Record. Update = 2, /// Updates or inserts a Record into the View. Assign = 3, /// Updates or deletes and inserts a Record into the View. Replace = 4, /// Inserts or validates a record. Merge = 5, /// Deletes a Record from the View. Delete = 6, /// Inserts a Record into the View. The inserted data is not persistent. InsertTemporary = 7, /// Validates a record. Validate = 8, /// Validates a new record. [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] ValidateNew = 9, /// Validates fields of a fetched or new record. Can validate one or more fields of an incomplete record. ValidateField = 10, /// Validates a record that will be deleted later. ValidateDelete = 11, } }