text:
#pragma warning disable 1591

namespace WindowsInstaller
{
    using System;
    using System.Runtime.InteropServices;
    using System.Security;
    using System.Security.Permissions;
    using System.Text;
    using System.Windows.Forms;

    #region	Constants
    ///
    /// Internal class containing constants for the <c>script</c> parameter of <see cref="MsiInterop.MsiAdvertiseProduct"/> or <see cref="MsiInterop.MsiAdvertiseProductEx"/>.
    /// This class cannot be inherited.
    /// This class cannot be instantiated directly.
    ///
    sealed public class MsiAdvertiseProductFlag
    {
        #region	Constants (Static Fields)
        /// Set to advertise a per-machine installation of the product available to all users.
        static public readonly string MachineAssign = ((char)0).ToString();
        /// Set to advertise a per-user installation of the product available to a particular user.
        static public readonly string UserAssign = ((char)1).ToString();
        #endregion	Constants (Static Fields)

        #region	Construction / Destruction
        private MsiAdvertiseProductFlag() { }
        #endregion	Construction / Destruction
    }

    ///
    /// Internal class containing constants for an MSI database.
    /// This class cannot be inherited.
    /// This class cannot be instantiated directly.
    ///
    sealed public class MsiDatabaseTable
    {
        #region	Constants
        /// The _Columns table is a read-only system table that contains the column catalog. It lists the columns for all the tables. You can query this table to find out if a given column exists.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string _Columns = "_Columns";

        /// The _Storages table lists embedded OLE data storages. This is a temporary table, created only when referenced by a SQL statement.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string _Storages = "_Storages";

        /// The _Streams table lists embedded OLE data streams. This is a temporary table, created only when referenced by a SQL statement.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string _Streams = "_Streams";

        /// The _Tables table is a read-only system table that lists all the tables in the database. Query this table to find out if a table exists.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string _Tables = "_Tables";

        /// This is a read-only temporary table used to view transforms with the transform view mode. This table is never persisted by the installer.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string _TransformView = "_TransformView";

        /// The _Validation table is a system table that contains the column names and the column values for all of the tables in the database. It is used during the database validation process to ensure that all columns are accounted for and have the correct values. This table is not shipped with the installer database.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string _Validation = "_Validation";

        /// The ActionText table contains text to be displayed in a progress dialog box and written to the log for actions that take a long time to execute. The text displayed consists of the action description and optionally formatted data from the action.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ActionText = "ActionText";

        /// The AdminExecuteSequence table lists actions that the installer calls in sequence when the top-level ADMIN action is executed.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string AdminExecuteSequence = "AdminExecuteSequence";

        /// The AdminUISequence table lists actions that the installer calls in sequence when the top-level ADMIN action is executed and the internal user interface level is set to full UI or reduced UI. The installer skips the actions in this table if the user interface level is set to basic UI or no UI.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string AdminUISequence = "AdminUISequence";

        /// The AdvtExecuteSequence table lists actions the installer calls when the top-level ADVERTISE action is executed.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string AdvtExecuteSequence = "AdvtExecuteSequence";

        /// The installer does not use this table. The AdvtUISequence table should not exist in the installation database or it should be left empty.
        public const string AdvtUISequence = "AdvtUISequence";

        /// The AppId table or the <see cref="Registry"/> table specifies that the installer configure and register DCOM servers to do one of the following during an installation.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string AppId = "AppId";

        /// The AppSearch table contains properties needed to search for a file having a particular file signature. The AppSearch table can also be used to set a property to the existing value of a registry or .ini file entry.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string AppSearch = "AppSearch";

        /// The BBControl table lists the controls to be displayed on each billboard.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string BBControl = "BBControl";

        /// The Billboard table lists the Billboard controls displayed in the full user interface.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Billboard = "Billboard";

        /// The Binary table holds the binary data for items such as bitmaps, animations, and icons. The binary table is also used to store data for custom actions.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Binary = "Binary";

        /// The BindImage table contains information about each executable or DLL that needs to be bound to the DLLs imported by it.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string BindImage = "BindImage";

        /// The CCPSearch table contains the list of file signatures used for the Compliance Checking Program (CCP). At least one of these files needs to be present on a user's computer for the user to be in compliance with the program.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string CCPSearch = "CCPSearch";

        /// The CheckBox table lists the values for the check boxes.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string CheckBox = "CheckBox";

        /// The Class table contains COM server-related information that must be generated as a part of the product advertisement. Each row may generate a set of registry keys and values. The associated ProgId information is included in this table.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Class = "Class";

        /// The lines of a combo box are not treated as individual controls; they are part of a single combo box that functions as a control. This table lists the values for each combo box.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ComboBox = "ComboBox";

        /// The CompLocator table holds the information needed to find a file or a directory using the installer configuration data.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string CompLocator = "CompLocator";

        /// The Complus table contains information needed to install COM+ applications.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Complus = "Complus";

        /// The Component table lists components.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Component = "Component";

        /// The Condition table can be used to modify the selection state of any entry in the <see cref="Feature"/> table based on a conditional expression.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Condition = "Condition";

        /// The Control table defines the controls that appear on each dialog box.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Control = "Control";

        /// The ControlCondition table enables an author to specify special actions to be applied to controls based on the result of a conditional statement. For example, using this table the author could choose to hide a control based on the VersionNT property.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ControlCondition = "ControlCondition";

        /// The ControlEvent table allows the author to specify the Control Events started when a user interacts with a PushButton Control, CheckBox Control, or SelectionTree Control. These are the only controls users can use to initiate control events. Each control can publish multiple control events.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ControlEvent = "ControlEvent";

        /// The CreateFolder table contains references to folders that need to be created explicitly for a particular component.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string CreateFolder = "CreateFolder";

        /// The CustomAction table provides the means of integrating custom code and data into the installation. The source of the code that is executed can be a stream contained within the database, a recently installed file, or an existing executable file.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string CustomAction = "CustomAction";

        /// The Dialog table contains all the dialogs that appear in the user interface in both the full and reduced modes.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Dialog = "Dialog";

        /// The Directory table specifies the directory layout for the product. Each row of the table indicates a directory both at the source and the target.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Directory = "Directory";

        /// The DrLocator table holds the information needed to find a file or directory by searching the directory tree.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string DrLocator = "DrLocator";

        /// The DuplicateFile table contains a list of files that are to be duplicated, either to a different directory than the original file or to the same directory but with a different name. The original file must be a file installed by the InstallFiles action.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string DuplicateFile = "DuplicateFile";

        /// The Environment table is used to set the values of environment variables.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Environment = "Environment";

        /// The Error table is used to look up error message formatting templates when processing errors with an error code set but without a formatting template set (this is the normal situation).
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Error = "Error";

        /// The EventMapping table lists the controls that subscribe to some control event and lists the attribute to be changed when the event is published by another control or the installer.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string EventMapping = "EventMapping";

        /// The Extension table contains information about file name extension servers that must be generated as a part of product advertisement. Each row generates a set of registry keys and values.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Extension = "Extension";

        /// The Feature table defines the logical tree structure of features.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Feature = "Feature";

        /// The FeatureComponents table defines the relationship between features and components. For each feature, this table lists all the components that make up that feature.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string FeatureComponents = "FeatureComponents";

        /// The File table contains a complete list of source files with their various attributes, ordered by a unique, non-localized, identifier. Files can be stored on the source media as individual files or compressed within a cabinet file.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string File = "File";

        /// The FileSFPCatalog table associates specified files with the catalog files used by Windows Millennium Edition for Windows File Protection.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string FileSFPCatalog = "FileSFPCatalog";

        /// The Font table contains the information for registering font files with the system.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Font = "Font";

        /// This table contains the icon files. Each icon from the table is copied to a file as a part of product advertisement to be used for advertised shortcuts and OLE servers.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Icon = "Icon";

        /// The IniFile table contains the .ini information that the application needs to set in an .ini file.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string IniFile = "IniFile";

        /// The IniLocator table holds the information needed to search for a file or directory using an .ini file or to search for a particular .ini entry itself. The .ini file must be present in the default Microsoft Windows directory.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string IniLocator = "IniLocator";

        /// The InstallExecuteSequence table lists actions that are executed when the top-level INSTALL action is executed.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string InstallExecuteSequence = "InstallExecuteSequence";

        /// The InstallUISequence table lists actions that are executed when the top-level INSTALL action is executed and the internal user interface level is set to full UI or reduced UI. The installer skips the actions in this table if the user interface level is set to basic UI or no UI.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string InstallUISequence = "InstallUISequence";

        /// Each record of the IsolatedComponent table associates the component specified in the Component_Application column (commonly an .exe) with the component specified in the Component_Shared column (commonly a shared DLL). The IsolateComponents action installs a copy of Component_Shared into a private location for use by Component_Application. This isolates the Component_Application from other copies of Component_Shared that may be installed to a shared location on the computer.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string IsolatedComponent = "IsolatedComponent";

        /// The LaunchCondition table is used by the LaunchConditions action. It contains a list of conditions that all must be satisfied for the installation to begin.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string LaunchCondition = "LaunchCondition";

        /// The lines of a list box are not treated as individual controls, but they are part of a list box that functions as a control. The ListBox table defines the values for all list boxes.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ListBox = "ListBox";

        /// The lines of a listview are not treated as individual controls, but they are part of a listview that functions as a control. The ListView table defines the values for all listviews.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ListView = "ListView";

        /// The LockPermissions table is used to secure individual portions of your application in a locked-down environment. It can be used with the installation of files, registry keys, and created folders.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string LockPermissions = "LockPermissions";

        /// The Media table describes the set of disks that make up the source media for the installation.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Media = "Media";

        /// The MIME table associates a MIME content type with a file extension or a CLSID to generate the extension or COM server information required for advertisement of the MIME (Multipurpose Internet Mail Extensions) content.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MIME = "MIME";

        /// For merge modules, a merge tool evaluates the ModuleAdminUISequence table and then inserts the calculated actions into the <see cref="AdminUISequence"/> table with a correct sequence number.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleAdminUISequence = "ModuleAdminUISequence";

        /// For merge modules, a merge tool evaluates the ModuleAdminExecuteSequence table and then inserts the calculated actions into the <see cref="AdminExecuteSequence"/> table with a correct sequence number.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleAdminExecuteSequence = "ModuleAdminExecuteSequence";

        /// For merge modules, a merge tool evaluates the ModuleAdvtExecuteSequence table and then inserts the calculated actions into the <see cref="AdvtExecuteSequence"/> table with a correct sequence number.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleAdvtExecuteSequence = "ModuleAdvtExecuteSequence";

        /// For merge modules, the ModuleComponents table contains a list of the components found in the merge module.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleComponents = "ModuleComponents";

        /// For merge modules, the ModuleConfiguration table identifies the configurable attributes of the module. This table is not merged into the database.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleConfiguration = "ModuleConfiguration";

        /// For merge modules, the ModuleDependency table keeps a list of other merge modules that are required for this merge module to operate properly. This table enables a merge or verification tool to ensure that the necessary merge modules are in fact included in the user's installer database. The tool checks by cross referencing this table with the <see cref="ModuleSignature"/> table in the installer database.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleDependency = "ModuleDependency";

        /// For merge modules, the ModuleExclusion table keeps a list of other merge modules that are incompatible in the same installer database. This table enables a merge or verification tool to check that conflicting merge modules are not merged in the user's installer database. The tool checks by cross-referencing this table with the <see cref="ModuleSignature"/> table in the installer database.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleExclusion = "ModuleExclusion";

        /// For merge modules, if a table in the merge module is listed in the ModuleIgnoreTable table, it is not merged into the .msi file. If the table already exists in the .msi file, it is not modified by the merge. The tables in the ModuleIgnoreTable can therefore contain data that is unneeded after the merge.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModeleIgnore = "ModeleIgnore";

        /// For merge modules, a merge tool evaluates the ModuleInstallExecuteSequence table and then inserts the calculated actions into the <see cref="InstallExecuteSequence"/> table with a correct sequence number.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleInstallExecuteSequence = "ModuleInstallExecuteSequence";

        /// For merge modules, a merge tool evaluates the ModuleInstallUISequence table and then inserts the calculated actions into the <see cref="InstallUISequence"/> table with a correct sequence number.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleInstallUISequence = "ModuleInstallUISequence";

        /// For merge modules, the ModuleSignature Table is a required table. It contains all the information necessary to identify a merge module. The merge tool adds this table to the .msi file if one does not already exist. The ModuleSignature table in a merge module has only one row containing the ModuleID, Language, and Version. However, the ModuleSignature table in an .msi file has a row containing this information for each .msm file that has been merged into it.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleSignature = "ModuleSignature";

        /// For merge modules, the ModuleSubstitution table specifies the configurable fields of a module database and provides a template for the configuration of each field. The user or merge tool may query this table to determine what configuration operations are to take place. This table is not merged into the target database.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ModuleSubstitution = "ModuleSubstitution";

        /// This table contains a list of files to be moved or copied from a specified source directory to a specified destination directory.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MoveFile = "MoveFile";

        /// The MsiAssembly table specifies Windows Installer settings for Microsoft .NET Framework assemblies and Win32 assemblies.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MsiAssembly = "MsiAssembly";

        /// The MsiAssembly table and MsiAssemblyName table specify Windows Installer settings for common language runtime assemblies and Win32 assemblies.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MsiAssemblyName = "MsiAssemblyName";

        /// The MsiDigitalCertificate table stores certificates in binary stream format and associates each certificate with a primary key. The primary key is used to share certificates among multiple digitally signed objects. A digital certificate is a credential that provides a means to verify identity.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MsiDigitalCertificate = "MsiDigitalCertificate";

        /// The MsiDigitalSignature table contains the signature information for every digitally signed object in the installation database.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MsiDigitalSignature = "MsiDigitalSignature";

        /// The MsiFileHash table is used to store a 128-bit hash of a source file provided by the Windows Installer package. The hash is split into four 32-bit values and stored in separate columns of the table.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MsiFileHash = "MsiFileHash";

        /// The MsiPatchHeaders table holds the binary patch header streams used for patch validation. A patch containing a populated MsiPatchHeaders table can only be applied using Windows Installer version 2.0 or later.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string MsiPatchHeaders = "MsiPatchHeaders";

        /// The ODBCAttribute table contains information about the attributes of ODBC drivers and translators.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ODBCAttribute = "ODBCAttribute";

        /// The ODBCDataSource table lists the data sources belonging to the installation.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ODBCDataSource = "ODBCDataSource";

        /// The ODBCDriver table lists the ODBC drivers belonging to the installation.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ODBCDriver = "ODBCDriver";

        /// The ODBCSourceAttribute table contains information about the attributes of data sources.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ODBCSourceAttribute = "ODBCSourceAttribute";

        /// The ODBCTranslator table lists the ODBC translators belonging to the installation.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ODBCTranslator = "ODBCTranslator";

        /// The Patch table specifies the file that is to receive a particular patch and the physical location of the patch files on the media images.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Patch = "Patch";

        /// The PatchPackage table describes all patch packages that have been applied to this product. For each patch package, the unique identifier for the patch is provided along with information about the media image the on which the patch is located.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string PatchPackage = "PatchPackage";

        /// The ProgId table contains information for program IDs and version independent program IDs that must be generated as a part of the product advertisement.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ProgId = "ProgId";

        /// The Property table contains the property names and values for all defined properties in the installation. Properties with Null values are not present in the table.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Property = "Property";

        /// The PublishComponent table associates components listed in the <see cref="Component"/> table with a qualifier text-string and a category ID GUID. Components with parallel functionality that have been grouped together in this way are referred to as qualified components.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string PublishComponent = "PublishComponent";

        /// Radio buttons are not treated as individual controls, but they are part of a radio button group that functions as a RadioButtonGroup control. The RadioButton table lists the buttons for all the groups.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string RadioButton = "RadioButton";

        /// The Registry table holds the registry information that the application needs to set in the system registry.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Registry = "Registry";

        /// The RegLocator table holds the information needed to search for a file or directory using the registry, or to search for a particular registry entry itself.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string RegLocator = "RegLocator";

        /// The RemoveFile table contains a list of files to be removed by the RemoveFiles action. Setting the FileName column of this table to Null supports the removal of empty folders.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string RemoveFile = "RemoveFile";

        /// The RemoveIniFile table contains the information an application needs to delete from a .ini file.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string RemoveIniFile = "RemoveIniFile";

        /// The RemoveRegistry table contains the registry information the application needs to delete from the system registry.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string RemoveRegistry = "RemoveRegistry";

        /// The ReserveCost table is an optional table that allows the author to reserve an amount of disk space in any directory that depends on the installation state of a component.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ReserveCost = "ReserveCost";

        /// The SelfReg table contains information about modules that need to be self registered. The installer calls the DllRegisterServer function during installation of the module; it calls DllUnregisterServer during uninstallation of the module. The installer does not self register EXE files.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string SelfReg = "SelfReg";

        /// The ServiceControl table is used to control installed or uninstalled services.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ServiceControl = "ServiceControl";

        /// The ServiceInstall table is used to install a service.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string ServiceInstall = "ServiceInstall";

        /// The SFPCatalog table contains the catalogs used by Windows Millennium Edition for Windows File Protection on Windows Millennium Edition.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string SFPCatalog = "SFPCatalog";

        /// The Shortcut table holds the information the application needs to create shortcuts on the user's computer.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Shortcut = "Shortcut";

        /// The Signature table holds the information that uniquely identifies a file signature.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Signature = "Signature";

        /// The TextStyle table lists different font styles used in controls having text.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string TextStyle = "TextStyle";

        /// The TypeLib table contains the information that needs to be placed in the registry registration of type libraries.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string TypeLib = "TypeLib";

        /// The UIText table contains the localized versions of some of the strings used in the user interface. These strings are not part of any other table. The UIText table is for strings that have no logical place in any other table.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string UIText = "UIText";

        /// The Upgrade table contains information required during major upgrades. To fully enable the installer's upgrade capabilities, every package should have an UpgradeCode property and an Upgrade table. Each record in the Upgrade table gives a characteristic combination of upgrade code, product version, and language information used to identify a set of products affected by the upgrade.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Upgrade = "Upgrade";

        /// The Verb table contains command-verb information associated with file extensions that must be generated as a part of product advertisement. Each row generates a set of registry keys and values.
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        public const string Verb = "Verb";
        #endregion	Constants

        #region	Construction / Destruction
        private MsiDatabaseTable() { }
        #endregion	Construction / Destruction
    }

    ///
    /// Internal class containing constants for MSI installer properties.
    /// This class cannot be inherited.
    /// This class cannot be instantiated directly.
    ///
    sealed public class MsiInstallerProperty
    {
        #region	Constants (Static Fields)
        #region	Component Location
        /// The installer sets the OriginalDatabase property to the launched-from database, the database on the source, or the cached database.
        public const string OriginalDatabase = "OriginalDatabase";

        /// Root directory containing the source files.
        public const string SourceDir = "SourceDir";

        /// Specifies the root destination directory for the installation. During an administrative installation this property is the location to copy the installation package.
        public const string TARGETDIR = "TARGETDIR";
        #endregion	Component Location

        #region	Configuration Properties
        /// Initial action called after the installer is initialized.
        public const string ACTION = "ACTION";

        /// Determines where configuration information will be stored.
        public const string ALLUSERS = "ALLUSERS";

        /// URL of the update channel for the application.
        public const string ARPAUTHORIZEDCDFPREFIX = "ARPAUTHORIZEDCDFPREFIX";

        /// Provides Comments for the Add or Remove Programs on Control Panel.
        public const string ARPCOMMENTS = "ARPCOMMENTS";

        /// Provides Contact for the Add or Remove Programs on Control Panel.
        public const string ARPCONTACT = "ARPCONTACT";

        /// Fully qualified path to the application's primary folder.
        public const string ARPINSTALLLOCATION = "ARPINSTALLLOCATION";

        /// Disables functionality that would modify the product.
        public const string ARPNOMODIFY = "ARPNOMODIFY";

        /// Disables functionality that would remove the product.
        public const string ARPNOREMOVE = "ARPNOREMOVE";

        /// Disables the Repair button in the Programs wizard.
        public const string ARPNOREPAIR = "ARPNOREPAIR";

        /// Specifies the primary icon for the installation package.
        public const string ARPPRODUCTICON = "ARPPRODUCTICON";

        /// Provides a ReadMe for the Add or Remove Programs on Control Panel.
        public const string ARPREADME = "ARPREADME";

        /// Estimated size of the application in kilobytes.
        public const string ARPSIZE = "ARPSIZE";

        /// Prevents display of application in the Add or Remove Programs list.
        public const string ARPSYSTEMCOMPONENT = "ARPSYSTEMCOMPONENT";

        /// URL for an application's home page.
        public const string ARPURLINFOABOUT = "ARPURLINFOABOUT";

        /// URL for application-update information.
        public const string ARPURLUPDATEINFO = "ARPURLUPDATEINFO";

        /// Registry space in xilobytes required by the application. Used by AllocateRegistrySpace action.
        public const string AVAILABLEFREEREG = "AVAILABLEFREEREG";

        /// The root path for any of the qualifying products for CCP.
        public const string CCP_DRIVE = "CCP_DRIVE";

        /// Default font style used for controls.
        public const string DefaultUIFont = "DefaultUIFont";

        /// Set to disable the generation certain shortcuts supporting installation-on-demand.
        public const string DISABLEADVTSHORTCUTS = "DISABLEADVTSHORTCUTS";

        /// Prevents the installer from registering media sources, such as a CD-ROMs, as valid sources for the product.
        public const string DISABLEMEDIA = "DISABLEMEDIA";

        /// Disables rollback for the current configuration.
        public const string DISABLEROLLBACK = "DISABLEROLLBACK";

        /// Top-level action initiated by the ExecuteAction action.
        public const string EXECUTEACTION = "EXECUTEACTION";

        /// Mode of execution performed by the installer.  (None, Script [default])
        public const string EXECUTEMODE = "EXECUTEMODE";

        /// Improves installation performance under specific OEM scenarios.
        public const string FASTOEM = "FASTOEM";

        /// Initial "level" at which features will be installed.  (1 - 32767)
        public const string INSTALLLEVEL = "INSTALLLEVEL";

        /// UI level capped as Basic.
        public const string LIMITUI = "LIMITUI";

        /// List of action names that will be logged (separated only by semicolons and with no spaces.)
        public const string LOGACTION = "LOGACTION";

        /// This property must be set to the relative path if the installation package is not located at the root of the CD-ROM.
        public const string MEDIAPACKAGEPATH = "MEDIAPACKAGEPATH";

        /// Set to prevent the installer from setting the DISABLEMEDIA property. Available with Windows Installer version 1.0.
        public const string MSINODISABLEMEDIA = "MSINODISABLEMEDIA";

        /// Allows the author to designate a "primary" folder for the installation. Used to determine the values for the PrimaryVolumePath, PrimaryVolumeSpaceAvailable, PrimaryVolumeSpaceRequired, and PrimaryVolumeSpaceRemaining properties.
        public const string PRIMARYFOLDER = "PRIMARYFOLDER";

        /// Runs an installation with elevated privileges.
        public const string Privileged = "Privileged";

        /// Action if there is insufficient disk space for the installation.  (P - prompt, D - disable, F - fail)
        public const string PROMPTROLLBACKCOST = "PROMPTROLLBACKCOST";

        /// Forces or suppresses restarting.  (Force, Suppress, ReallySuppress)
        public const string REBOOT = "REBOOT";

        /// Suppresses the display of prompts for restarts to the user. Any restarts that are needed happen automatically.  (S or Suppress)
        public const string REBOOTPROMPT = "REBOOTPROMPT";

        /// Default drive for the installation.  (Must end in '\')
        public const string ROOTDRIVE = "ROOTDRIVE";

        /// A table having the sequence table schema.
        public const string SEQUENCE = "SEQUENCE";

        /// Causes short file names to be used.
        public const string SHORTFILENAMES = "SHORTFILENAMES";

        /// List of transforms to be applied to the database.
        public const string Transforms = "Transforms";

        /// Informs the installer that the transforms for the product reside at the source.
        public const string TRANSFORMSATSOURCE = "TRANSFORMSATSOURCE";

        /// Setting the TRANSFORMSECURE property to 1 informs the installer that transforms are to be cached locally on the user's computer in a location where the user does not have write access.
        public const string TRANSFORMSSECURE = "TRANSFORMSSECURE";
        #endregion	Configuration Properties

        #region	Date / Time
        /// The current date.
        public const string Date = "Date";

        /// The current time.
        public const string Time = "Time";
        #endregion	Date / Time

        #region	Feature Installation Options
        /// List of features (delimited by commas) to be installed in their default configuration.
        public const string ADDDEFAULT = "ADDDEFAULT";

        /// List of features (delimited by commas) to be installed locally.
        public const string ADDLOCAL = "ADDLOCAL";

        /// List of features (delimited by commas) to be run from source.
        public const string ADDSOURCE = "ADDSOURCE";

        /// List of features (delimited by commas) to be advertised.
        public const string ADVERTISE = "ADVERTISE ";

        /// List of component IDs (delimited by commas) to be installed locally.
        public const string COMPADDLOCAL = "COMPADDLOCAL ";

        /// List of component IDs (delimited by commas) to run from source media.
        public const string COMPADDSOURCE = "COMPADDSOURCE ";

        /// List of file keys of files (delimited by commas) that are to be installed in their default configuration.
        public const string FILEADDDEFAULT = "FILEADDDEFAULT ";

        /// List of file keys of the files (delimited by commas) to be run locally.
        public const string FILEADDLOCAL = "FILEADDLOCAL ";

        /// List of file keys (delimited by commas)to be run from the source media.
        public const string FILEADDSOURCE = "FILEADDSOURCE ";

        /// Setting this property applies a patch.
        public const string PATCH = "PATCH";

        /// List of features (delimited by commas) to be reinstalled.
        public const string REINSTALL = "REINSTALL";

        /// A string containing letters that specify the type of reinstall to perform.
        public const string REINSTALLMODE = "REINSTALLMODE";

        /// List of features (delimited by commas) to be removed.
        public const string REMOVE = "REMOVE";
        #endregion	Feature Installation Options

        #region	Hardware
        /// Numeric processor level if running on an Alpha processor.
        public const string Alpha = "Alpha";

        /// The width, in pixels, of the window borders.
        public const string BorderSide = "BorderSide";

        /// The height, in pixels, of the window borders.
        public const string BorderTop = "BorderTop";

        /// Height, in pixels, of normal caption area.
        public const string CaptionHeight = "CaptionHeight";

        /// Number of adjacent color bits for each pixel.
        public const string ColorBits = "ColorBits";

        /// Numeric processor level if running on an Intel processor.
        public const string Intel = "Intel";

        /// Numeric processor level if running on an Itanium processor.
        public const string Intel64 = "Intel64";

        /// Size of the installed RAM in megabytes.
        public const string PhysicalMemory = "PhysicalMemory";

        /// Width, in pixels, of the screen.
        public const string ScreenX = "ScreenX";

        /// Height, in pixels, of the screen.
        public const string ScreenY = "ScreenY";

        /// The height of characters in logical units.
        public const string TextHeight = "TextHeight";

        /// Amount of available page file space in megabytes.
        public const string VirtualMemory = "VirtualMemory";
        #endregion	Hardware

        #region	Installation Status
        /// Indicates current installation follows a reboot invoked by the ForceReboot action.
        public const string AFTERREBOOT = "AFTERREBOOT";

        /// Indicates whether disk space costing has completed.
        public const string CostingComplete = "CostingComplete";

        /// Indicates that a product is already installed.
        public const string Installed = "Installed";

        /// The installer does a CRC on files only if the MSICHECKCRCS property is set.
        public const string MSICHECKCRCS = "MSICHECKCRCS";

        /// Suppresses the automatic setting of the COMPANYNAME property.
        public const string NOCOMPANYNAME = "NOCOMPANYNAME";

        /// Suppresses the automatic setting of the USERNAME property.
        public const string NOUSERNAME = "NOUSERNAME";

        /// Insufficient disk space to accommodate the installation.
        public const string OutOfDiskSpace = "OutOfDiskSpace";

        /// Insufficient disk space with rollback turned off.
        public const string OutOfNoRbDiskSpace = "OutOfNoRbDiskSpace";

        /// Features are already selected.
        public const string Preselected = "Preselected";

        /// The Installer sets the value of this property to the path of the volume designated by the PRIMARYFOLDER property.
        public const string PrimaryVolumePath = "PrimaryVolumePath";

        /// The Installer sets the value of this property to a string representing the total number of bytes available on the volume referenced by the PrimaryVolumePath property.
        public const string PrimaryVolumeSpaceAvailable = "PrimaryVolumeSpaceAvailable";

        /// The Installer sets the value of this property to a string representing the total number of bytes remaining on the volume referenced by the PrimaryVolumePath property if all the currently selected features were installed.
        public const string PrimaryVolumeSpaceRemaining = "PrimaryVolumeSpaceRemaining";

        /// The Installer sets the value of this property to a string representing the total number of bytes required by all currently selected features on the volume referenced by the PrimaryVolumePath property.
        public const string PrimaryVolumeSpaceRequired = "PrimaryVolumeSpaceRequired";

        /// Numeric language identifier (LANGID) for the database. (REQUIRED)
        public const string ProductLanguage = "ProductLanguage";

        /// Set if the installer installs over a file that is being held in use.
        public const string ReplacedInUseFiles = "ReplacedInUseFiles";

        /// Resumed installation.
        public const string RESUME = "RESUME";

        /// The installer sets this property whenever rollback is disabled.
        public const string RollbackDisabled = "RollbackDisabled";

        /// Indicates the user interface level.
        public const string UILevel = "UILevel";

        /// Set when changes to the system have begun for this installation.
        public const string UpdateStarted = "UpdateStarted";

        /// Set by the installer when an upgrade removes an application. Available with Windows Installer version 1.1 or later.
        public const string UPGRADINGPRODUCTCODE = "UPGRADINGPRODUCTCODE";

        /// The installer sets this property to the version of Windows Installer run during the installation.
        public const string VersionMsi = "VersionMsi";
        #endregion	Installation Status

        #region	Operating System
        /// Set on Microsoft Windows NT/Windows 2000 if the user has administrator privileges.
        public const string AdminUser = "AdminUser";

        /// Computer name of the current system.
        public const string ComputerName = "ComputerName";

        /// Indicates the Windows product type. Only available with Windows Installer version 2.0 and later versions.
        public const string MsiNTProductType = "MsiNTProductType";

        /// On Windows 2000 and later operating systems, the installer sets this property to 1 only if Microsoft BackOffice components are installed. Only available with Windows Installer version 2.0 and later versions.
        public const string MsiNTSuiteBackOffice = "MsiNTSuiteBackOffice";

        /// On Windows 2000 and later operating systems, the installer sets this property to 1 only if Windows 2000 DataCenter Server is installed. Only available with Windows Installer version 2.0 and later versions.
        public const string MsiNTSuiteDataCenter = "MsiNTSuiteDataCenter";

        /// On Windows 2000 and later operating systems, the installer sets this property to 1 only if Windows 2000 Advanced Server is installed. Only available with Windows Installer version 2.0 and later versions.
        public const string MsiNTSuiteEnterprise = "MsiNTSuiteEnterprise";

        /// On Windows 2000 and later operating systems, the installer sets this property to 1 only if Microsoft Small Business Server is installed. Only available with Windows Installer version 2.0 and later versions.
        public const string MsiNTSuiteSmallBusiness = "MsiNTSuiteSmallBusiness";

        /// On Windows 2000 and later operating systems, the installer sets this property to 1 only if Microsoft Small Business Server is installed with the restrictive client license. Only available with Windows Installer version 2.0 and later.
        public const string MsiNTSuiteSmallBusinessRestricted = "MsiNTSuiteSmallBusinessRestricted";

        /// On Windows 2000 and later operating systems, the installer sets the MsiNTSuiteWebServer property to 1 if the web edition of the Windows  2003 Server family is installed. Only available with the Windows Server 2003 family release of the Windows Installer.
        public const string MsiNTSuiteWebServer = "MsiNTSuiteWebServer";

        /// On Windows 2000 and later operating systems, the installer sets this property to 1 only if the operating system is Workstation Personal (not Professional). Only available with Windows Installer version 2.0 and later versions.
        public const string MsiNTSuitePersonal = "MsiNTSuitePersonal";

        /// On systems that support common language runtime assemblies, the installer sets the value of this property to the file version of fusion.dll. The installer does not set this property if the operating system does not support common language runtime assemblies. Only available with Windows Installer version 2.0 and later.
        public const string MsiNetAssemblySupport = "MsiNetAssemblySupport";

        /// On systems that support Win32 assemblies, the installer sets the value of this property to the file version of sxs.dll. The installer does not set this property if the operating system does not support Win32 assemblies. Only available with Windows Installer version 2.0 and later.
        public const string MsiWin32AssemblySupport = "MsiWin32AssemblySupport";

        /// Set if OLE supports the Windows Installer.
        public const string OLEAdvtSupport = "OLEAdvtSupport";

        /// The installer sets the RedirectedDLLSupport property if the system performing the installation supports Isolated Components.
        public const string RedirectedDLLSupport = "RedirectedDLLSupport";

        /// The installer sets the RemoteAdminTS property when the system is a remote administration server using Terminal Services.
        public const string RemoteAdminTS = "RemoteAdminTS";

        /// The version number of the operating system service pack.
        public const string ServicePackLevel = "ServicePackLevel";

        /// The minor version number of the operating system service pack.
        public const string ServicePackLevelMinor = "ServicePackLevelMinor";

        /// Set when the system is operating as Shared Windows.
        public const string SharedWindows = "SharedWindows";

        /// Set if the shell supports feature advertising.
        public const string ShellAdvtSupport = "ShellAdvtSupport";

        /// Default language identifier for the system.
        public const string SystemLanguageID = "SystemLanguageID";

        /// Set when the system is a server with Windows Terminal Server.
        public const string TerminalServer = "TerminalServer";

        /// Indicates if the operating system supports using .TTC (true type font collections) files.
        public const string TTCSupport = "TTCSupport";

        /// Version number for the Windows operating system.
        public const string Version9X = "Version9X";

        /// Numeric database version of the current installation.
        public const string VersionDatabase = "VersionDatabase";

        /// Version number for the Windows NT/Windows 2000 operating system.
        public const string VersionNT = "VersionNT";

        /// Version number for the Windows NT/Windows 2000 operating system if the system is running on a 64-bit computer.
        public const string VersionNT64 = "VersionNT64";

        /// Build number of the operating system.
        public const string WindowsBuild = "WindowsBuild";
        #endregion	Operating System

        #region	Product Information
        /// Internet address, or URL, for technical support.
        public const string ARPHELPLINK = "ARPHELPLINK";

        /// Technical support phone numbers.
        public const string ARPHELPTELEPHONE = "ARPHELPTELEPHONE";

        /// String displayed by a message box prompting for a disk.
        public const string DiskPrompt = "DiskPrompt";

        /// HelpLink
        public const string HelpLink = "HelpLink";

        /// HelpTelephone
        public const string HelpTelephone = "HelpTelephone";

        /// InstallDate
        public const string InstallDate = "InstallDate";

        /// InstallLocation
        public const string InstallLocation = "InstallLocation";

        /// InstallSource
        public const string InstallSource = "InstallSource";

        /// InstalledProductName
        public const string InstalledProductName = "InstalledProductName";

        /// InstanceType
        public const string InstanceType = "InstanceType";

        /// Set to 1 if the current installation is running from a package created through an administrative installation.
        public const string IsAdminPackage = "IsAdminPackage";

        /// Language
        public const string Language = "Language";

        /// LocalPackage
        public const string LocalPackage = "LocalPackage";

        /// Places units to the left of the number.
        public const string LeftUnit = "LeftUnit";

        /// Name of the application's manufacturer. (Required.)
        public const string Manufacturer = "Manufacturer";

        /// The installer sets this property to 1 when the installation uses a media source, such as a CD-ROM.
        public const string MediaSourceDir = "MediaSourceDir";

        /// The presence of this property indicates that a product code changing transform is registered to the product.
        public const string MSIINSTANCEGUID = "MSIINSTANCEGUID";

        /// This property indicates the installation of a new instance of a product with instance transforms.
        public const string MSINEWINSTANCE = "MSINEWINSTANCE";

        /// String used as a template for the PIDKEY property.
        public const string PIDTemplate = "PIDTemplate";

        /// A unique identifier for the particular product release. (Required.)
        public const string ProductCode = "ProductCode";

        /// ProductIcon
        public const string ProductIcon = "ProductIcon";

        /// Human-readable name of the application. (Required.)
        public const string ProductName = "ProductName";

        /// Set to the installed state of a product.  (-1 unknown, 1 advertised, 2 absent, 5 default)
        public const string ProductState = "ProductState";

        /// String format of the product version as a numeric value. (Required.)
        public const string ProductVersion = "ProductVersion";

        /// Publisher
        public const string Publisher = "Publisher";

        /// A GUID representing a related set of products.
        public const string UpgradeCode = "UpgradeCode";

        /// URLInfoAbout
        public const string URLInfoAbout = "URLInfoAbout";

        /// URLUpdateInfo
        public const string URLUpdateInfo = "URLUpdateInfo";

        /// Version
        public const string Version = "Version";

        /// VersionString
        public const string VersionString = "VersionString";

        /// VersionMajor
        public const string VersionMajor = "VersionMajor";

        /// VersionMinor
        public const string VersionMinor = "VersionMinor";
        #endregion	Product Information

        #region	Summary Information Update
        /// The value of this property is written to the Revision Number Summary Property.
        public const string PATCHNEWPACKAGECODE = "PATCHNEWPACKAGECODE";

        /// The value of this property is written to the Comments Summary Property.
        public const string PATCHNEWSUMMARYCOMMENTS = "PATCHNEWSUMMARYCOMMENTS";

        /// The value of this property is written to the Subject Summary Property.
        public const string PATCHNEWSUMMARYSUBJECT = "PATCHNEWSUMMARYSUBJECT";
        #endregion	Summary Information Update

        #region	System Folders
        /// Full path to the directory containing administrative tools for an individual user.
        public const string AdminToolsFolder = "AdminToolsFolder";

        /// Full path to the Application Data folder for the current user.
        public const string AppDataFolder = "AppDataFolder";

        /// Full path to application data for all users.
        public const string CommonAppDataFolder = "CommonAppDataFolder";

        /// Full path to the predefined 64-bit Common Files folder.
        public const string CommonFiles64Folder = "CommonFiles64Folder";

        /// Full path to the Common Files folder for the current user.
        public const string CommonFilesFolder = "CommonFilesFolder";

        /// Full path to the Desktop folder.
        public const string DesktopFolder = "DesktopFolder";

        /// Full path to the Favorites folder.
        public const string FavoritesFolder = "FavoritesFolder";

        /// Full path to the Fonts folder.
        public const string FontsFolder = "FontsFolder";

        /// Full path to directory that serves as a data repository for local (nonroaming) applications.
        public const string LocalAppDataFolder = "LocalAppDataFolder";

        /// Full path to the My Pictures folder.
        public const string MyPicturesFolder = "MyPicturesFolder";

        /// Full path to the Personal folder for the current user.
        public const string PersonalFolder = "PersonalFolder";

        /// Full path of the predefined 64-bit Program Files folder.
        public const string ProgramFiles64Folder = "ProgramFiles64Folder";

        /// Full path of the predefined 32-bit Program Files folder.
        public const string ProgramFilesFolder = "ProgramFilesFolder";

        /// Full path to the Program Menu folder.
        public const string ProgramMenuFolder = "ProgramMenuFolder";

        /// Full path to the SendTo folder for the current user.
        public const string SendToFolder = "SendToFolder";

        /// Full path to the Start Menu folder.
        public const string StartMenuFolder = "StartMenuFolder";

        /// Full path to the Startup folder.
        public const string StartupFolder = "StartupFolder";

        /// Full path to folder for 16-bit system DLLs.
        public const string System16Folder = "System16Folder";

        /// Full path to folder for 64-bit system DLLs.
        public const string System64Folder = "System64Folder";

        /// Full path to folder for 32-bit system DLLs.
        public const string SystemFolder = "SystemFolder";

        /// Full path to the Temp folder.
        public const string TempFolder = "TempFolder";

        /// Full path to the Template folder for the current user.
        public const string TemplateFolder = "TemplateFolder";

        /// Full path to the Windows folder.
        public const string WindowsFolder = "WindowsFolder";

        /// The volume of the Windows folder.
        public const string WindowsVolume = "WindowsVolume";
        #endregion	System Folders

        #region	User Information
        /// List of properties (separated by semicolons) set during an administration installation.
        public const string AdminProperties = "AdminProperties";

        /// Organization of user performing the installation.
        public const string COMPANYNAME = "COMPANYNAME";

        /// User name for the user currently logged on.
        public const string LogonUser = "LogonUser";

        /// List of properties (separated by semicolonsthat are prevented from being written into the log.
        public const string MsiHiddenProperties = "MsiHiddenProperties";

        /// Part of the Product ID entered by user.
        public const string PIDKEY = "PIDKEY";

        /// Full Product ID after a successful validation.
        public const string ProductID = "ProductID";

        /// Default language identifier of the current user.
        public const string UserLanguageID = "UserLanguageID";

        /// User performing the installation.
        public const string USERNAME = "USERNAME";

        /// Set by the installer to the user's security identifier (SID).
        public const string UserSID = "UserSID";
        #endregion	User Information

        /// AssignmentType
        public const string AssignmentType = "AssignmentType";

        /// PackageCode
        public const string PackageCode = "PackageCode";
        #endregion	Constants (Static Fields)

        #region	Construction / Destruction
        private MsiInstallerProperty() { }
        #endregion	Construction / Destruction
    }
    #endregion	Constants

    #region	Enumerations
    /// Bit-flags of extra advertisment options.
    public enum MsiAdvertismentOptions : uint
    {
        /// No options.
        None = 0,
        /// Multiple instances through product code changing transform support flag.  (Windows Server 2003 family and later and Windows XP Service Pack 1 and later.)
        Instance = 1,
    }

    /// Enumeration of MSI assembly types.
    public enum MsiAssemblyInfo : uint
    {
        /// .Net assemblies
        NetAssembly = 0,
        /// Win32 assemblies
        Win32Assembly = 1,
    }

    /// Enumeration of database persistence modes.
    public enum MsiDbPersistMode
    {
        /// database open read-only, no persistent changes
        ReadOnly = 0,
        /// database read/write in transaction mode
        Transact = 1,
        /// database direct read/write without transaction
        Direct = 2,
        /// create new database, transact mode read/write
        Create = 3,
        /// create new database, direct mode read/write
        CreateDirect = 4,
        /// database open read-only, no persistent changes
        PatchFile = 8,
    }

    /// Enumeration of view column types to return from <see cref="MsiInterop.MsiViewGetColumnInfo"/>.
    public enum MsiColInfoType : int
    {
        /// Column names are returned.
        Names = 0,
        /// Definitions are returned.
        Types = 1,
    }

    /// Enumeration of MSI conditions.
    public enum MsiCondition : int
    {
        /// expression evaluates to False
        False = 0,
        /// expression evaluates to True
        True = 1,
        /// no expression present
        None = 2,
        /// syntax error in expression
        Error = 3,
    }

    /// Bitflags for MSI control attributes.
    /// <remarks>Please refer to the MSDN Windows Installer documentation for more information.</remarks>
    [Flags]
    public enum MsiControlAttribute : int
    {
        /// If the Visible Control bit is set, the control is visible on the dialog box. If this bit is not set, the control is hidden on the dialog box. The visible or hidden state of the Visible control attribute can be later changed by a Control Event.
        Visible = 0x00000001,
        /// This attribute specifies if the given control is enabled or disabled. Most controls appear gray when disabled.
        Enabled = 0x00000002,
        /// If this bit is set, the control is displayed with a sunken, three dimensional look. The effect of this style bit is different on different controls and versions of Windows. On some controls it has no visible effect. If the system does not support the Sunken control attribute, the control is displayed in the default visual style. If this bit is not set, the control is displayed with the default visual style.
        Sunken = 0x00000004,
        /// The Indirect control attribute specifies whether the value displayed or changed by this control is referenced indirectly. If this bit is set, the control displays or changes the value of the property that has the identifier listed in the Property column of the Control table. If this bit is not set, the control displays or changes the value of the property in the Property column of the Control table.
        Indirect = 0x00000008,
        /// If this bit is set on a control, the associated property specified in the Property column of the Control table is an integer. If this bit is not set, the property is a string value.
        Integer = 0x00000010,
        /// If this style bit is set the text in the control is displayed in a right-to-left reading order.
        RTLRO = 0x00000020,
        /// If this style bit is set, text in the control is aligned to the right.
        RightAligned = 0x00000040,
        /// If this bit is set, the scroll bar is located on the left side of the control. If this bit is not set, the scroll bar is on the right side of the control.
        LeftScroll = 0x00000080,
        /// This is a combination of the right-to-left reading order <see cref="RTLRO"/>, the <see cref="RightAligned"/>, and <see cref="LeftScroll"/> attributes.
        BiDi = RTLRO | RightAligned | LeftScroll,

        //	text controls

        /// If the Transparent Control bit is set on a text control, the control is displayed transparently with the background showing through the control where there are no characters. If this bit is not set the text control is opaque.
        Transparent = 0x00010000,
        /// If this bit is set on a text control, the occurrence of the ampersand character in a text string is displayed as itself. If this bit is not set, then the character following the ampersand in the text string is displayed as an underscored character.
        NoPrefix = 0x00020000,
        /// If this bit is set the text in the control is displayed on a single line. If the text extends beyond the control's margins it is truncated and an ellipsis ("...") is inserted at the end to indicate the truncation. If this bit is not set, text wraps.
        NoWrap = 0x00040000,
        /// If this bit is set for a static text control, the control will automatically attempt to format the displayed text as a number representing a count of bytes. For proper formatting, the control's text must be set to a string representing a number expressed in units of 512 bytes. The displayed value will then be formatted in terms of kilobytes (KB), megabytes (MB), or gigabytes (GB), and displayed with the appropriate string representing the units.  Kb = Less than 20480.  Mb = Less than 20971520.  Gb = Less than 10737418240
        FormatSize = 0x00080000,
        /// If this bit flag is set, fonts are created using the user's default UI code page. If the bit flag is not set, fonts are created using the database code page.
        UsersLanguage = 0x00100000,

        //	edit controls

        /// If this bit is set on an Edit control, the installer creates a multiple line edit control with a vertical scroll bar.
        MultiLine = 0x00001000,
        /// PasswordInput
        PasswordInput = 0x00200000,

        //	progress bar

        /// If this bit is set on a ProgressBar control, the bar is drawn as a series of small rectangles in Microsoft Windows 95-style. If this bit is not set, the progress indicator bar is drawn as a single continuous rectangle.
        Progress95 = 0x00001000,

        //	volume select combo and directory combo

        /// If this bit is set, the control shows all the volumes involved in the current installation plus all the removable volumes. If this bit is not set, the control lists volumes in the current installation.
        RemovableVolume = 0x00010000,
        /// If the FixedVolume Control bit is set, the control shows all the volumes involved in the current installation plus all the fixed internal hard drives. If this bit is not set, the control lists the volumes in the current installation.
        FixedVolume = 0x00020000,
        /// If this bit is set, the control shows all the volumes involved in the current installation plus all the remote volumes. If this bit is not set, the control lists volumes in the current installation.
        RemoteVolume = 0x00040000,
        /// If the CDROMVolume Control bit is set, the control shows all the volumes in the current installation plus all the CD-ROM volumes. If this bit is not set, the control shows all the volumes in the current installation.
        CDRomVolume = 0x00080000,
        /// If this bit is set, the control shows all the volumes involved in the current installation plus all the RAM disk volumes. If this bit is not set the control lists volumes in the current installation.
        RAMDiskVolume = 0x00100000,
        /// If the FloppyVolume Control bit is set, the control shows all the volumes involved in the current installation plus all the floppy volumes. If this bit is not set, the control lists volumes in the current installation.
        FloppyVolume = 0x00200000,

        //	volume list controls

        /// ShowRollbackCost
        ShowRollbackCost = 0x00400000,

        //	list box / combo box
        /// If this bit is set, the items listed in the control are displayed in a specified order. If the bit is not set, items are displayed in alphabetical order.
        Sorted = 0x00010000,
        /// If the ComboList Control bit is set on a combo box, the edit field is replaced by a static text field. This prevents a user from entering a new value and requires the user to choose only one of the predefined values. If this bit is not set, the combo box has an edit field.
        ComboList = 0x00020000,

        //	picture buttons

        /// ImageHandle
        ImageHandle = 0x00010000,
        /// If this bit is set on a check box or a radio button group, the button is drawn with the appearance of a push button, but its logic stays the same. If the bit is not set, the controls are drawn in their usual style.
        PushLike = 0x00020000,
        /// If the Bitmap Control bit is set, the text in the control is replaced by a bitmap image. The Text column in the Control table is a foreign key into the Binary table. If this bit is not set, the text in the control is specified in the Text column of the Control table.
        Bitmap = 0x00040000,
        /// If this bit is set, text is replaced by an icon image and the Text column in the Control table is a foreign key into the Binary table. If this bit is not set, text in the control is specified in the Text column of the Control table.
        Icon = 0x00080000,
        /// If the FixedSize Control bit is set, the picture is cropped or centered in the control without changing its shape or size. If this bit is not set the picture is stretched to fit the control.
        FixedSize = 0x00100000,
        /// The first 16x16 image is loaded.
        IconSize16 = 0x00200000,
        /// The first 32x32 image is loaded.
        IconSize32 = 0x00400000,
        /// The first 48x48 image is loaded.
        IconSize48 = 0x00600000,

        //	radio buttons
        /// If this bit is set, the RadioButtonGroup has text and a border displayed around it. If the style bit is not set, the border is not displayed and no text is displayed on the group.
        HasBorder = 0x01000000,
    }

    /// Enumeration of MSI feature cost tree options.
    public enum MsiCostTree : int
    {
        /// The feature only is included in the cost.
        SelfOnly = 0,
        /// The children of the indicated feature are included in the cost.
        Children = 1,
        /// The parent features of the indicated feature are included in the cost.
        Parents = 2,
        /// Reserved for future use.
        Reserved = 3,
    }

    /// Enumeration of custom action types.
    public enum MsiCustomActionType : int
    {
        // executable types

        /// Target = entry point name
        Dll = 0x00000001,
        /// Target = command line args
        Exe = 0x00000002,
        /// Target = text string to be formatted and set into property
        TextData = 0x00000003,
        /// Target = entry point name, null if none to call
        JScript = 0x00000005,
        /// Target = entry point name, null if none to call
        VBScript = 0x00000006,
        /// Target = property list for nested engine initialization
        Install = 0x00000007,

        // source of code

        /// Source = Binary.Name, data stored in stream
        BinaryData = 0x00000000,
        /// Source = File.File, file part of installation
        SourceFile = 0x00000010,
        /// Source = Directory.Directory, folder containing existing file
        Directory = 0x00000020,
        /// Source = Property.Property, full path to executable
        Property = 0x00000030,

        // return processing default is syncronous execution, process return code

        /// ignore action return status, continue running
        Continue = 0x00000040,
        /// run asynchronously
        Async = 0x00000080,

        // execution scheduling flags  default is execute whenever sequenced

        /// skip if UI sequence already run
        FirstSequence = 0x00000100,
        /// skip if UI sequence already run in same process
        OncePerProcess = 0x00000200,
        /// run on client only if UI already run on client
        ClientRepeat = 0x00000300,
        /// queue for execution within script
        InScript = 0x00000400,
        /// in conjunction with InScript: queue in Rollback script
        Rollback = 0x00000100,
        /// in conjunction with InScript: run Commit ops from script on success
        Commit = 0x00000200,

        // security context flag, default to impersonate as user, valid only if InScript

        /// no impersonation, run in system context
        NoImpersonate = 0x00000800,
        /// impersonate for per-machine installs on TS machines
        TSAware = 0x00004000,

        // script requires 64bit process

        /// script should run in 64bit process
        Type64BitScript = 0x00001000,
        /// don't record the contents of the Target field in the log file.
        HideTarget = 0x00002000,
    }

    /// Enumeration of MSI database errors.
    public enum MsiDbError : int
    {
        /// invalid argument
        InvalidArg = -3,
        /// buffer too small
        MoreData = -2,
        /// function error
        FunctionError = -1,
        /// no error
        NoError = 0,
        /// new record duplicates primary keys of existing record in table
        DuplicateKey = 1,
        /// non-nullable column, no null values allowed
        Required = 2,
        /// corresponding record in foreign table not found
        BadLink = 3,
        /// data greater than maximum value allowed
        Overflow = 4,
        /// data less than minimum value allowed
        Underflow = 5,
        /// data not a member of the values permitted in the set
        NotInSet = 6,
        /// invalid version string
        BadVersion = 7,
        /// invalid case, must be all upper-case or all lower-case
        BadCase = 8,
        /// invalid GUID
        BadGUID = 9,
        /// invalid wildcardfilename or use of wildcards
        BadWildcard = 10,
        /// bad identifier
        BadIdentifier = 11,
        /// bad language Id(s)
        BadLanguage = 12,
        /// bad filename
        BadFilename = 13,
        /// bad path
        BadPath = 14,
        /// bad conditional statement
        BadCondition = 15,
        /// bad format string
        BadFormatted = 16,
        /// bad template string
        BadTemplate = 17,
        /// bad string in DefaultDir column of Directory table
        BadDefaultDir = 18,
        /// bad registry path string
        BadRegPath = 19,
        /// bad string in CustomSource column of CustomAction table
        BadCustomSource = 20,
        /// bad property string
        BadProperty = 21,
        /// _Validation table missing reference to column
        MissingData = 22,
        /// Category column of _Validation table for column is invalid
        BadCategory = 23,
        /// table in KeyTable column of _Validation table could not be found/loaded
        BadKeyTable = 24,
        /// value in MaxValue column of _Validation table is less than value in MinValue column
        BadMaxMinValues = 25,
        /// bad cabinet name
        BadCabinet = 26,
        /// bad shortcut target
        BadShortcut = 27,
        /// string overflow (greater than length allowed in column def)
        StringOverflow = 28,
        /// invalid localization attribute (primary keys cannot be localized)
        BadLocalizedAttrib = 29,
    }

    /// Enumeration of MSI database states.
    public enum MsiDbState : int
    {
        /// invalid database handle
        Error = -1,
        /// database open read-only, no persistent changes
        Read = 0,
        /// database readable and updatable
        Write = 1,
    }

    /// Bitflags for MSI dialogs.
    /// <remarks>Please refer to the MSDN Windows Installer documentation for more information.</remarks>
    [Flags]
    public enum MsiDialogStyle : int
    {
        /// If this bit is set the dialog is originally created as visible, otherwise it is hidden.
        Visible = 1,
        /// If this bit is set, the dialog box is modal, other dialogs of the same application cannot be put on top of it, and the dialog keeps the control while it is running. If this bit is not set, the dialog is modeless, other dialogs of the same application may be moved on top of it. After a modeless dialog is created and displayed, the user interface returns control to the installer. The installer then calls the user interface periodically to update the dialog and to give it a chance to process the messages. As soon as this is done, the control is returned to the installer.  Note  There should be no modeless dialogs in a wizard sequence, since this would return control to the installer, ending the wizard sequence prematurely.
        Modal = 2,
        /// If this bit is set, the dialog box can be minimized. This bit is ignored for modal dialog boxes, which cannot be minimized.
        Minimize = 4,
        /// If this style bit is set, the dialog box will stop all other applications and no other applications can take the focus. This state remains until the SysModal dialog is dismissed.
        SysModal = 8,
        /// Normally, when this bit is not set and a dialog box is created through DoAction, all other (typically modeless) dialogs are destroyed. If this bit is set, the other dialogs stay alive when this dialog box is created.
        KeepModeless = 16,
        /// If this bit is set, the dialog box periodically calls the installer. If the property changes, it notifies the controls on the dialog. This style can be used if there is a control on the dialog indicating disk space. If the user switches to another application, adds or removes files, or otherwise modifies available disk space, you can quickly implement the change using this style. Any dialog box relying on the OutOfDiskSpace property to determine whether to bring up a dialog must set the TrackDiskSpace Dialog Style Bit for the dialog to dynamically update space on the target volumes.
        TrackDiskSpace = 32,
        /// If this bit is set, the pictures on the dialog box are created with the custom palette (one per dialog received from the first control created). If the bit is not set, the pictures are rendered using a default palette.
        UseCustomPalette = 64,
        /// If this style bit is set the text in the dialog box is displayed in right-to-left-reading order.
        RTLRO = 128,
        /// If this style bit is set, the text is aligned on the right side of the dialog box.
        RightAligned = 256,
        /// If this style bit is set, the scroll bar is located on the left side of the dialog box.
        LeftScroll = 512,
        /// This is a combination of the right to left reading order <see cref="RTLRO"/>, the <see cref="RightAligned"/>, and the <see cref="LeftScroll"/> dialog style bits.
        BiDi = 896,
        /// If this bit is set, the dialog box is an error dialog.
        Error = 65536,
    }

    /// Internal enumeration of Win32/MSI errors.
    public enum MsiError : uint
    {
        /// No error occured.
        NoError = 0,
        /// The operation was successful.
        Success = 0,
        /// The system cannot find the file specified.
        FileNotFound = 2,
        /// Access is denied.
        AccessDenied = 5,
        /// The handle is invalid.
        InvalidHandle = 6,
        /// Not enough storage is available to process this command.
        NotEnoughMemory = 8,
        /// The data is invalid.
        InvalidData = 13,
        /// Not enough storage is available to complete this operation.
        OutOfMemory = 14,
        /// The parameter is incorrect.
        InvalidParameter = 87,
        /// The system cannot open the device or file specified.
        OpenFailed = 110,
        /// There is not enough space on the disk.
        DiskFull = 112,
        /// This function is not available for this platform. It is only available on Windows 2000 and Windows XP with Window Installer version 2.0.
        CallNotImplemented = 120,
        /// The specified path is invalid.
        BadPathName = 161,
        /// No data is available.
        NoData = 232,
        /// More data is available.
        MoreData = 234,
        /// No more data is available.
        NoMoreItems = 259,
        /// The directory name is invalid.
        Directory = 267,
        /// The volume for a file has been externally altered so that the opened file is no longer valid.
        FileInvalid = 1006,
        /// This error code only occurs when using Windows Installer version 2.0 and Windows XP. If Windows Installer determines a product may be incompatible with the current operating system, it displays a dialog box informing the user and asking whether to try to install anyway. This error code is returned if the user chooses not to try the installation.
        AppHelpBlock = 1259,
        /// The Windows Installer service could not be accessed.
        InstallServiceFailure = 1601,
        /// The user cancels installation.
        InstallUserExit = 1602,
        /// A fatal error occurred during installation.
        InstallFailure = 1603,
        /// Installation suspended, incomplete.
        InstallSuspend = 1604,
        /// This action is only valid for products that are currently installed.
        UnknownProduct = 1605,
        /// The feature identifier is not registered.
        UnknownFeature = 1606,
        /// The component identifier is not registered.
        UnknownComponent = 1607,
        /// This is an unknown property.
        UnknownProperty = 1608,
        /// The handle is in an invalid state.
        InvalidHandleState = 1609,
        /// The configuration data for this product is corrupt.
        BadConfiguration = 1610,
        /// The component qualifier not present.
        IndexAbsent = 1611,
        /// The installation source for this product is not available. Verify that the source exists and that you can access it.
        InstallSourceAbsent = 1612,
        /// This installation package cannot be installed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service.
        InstallPackageVersion = 1613,
        /// The product is uninstalled.
        ProductUninstalled = 1614,
        /// The SQL query syntax is invalid or unsupported.
        BadQuerySyntax = 1615,
        /// The record field does not exist.
        InvalidField = 1616,
        /// Another installation is already in progress.
        InstallAlreadyRunning = 1618,
        /// This installation package could not be opened. Verify that the package exists and is accessible, or contact the application vendor to verify that this is a valid Windows Installer package.
        InstallPackageOpenFailed = 1619,
        /// This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.
        InstallPackageInvalid = 1620,
        /// There was an error starting the Windows Installer service user interface.
        InstallUIFailure = 1621,
        /// There was an error opening installation log file. Verify that the specified log file location exists and is writable.
        InstallLogFailure = 1622,
        /// This language of this installation package is not supported by your system.
        InstallLanguageUnsupported = 1623,
        /// There was an error applying transforms. Verify that the specified transform paths are valid.
        InstallTransformFailure = 1624,
        /// This installation is forbidden by system policy.
        InstallPackageRejected = 1625,
        /// The function could not be executed.
        FunctionNotCalled = 1626,
        /// The function failed during execution.
        FunctionFailed = 1627,
        /// An invalid or unknown table was specified.
        InvalidTable = 1628,
        /// The data supplied is the wrong type.
        DatatypeMismatch = 1629,
        /// Data of this type is not supported.
        UnsupportedType = 1630,
        /// The Windows Installer service failed to start.
        CreateFailed = 1631,
        /// The Temp folder is either full or inaccessible. Verify that the Temp folder exists and that you can write to it.
        InstallTempUnwritable = 1632,
        /// This installation package is not supported on this platform.
        InstallPlatformUnsupported = 1633,
        /// Component is not used on this machine.
        InstallNotUsed = 1634,
        /// This patch package could not be opened.
        PatchPackageOpenFailed = 1635,
        /// This patch package could not be opened
        PatchPackageInvalid = 1636,
        /// This patch package cannot be processed by the Windows Installer service.
        PatchPackageUnsupported = 1637,
        /// Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs in Control Panel.
        ProductVersion = 1638,
        /// Invalid command line argument. Consult the Windows Installer SDK for detailed command-line help.
        InvalidCommandLine = 1639,
        /// Installation from a Terminal Server client session is not permitted for the current user.
        InstallRemoteDisallowed = 1640,
        /// The installer has initiated a restart. This error code is not available on Windows Installer version 1.0.
        SuccessRebootInitiated = 1641,
        /// The installer cannot install the upgrade patch because the program being upgraded may be missing or the upgrade patch updates a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch. This error code is not available on Windows Installer version 1.0.
        PatchTargetNotFound = 1642,
        /// The patch package is not permitted by system policy. This error code is available with Windows Installer versions 2.0.
        InstallTransformRejected = 1643,
        /// One or more customizations are not permitted by system policy. This error code is available with Windows Installer versions 2.0.
        InstallRemoteProhibited = 1644,
        /// The specified datatype is invalid.
        InvalidDataType = 1804,
        /// The specified username is invalid.
        BadUserName = 2202,
        /// A restart is required to complete the install. This does not include installs where the ForceReboot action is run. This error code is not available on Windows Installer version 1.0.
        SucessRebootRequired = 3010,
        /// Unspecified error.
        E_Fail = 0x80004005,
    }

    /// Bit flags install feature attributes enumeration.
    [Flags]
    public enum MsiInstallFeatureAttribute : int
    {
        /// FavorLocal
        FavorLocal = (1 << 0),
        /// FavorSource
        FavorSource = (1 << 1),
        /// FollowParent
        FollowParent = (1 << 2),
        /// FavorAdvertise
        FavorAdvertise = (1 << 3),
        /// DisallowAdvertise
        DisallowAdvertise = (1 << 4),
        /// NounSupportedAdvertise
        NounSupportedAdvertise = (1 << 5),
        /// All attributes.
        All = FavorLocal | FavorSource | FollowParent | FavorAdvertise | DisallowAdvertise,
    }

    ///
    /// Bit-flags defining an MSI feature's install state.
    ///
    [Flags]
    public enum MsiFeatureInstallState : int
    {
        /// The feature can be advertised.
        Advertised = 2,
        /// The feature can be absent.
        Absent = 4,
        /// The feature can be installed on the local drive.
        Local = 8,
        /// The feature can be configured to run from source, CD-ROM, or network.
        Source = 16,
        /// The feature can be configured to use the default location: local or source.
        Default = 32,
    }

    /// Enumeration of MSI install levels.
    public enum MsiInstallLevel : int
    {
        /// install authored default
        Default = 0,
        /// install only required features
        Minimum = 1,
        /// install all features
        Maximum = 0xffff,
    }

    /// Bit flags for use with <see cref="MsiInterop.MsiEnableLog"/> and <see cref="MsiInterop.MsiSetExternalUI"/>.
    [Flags]
    public enum MsiInstallLogMode : uint
    {
        /// None.
        None = 0,
        /// Logs out of memory or fatal exit information.
        FatalExit = (1 << (int)(MsiInstallMessage.FatalExit >> 24)),
        /// Logs the error messages.
        Error = (1 << (int)(MsiInstallMessage.Error >> 24)),
        /// Logs the warning messages.
        Warning = (1 << (int)(MsiInstallMessage.Warning >> 24)),
        /// Logs the user requests.
        User = (1 << (int)(MsiInstallMessage.User >> 24)),
        /// Logs the status messages that are not displayed.
        Info = (1 << (int)(MsiInstallMessage.Info >> 24)),
        /// Request to determine a valid source location.
        ResolveSource = (1 << (int)(MsiInstallMessage.ResolveSource >> 24)),
        /// Indicates insufficient disk space.
        OutOfDiskSpace = (1 << (int)(MsiInstallMessage.OutOfDiskSpace >> 24)),
        /// Logs the start of new installation actions.
        ActionStart = (1 << (int)(MsiInstallMessage.ActionStart >> 24)),
        /// Logs the data record with the installation action.
        ActionData = (1 << (int)(MsiInstallMessage.ActionData >> 24)),
        /// Logs the parameters for user-interface initialization.
        CommonData = (1 << (int)(MsiInstallMessage.CommonData >> 24)),
        /// Logs the property values at termination.
        PropertyDump = (1 << (int)(MsiInstallMessage.Progress >> 24)),
        /// Sends large amounts of information to a log file not generally useful to users. May be used for technical support.
        Verbose = (1 << (int)(MsiInstallMessage.Initialize >> 24)),
        /// Sends extra debugging information, such as handle creation information, to the log file. Windows XP/2000/98/95:  This feature is not supported.
        ExtraDebug = (1 << (int)(MsiInstallMessage.Terminate >> 24)),
        /// external handler only
        Progress = (1 << (int)(MsiInstallMessage.Progress >> 24)),
        /// external handler only
        Initialize = (1 << (int)(MsiInstallMessage.Initialize >> 24)),
        /// external handler only
        Terminate = (1 << (int)(MsiInstallMessage.Terminate >> 24)),
        /// external handler only
        ShowDialog = (1 << (int)(MsiInstallMessage.ShowDialog >> 24)),
        /// All modes.
        ExternalUI = FatalExit | Error | Warning | User | ActionStart | ActionData |
            CommonData | Progress | ShowDialog,
    }

    ///
    /// <para>Install message type for callback is a combination of the following:</para>
    /// <para>A message box style:  MB_*, where MB_OK is the default</para>
    /// <para>A message box icon type:  MB_ICON*, where no icon is the default</para>
    /// <para>A default button:  MB_DEFBUTTON?, where MB_DEFBUTTON1 is the default</para>
    /// <para>One of these flags an install message, no default.</para>
    ///
    public enum MsiInstallMessage : long
    {
        /// 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 and 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,
    }

    /// Enumeration of installation modes.
    public enum MsiInstallMode : int
    {
        /// skip source resolution
        NoSourceResolution = -3,
        /// skip detection
        NoDetection = -2,
        /// provide, if available
        Existing = -1,
        /// install, if absent
        Default = 0
    }

    /// Enumeration of MSI install states.
    public enum MsiInstallState : int
    {
        /// component disabled
        NotUsed = -7,
        /// configuration data corrupt
        BadConfig = -6,
        /// installation suspended or in progress
        Incomplete = -5,
        /// run from source, source is unavailable
        SourceAbsent = -4,
        /// return buffer overflow
        MoreData = -3,
        /// invalid function argument
        InvalidArg = -2,
        /// unrecognized product or feature
        Unknown = -1,
        /// broken
        Broken = 0,
        /// advertised feature
        Advertised = 1,
        /// component being removed (action state, not settable)
        Removed = 1,
        /// uninstalled (or action state absent but clients remain)
        Absent = 2,
        /// installed on local drive
        Local = 3,
        /// run from source, CD or net
        Source = 4,
        /// use default, local or source
        Default = 5,
    }

    /// Enumeration of various MSI install types.
    public enum MsiInstallType : int
    {
        /// set to indicate default behavior
        Default = 0,
        /// set to indicate network install
        NetworkImage = 1,
        /// set to indicate a particular instance
        SingleInstance = 2,
    }

    /// Enumeration of internal MSI install UI levels.
    public enum MsiInstallUILevel : uint
    {
        /// UI level is unchanged
        NoChange = 0,
        /// default UI is used
        Default = 1,
        /// completely silent installation
        None = 2,
        /// simple progress and error handling
        Basic = 3,
        /// authored UI, wizard dialogs suppressed
        Reduced = 4,
        /// authored UI with wizards, progress, errors
        Full = 5,
        /// display success/failure dialog at end of install
        EndDialog = 0x80,
        /// display only progress dialog
        ProgressOnly = 0x40,
        /// do not display the cancel button in basic UI
        HideCancel = 0x20,
        /// force display of source resolution even if quiet
        SourceResOnly = 0x100,
    }

    /// Flag attributes for <see cref="MsiInterop.MsiEnableLog"/>.
    public enum MsiLogAttribute : int
    {
        /// If this value is set, the installer appends the existing log.
        Append = (1 << 0),
        /// Forces the log buffer to be flushed after each line.
        FlushEachLine = (1 << 1),
    }

    /// Enumeration of modification modes for <see cref="MsiInterop.MsiViewModify"/>.
    public enum MsiModify : int
    {
        /// reposition to current record primary key
        Seek = -1,
        /// refetch current record data
        Refresh = 0,
        /// insert new record, fails if matching key exists
        Insert = 1,
        /// update existing non-key data of fetched record
        Update = 2,
        /// insert record, replacing any existing record
        Assign = 3,
        /// update record, delete old if primary key edit
        Replace = 4,
        /// fails if record with duplicate key not identical
        Merge = 5,
        /// remove row referenced by this record from table
        Delete = 6,
        /// insert a temporary record
        InsertTemporary = 7,
        /// validate a fetched record
        Validate = 8,
        /// validate a new record
        ValidateNew = 9,
        /// validate field(s) of an incomplete record
        ValidateField = 10,
        /// validate before deleting record
        ValidateDelete = 11,
    }

    ///
    /// Possible flags for the <c>options</c> parameter of <see cref="MsiInterop.MsiOpenPackageEx"/>.
    ///
    public enum MsiOpenPackageFlags : uint
    {
        /// No options.
        None = 0,
        /// Ignore the computer state when creating the product handle.
        IgnoreMachineState = 1,
    }

    /// Bit-flags for reinstallation.
    [Flags]
    public enum MsiReinstallMode : uint
    {
        /// Reserved bit - currently ignored
        Repair = 0x00000001,
        /// 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,
    }

    /// Enumeration of MSI run modes.
    public enum MsiRunMode : int
    {
        /// admin mode install, else product install
        Admin = 0,
        /// installing advertisements, else installing or updating product
        Advertise = 1,
        /// modifying an existing installation, else new installation
        Maintenance = 2,
        /// rollback is enabled
        RollbackEnabled = 3,
        /// log file active, enabled prior to install session
        LogEnabled = 4,
        /// spooling execute operations, else in determination phase
        Operations = 5,
        /// reboot needed after successful installation (settable)
        RebootAtEnd = 6,
        /// reboot needed to continue installation (settable)
        RebootNow = 7,
        /// installing files from cabinets and files using Media table
        Cabinet = 8,
        /// source LongFileNames suppressed via PID_MSISOURCE summary property
        SourceShortNames = 9,
        /// target LongFileNames suppressed via SHORTFILENAMES property
        TargetShortNames = 10,
        /// future use
        Reserved11 = 11,
        /// operating systems is Windows9?, else Windows NT
        Windows9x = 12,
        /// operating system supports demand installation
        ZawEnabled = 13,
        /// future use
        Reserved14 = 14,
        /// future use
        Reserved15 = 15,
        /// custom action call from install script execution
        Scheduled = 16,
        /// custom action call from rollback execution script
        Rollback = 17,
        /// custom action call from commit execution script
        Commit = 18,
    }

    /// Bit-flag error conditions that should be suppressed when the transform is applied.
    [Flags]
    public enum MsiTransformError : int
    {
        /// None of the following conditions.
        None = 0x00000000,
        /// Adding a row that already exists.
        AddExistingRow = 0x00000001,
        /// Deleting a row that doesn't exist.
        DelMissingRow = 0x00000002,
        /// Adding a table that already exists.
        AddExistingTable = 0x00000004,
        /// Deleting a table that doesn't exist.
        DelMissingTable = 0x00000008,
        /// Updating a row that doesn't exist.
        UpdateMissingRow = 0x00000010,
        /// Transform and database code pages do not match and neither code page is neutral.
        ChangeCodePage = 0x00000020,
        /// Create the temporary _TransformView table.
        ViewTransform = 0x00000100,
    }

    /// Enumeration of MSI user states.
    public enum MsiUserInfoState : int
    {
        /// return buffer overflow
        MoreData = -3,
        /// invalid function argument
        InvalidArg = -2,
        /// unrecognized product
        Unknown = -1,
        /// user info and PID not initialized
        Absent = 0,
        /// user info and PID initialized
        Present = 1,
    }

    /// Bit-flags for MSI validation.
    [Flags]
    public enum MsiValidationFlag : int
    {
        /// Validate no properties.
        None = 0x00000000,
        /// Default language must match base database.
        Language = 0x00000001,
        /// Product must match base database.
        Product = 0x00000002,
        /// Check major version only.
        MajorVersion = 0x00000008,
        /// Check major and minor versions only.
        MinorVersion = 0x00000010,
        /// Check major, minor, and update versions.
        UpdateVersion = 0x00000020,
        /// Installed version < base version.
        NewLessBaseVersion = 0x00000040,
        /// Installed version <= base version.
        NewLessEqualBaseVersion = 0x00000080,
        /// Installed version = base version.
        NewEqualBaseVersion = 0x00000100,
        /// Installed version >= base version.
        NewGreaterEqualBaseVersion = 0x00000200,
        /// Installed version > base version.
        NewGreaterBaseVersion = 0x00000400,
        /// UpgradeCode must match base database.
        UpgradeCode = 0x00000800,
    }

    /// Bit-flags of platform architectures.
    [Flags]
    public enum PlatformArchitecture : uint
    {
        /// The current platform.
        Current = 0,
        /// The x86 platform.
        X86 = 1,
        /// The ia64 platform.
        IA64 = 2,
    }

    /// Enumeration of MSI summary stream information property ids.
    public enum SummaryInformationStreamProperty : int
    {
        /// Codepage
        Codepage = 1,
        /// Title
        Title = 2,
        /// Subject
        Subject = 3,
        /// Author
        Author = 4,
        /// Keywords
        Keywords = 5,
        /// Comments
        Comments = 6,
        /// Template
        Template = 7,
        /// LastSavedBy
        LastSavedBy = 8,
        /// RevisionNumber
        RevisionNumber = 9,
        /// LastPrinted
        LastPrinted = 11,
        /// CreateTime
        CreateTime = 12,
        /// LastSaveTime
        LastSaveTime = 13,
        /// PageCount
        PageCount = 14,
        /// WordCount
        WordCount = 15,
        /// CharacterCount
        CharacterCount = 16,
        /// CreatingApplication
        CreatingApplication = 18,
        /// Security
        Security = 19,
    }

    ///
    /// Enumeration of variant types.
    ///
    public enum VariantType : uint
    {
        Empty = 0,
        Null = 1,
        I2 = 2,
        I4 = 3,
        R4 = 4,
        R8 = 5,
        Currency = 6,
        Date = 7,
        BStr = 8,
        Error = 10,
        Bool = 11,
        Variant = 12,
        Decimal = 14,
        I1 = 16,
        UI1 = 17,
        UI2 = 18,
        UI4 = 19,
        I8 = 20,
        UI8 = 21,
        Int = 22,
        UInt = 23,
        LPStr = 30,
        LPWStr = 31,
        Filetime = 64,
        Blob = 65,
        Stream = 66,
        Storage = 67,
        StreamObject = 68,
        StoredObject = 69,
        BlobObject = 70,
        ClipFormat = 71,
        CLSID = 72,
        Vector = 0x1000,
        Array = 0x2000,
        ByRef = 0x4000,
        TypeMask = 0xfff,
    }
    #endregion	Enumerations

    #region	Structures
    /// The <c>FILETIME</c> structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
    [StructLayout(LayoutKind.Sequential)]
    public struct FILETIME
    {
        /// Low-order part of the file time.
        public uint LowDateTime;
        /// High-order part of the file time.
        public uint HighDateTime;
    }
    #endregion	Structures

    #region	Delegates
    /// The <c>INSTALLUI_HANDLER</c> delegate defines a callback function that the installer calls for progress notification and error messages.
    /// <remarks>
    /// The <c>messageType</c> parameter specifies a combination of one message box style, one message box icon type, one default button, and one installation message type.
    /// </remarks>
    public delegate int MsiInstallUIHandler(IntPtr context,
        uint messageType, [MarshalAs(UnmanagedType.LPTStr)] string message);
    #endregion	Delegates

    ///
    /// Internal class supporting direct MSI API.
    /// This class cannot be inherited.
    /// This class cannot be instantiated directly.
    ///
    /// <remarks>
    /// <para>Supports the Windows Installer API 2.0.</para>
    /// <para>Note:  The following are omitted from this version:
    /// Hashing and digital signature functions.</para>
    /// <para>Please refer to the MSDN documention on the Windows Installer
    /// for more information about the Windows Installer API.</para>
    /// </remarks>
    [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)]
    sealed public class MsiInterop
    {
        #region	Constants
        private const string MSI_LIB = "msi";

        /// Maximum chars in feature name (same as string GUID)
        public const int MaxFeatureChars = 38;

        ///
        /// Type mask to extract the <see cref="MsiInstallMessage"/> in
        /// <see cref="MsiInstallUIHandler"/>s.
        ///
        public const uint MessageTypeMask = 0xff000000;

        /// Represents a "null" integer.
        public const int MsiNullInteger = Int32.MinValue;	//	0x80000000
        #endregion	Constants

        #region	Construction / Destruction
        private MsiInterop() { }
        #endregion	Construction / Destruction

        #region	Interop Methods
        #region	Installer Functions
        /// The <c>MsiAdvertiseProduct</c> function generates an advertise script or advertises a product to the computer. The <c>MsiAdvertiseProduct</c> function enables the installer to write to a script the registry and shortcut information used to assign or publish a product. The script can be written to be consistent with a specified platform by using <see cref="MsiAdvertiseProductEx"/>.
        /// <param name="path">The full path to the package of the product being advertised.</param>
        /// <param name="script">The full path to script file that will be created with the advertise information. To advertise the product locally to the computer, set <see cref="MsiAdvertiseProductFlag.MachineAssign"/> or <see cref="MsiAdvertiseProductFlag.UserAssign"/>.</param>
        /// <param name="transforms">A semicolon-delimited list of transforms to be applied. The list of transforms can be prefixed with the @ or | character to specify the secure caching of transforms. The @ prefix specifies secure-at-source transforms and the | prefix indicates secure full path transforms.  This parameter may be <c>null</c>.</param>
        /// <param name="langId">The installation language to use if the source supports multiple languages.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.CallNotImplemented"/>  This error is returned if an attempt is made to generate an advertise script on any platform other than Windows 2000 or Windows XP. Advertisement to the local computer is supported on all platforms.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiAdvertiseProduct(string path,
            string script, string transforms, UInt16 langId);

        /// The <c>MsiAdvertiseProductEx</c> function generates an advertise script or advertises a product to the computer. The <c>MsiAdvertiseProductEx</c> function enables the installer to write to a script the registry and shortcut information used to assign or publish a product. Provides the same functionality as <see cref="MsiAdvertiseProduct"/>. The script can be written to be consistent with a specified platform by using <c>MsiAdvertiseProductEx</c>.
        /// <param name="path">The full path to the package of the product being advertised.</param>
        /// <param name="script">The full path to script file that will be created with the advertise information. To advertise the product locally to the computer, set <see cref="MsiAdvertiseProductFlag.MachineAssign"/> or <see cref="MsiAdvertiseProductFlag.UserAssign"/>.</param>
        /// <param name="transforms">A semicolon-delimited list of transforms to be applied. The list of transforms can be prefixed with the @ or | character to specify the secure caching of transforms. The @ prefix specifies secure-at-source transforms and the | prefix indicates secure full path transforms.  This parameter may be <c>null</c>.</param>
        /// <param name="langId">The installation language to use if the source supports multiple languages.</param>
        /// <param name="platform">Bit flags that control for which platform the installer should create the script. This parameter is ignored if <c>script</c> is <c>null</c>. If <c>platform</c> is <see cref="PlatformArchitecture.Current"/>, then the script is created based on the current platform. This is the same functionality as <see cref="MsiAdvertiseProduct"/>. If <c>platform</c> is <see cref="PlatformArchitecture.X86"/> or <see cref="PlatformArchitecture.IA64"/>, the installer creates script for the specified platform.</param>
        /// <param name="options">Bit flags that specify extra advertisement options. Nonzero value is only available in Windows Installer versions shipped with Windows Server 2003 family and later and Windows XP Service Pack 1 and later.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.CallNotImplemented"/>  This error is returned if an attempt is made to generate an advertise script on any platform other than Windows 2000 or Windows XP. Advertisement to the local computer is supported on all platforms.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiAdvertiseProductEx(string path,
            string script, string transforms, UInt16 langId,
            PlatformArchitecture platform, MsiAdvertismentOptions options);

        /// For each product listed by the patch package as eligible to receive the patch, the MsiApplyPatch function invokes an installation and sets the PATCH property to the path of the patch package.
        /// <param name="patchPackage">A null-terminated string specifying the full path to the patch package. </param>
        /// <param name="installPackage">
        /// <para>If <c>installtype</c> is set to <see cref="MsiInstallType.NetworkImage"/>, this parameter is a null-terminated string that specifies a path to the product that is to be patched. The installer applies the patch to every eligible product listed in the patch package if <c>installPackage</c> is set to <c>null</c> and <c>installType</c> is set to <see cref="MsiInstallType.Default"/>.</para>
        /// <para>If <c>installtype</c> is <see cref="MsiInstallType.SingleInstance"/>, the installer applies the patch to the product specified by <c>installPackage</c>. In this case, other eligible products listed in the patch package are ignored and the <c>installPackage</c> parameter contains the null-terminated string representing the product code of the instance to patch. This type of installation requires the installer running Windows .NET Server 2003 family or Windows XP SP1.</para>
        /// </param>
        /// <param name="installType">
        /// <para>This parameter specifies the type of installation to patch.</para>
        /// <para><see cref="MsiInstallType.NetworkImage"/>  Specifies an administrative installation. In this case, <c>installPackage</c> must be set to a package path. A value of 1 for <see cref="MsiInstallType.NetworkImage"/> sets this for an administrative installation.</para>
        /// <para><see cref="MsiInstallType.Default"/>  Searches system for products to patch. In this case, szInstallPackage must be <c>null</c>.</para>
        /// <para><see cref="MsiInstallType.SingleInstance"/>  Patch the product specified by szInstallPackage. <c>installPackage</c> is the product code of the instance to patch. This type of installation requires the installer running Windows .NET Server 2003 family or Windows XP SP1.</para>
        /// </param>
        /// <param name="commandLine">A null-terminated string that specifies command line property settings.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.PatchPackageOpenFailed"/>  Patch package could not be opened.</para>
        /// <para><see cref="MsiError.PatchPackageInvalid"/>  The patch package is invalid.</para>
        /// <para><see cref="MsiError.PatchPackageUnsupported"/>  The patch package is not unsupported.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiApplyPatch(string patchPackage,
            string installPackage, MsiInstallType installType, string commandLine);

        /// The <c>MsiCloseAllHandles</c> function closes all open installation handles allocated by the current thread. This is a diagnostic function and should not be used for cleanup.
        /// <returns>This function returns 0 if all handles are closed. Otherwise, the function returns the number of handles open prior to its call.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB)]
        extern static public uint MsiCloseAllHandles();

        /// The <c>MsiCloseHandle</c> function closes an open installation handle.
        /// <param name="handle">Specifies any open installation handle.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid handle was passed to the function.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB)]
        extern static public MsiError MsiCloseHandle(IntPtr handle);

        /// The <c>MsiCollectUserInfo</c> function obtains and stores the user information and product ID from an installation wizard.
        /// <param name="product">Specifies the product code of the product for which the user information is collected.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiCollectUserInfo(string product);

        /// The <c>MsiConfigureFeature</c> function configures the installed state for a product feature.
        /// <param name="product">Specifies the product code for the product to be configured.</param>
        /// <param name="feature">Specifies the feature ID for the feature to be configured.</param>
        /// <param name="installState">Specifies the installation state (<see cref="MsiInstallState"/>) for the feature.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiConfigureFeature(string product,
            string feature, MsiInstallState installState);

        /// The <c>MsiConfigureProduct</c> function installs or uninstalls a product.
        /// <param name="product">Specifies the product code for the product to be configured.</param>
        /// <param name="level">Specifies how much of the product should be installed when installing the product to its default state. The <c>level</c> parameter will be ignored, and all features will be installed, if the <c>installState</c> parameter is set to any other value than <see cref="MsiInstallState.Default"/>.</param>
        /// <param name="installState">Specifies the installation state for the product.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiConfigureProduct(string product,
            MsiInstallLevel level, MsiInstallState installState);

        /// The <c>MsiConfigureProductEx</c> function installs or uninstalls a product. A product command line may also be specified.
        /// <param name="product">Specifies the product code for the product to be configured.</param>
        /// <param name="level">Specifies how much of the product should be installed when installing the product to its default state. The <c>level</c> parameter will be ignored, and all features will be installed, if the <c>installState</c> parameter is set to any other value than <see cref="MsiInstallState.Default"/>.</param>
        /// <param name="installState">Specifies the installation state for the product.</param>
        /// <param name="commandLine">Specifies the command line property settings. This should be a list of the format Property=Setting Property=Setting.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiConfigureProductEx(string product,
            MsiInstallLevel level, MsiInstallState installState, string commandLine);

        /// The <c>MsiEnableLog</c> function sets the log mode for all subsequent installations that are initiated in the calling process.
        /// <param name="logMode">Specifies the log mode.  Can be a combination of <see cref="MsiInstallLogMode"/> flags.</param>
        /// <param name="logFile">Specifies the string that holds the full path to the log file. Entering a <c>null</c> disables logging, in which case <c>logMode</c> is ignored. If a path is supplied, then <c>logMode</c> must not be zero</param>
        /// <param name="logAttributes">Specifies how frequently the log buffer is to be flushed.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnableLog(MsiInstallLogMode logMode,
            string logFile, MsiLogAttribute logAttributes);

        /// The <c>MsiEnumClients</c> function enumerates the clients for a given installed component. The function retrieves one product code each time it is called.
        /// <param name="component">Specifies the component whose clients are to be enumerated.</param>
        /// <param name="index">Specifies the index of the client to retrieve. This parameter should be zero for the first call to the <c>MsiEnumClients</c> function and then incremented for subsequent calls. Because clients are not ordered, any new client has an arbitrary index. This means that the function can return clients in any order.</param>
        /// <param name="product">Pointer to a buffer that receives the product code. This buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no clients to return.</para>
        /// <para><see cref="MsiError.NotEnoughMemory"/>  The system does not have enough memory to complete the operation. Available with Windows Server 2003 family.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  The specified component is unknown.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumClients(string component,
            uint index, string product);

        /// The <c>MsiEnumComponentQualifiers</c> function enumerates the advertised qualifiers for the given component. This function retrieves one qualifier each time it is called.
        /// <param name="component">Specifies component whose qualifiers are to be enumerated.</param>
        /// <param name="index">Specifies the index of the qualifier to retrieve. This parameter should be zero for the first call to the <c>MsiEnumComponentQualifiers</c> function and then incremented for subsequent calls. Because qualifiers are not ordered, any new qualifier has an arbitrary index. This means that the function can return qualifiers in any order.</param>
        /// <param name="qualifier">Pointer to a buffer that receives the qualifier code.</param>
        /// <param name="qualifierSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>qualifier</c> parameter. On input, this size should include the terminating <c>null</c> character. On return, the value does not include the <c>null</c> character.</param>
        /// <param name="appData">Pointer to a buffer that receives the application registered data for the qualifier. This parameter can be <c>null</c>.</param>
        /// <param name="appDataSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>appData</c> parameter. On input, this size should include the terminating <c>null</c> character. On return, the value does not include the <c>null</c> character. This parameter can be <c>null</c> only if the <c>appData</c> parameter is <c>null</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is to small to hold the requested data.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no clients to return.</para>
        /// <para><see cref="MsiError.NotEnoughMemory"/>  The system does not have enough memory to complete the operation. Available with Windows Server 2003 family.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  The specified component is unknown.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumComponentQualifiers(string component,
            uint index, string qualifier, ref uint qualifierSize,
            string appData, ref int appDataSize);

        /// The <c>MsiEnumComponents</c> function enumerates the installed components for all products. This function retrieves one component code each time it is called.
        /// <param name="index">Specifies the index of the component to retrieve. This parameter should be zero for the first call to the <c>MsiEnumComponents</c> function and then incremented for subsequent calls. Because components are not ordered, any new component has an arbitrary index. This means that the function can return components in any order.</param>
        /// <param name="component">Pointer to a buffer that receives the component code. This buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating <c>null</c> character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no clients to return.</para>
        /// <para><see cref="MsiError.NotEnoughMemory"/>  The system does not have enough memory to complete the operation. Available with Windows Server 2003 family.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumComponents(uint index, string component);

        /// The <c>MsiEnumFeatures</c> function enumerates the published features for a given product. This function retrieves one feature ID each time it is called.
        /// <param name="product">Null-terminated string specifying the product code of the product whose features are to be enumerated.</param>
        /// <param name="index">Specifies the index of the feature to retrieve. This parameter should be zero for the first call to the <c>MsiEnumFeatures</c> function and then incremented for subsequent calls. Because features are not ordered, any new feature has an arbitrary index. This means that the function can return features in any order.</param>
        /// <param name="feature">Pointer to a buffer that receives the feature ID. This parameter must be sized to hold a string of length <c><see cref="MaxFeatureChars"/> + 1</c>.</param>
        /// <param name="featureParent">Pointer to a buffer that receives the feature ID of the parent of the feature. This parameter must be sized to hold a string of length <c><see cref="MaxFeatureChars"/> + 1</c>. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no clients to return.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The specified product is unknown.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumFeatures(string product, uint index,
            string feature, string featureParent);

        /// The <c>MsiEnumPatches</c> function enumerates all of the patches that have been applied to a product. The function returns the patch code GUID for each patch that has been applied to the product and returns a list of transforms from each patch that apply to the product. Note that patches may have many transforms only some of which are applicable to a particular product. The list of transforms are returned in the same format as the value of the <c>TRANSFORMS</c> property.
        /// <param name="product">Specifies the product for which patches are to be enumerated.</param>
        /// <param name="index">Specifies the index of the patch to retrieve. This parameter should be zero for the first call to the <c>MsiEnumPatches</c> function and then incremented for subsequent calls. </param>
        /// <param name="patch">Pointer to a buffer that receives the patch's GUID. This argument is required.</param>
        /// <param name="transform">Pointer to a buffer that receives the list of transforms in the patch that are applicable to the product. This argument is required and cannot be <c>null</c>.</param>
        /// <param name="transformSize">Set to the number of characters copied to <c>transform</c> upon an unsuccessful return of the function. Not set for a successful return. On input, this is the full size of the buffer, including a space for a terminating <c>null</c> character. If the buffer passed in is too small, the count returned does not include the terminating <c>null</c> character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no clients to return.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumPatches(string product, uint index,
            string patch, string transform, ref uint transformSize);

        /// The <c>MsiEnumProducts</c> function enumerates through all the products currently advertised or installed. Both per-user and per-machine installations and advertisements are enumerated.
        /// <param name="index">Specifies the index of the product to retrieve. This parameter should be zero for the first call to the <c>MsiEnumProducts</c> function and then incremented for subsequent calls. Because products are not ordered, any new product has an arbitrary index. This means that the function can return products in any order.</param>
        /// <param name="product">Pointer to a buffer that receives the product code. This buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no clients to return.</para>
        /// <para><see cref="MsiError.NotEnoughMemory"/>  The system does not have enough memory to complete the operation. Available with Windows Server 2003 family.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumProducts(uint index, string product);

        /// The <c>MsiEnumRelatedProducts</c> function enumerates products with a specified upgrade code. This function lists the currently installed and advertised products that have the specified UpgradeCode property in their Property table.
        /// <param name="upgradeCode">The null-terminated string specifying the upgrade code of related products that the installer is to enumerate.</param>
        /// <param name="reserved">This parameter is reserved and must be 0.</param>
        /// <param name="index">The zero-based index into the registered products.</param>
        /// <param name="product">A buffer to receive the product code GUID. This buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating <c>null</c> character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no clients to return.</para>
        /// <para><see cref="MsiError.NotEnoughMemory"/>  The system does not have enough memory to complete the operation. Available with Windows Server 2003 family.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumRelatedProducts(string upgradeCode,
            uint reserved, uint index, string product);

        /// The <c>MsiGetComponentPath</c> function returns the full path to an installed component. If the key path for the component is a registry key then the registry key is returned.
        /// <param name="product">Specifies the product code for the client product.</param>
        /// <param name="component">Specifies the component ID of the component to be located.</param>
        /// <param name="path">Pointer to a variable that receives the path to the component. This parameter can be <c>null</c>. If the component is a registry key, the registry roots are represented numerically. If this is a registry subkey path, there is a backslash at the end of the Key Path. If this is a registry value key path, there is no backslash at the end. For example, a registry path of "HKEY_CURRENT_USER\SOFTWARE\Microsoft" would be returned as "01:\SOFTWARE\Microsoft\".</param>
        /// <param name="pathSize">
        /// <para>Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>path</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating <c>null</c> character.</para>
        /// <para>If <c>path</c> is <c>null</c>, <c>pathSize</c> can be <c>null</c>.</para>
        /// </param>
        /// <returns>The <see cref="MsiInstallState"/>.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallState MsiGetComponentPath(
            string product, string component, string path, ref uint pathSize);

        /// The <c>MsiGetFeatureInfo</c> function returns descriptive information for a feature.
        /// <param name="productHandle">Handle to the product that owns the feature. This handle is obtained from <see cref="MsiOpenProduct"/>.</param>
        /// <param name="feature">Specifies the feature code for the feature about which information should be returned.</param>
        /// <param name="attributes">Specifies the attribute flags.</param>
        /// <param name="title">Pointer to a buffer to receive the localized descriptive name of the feature.</param>
        /// <param name="titleSize">As input, the size of <c>title</c>. As output, the number of characters returned in <c>title</c>. On input, this is the full size of the buffer, including a space for a terminating <c>null</c> character. If the buffer passed in is too small, the count returned does not include the terminating <c>null</c> character.</param>
        /// <param name="help">Pointer to a buffer to receive the localized descriptive name of the feature.</param>
        /// <param name="helpSize">As input, the size of <c>help</c>. As output, the number of characters returned in <c>help</c>. On input, this is the full size of the buffer, including a space for a terminating <c>null</c> character. If the buffer passed in is too small, the count returned does not include the terminating <c>null</c> character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  The product handle is invalid.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  The feature is not known.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetFeatureInfo(IntPtr productHandle,
            string feature, MsiInstallFeatureAttribute attributes,
            string title, ref uint titleSize, string help, ref uint helpSize);

        /// The <c>MsiGetFeatureUsage</c> returns the usage metrics for a product feature.
        /// <param name="product">Specifies the product code for the product containing the feature.</param>
        /// <param name="feature">Specifies the feature code for the feature for which metrics are to be returned.</param>
        /// <param name="useCount">Indicates the number of times the feature has been used.</param>
        /// <param name="dateUsed">Specifies the date that the feature was last used. The date is in the MS-DOS date format.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  No usage information is available or the product or feature is invalid.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetFeatureUsage(string product, string feature,
            out uint useCount, out UInt16 dateUsed);

        /// The <c>MsiGetFileVersion</c> returns the version string and language string in the format that the installer expects to find them in the database. If you just want version information, set <c>language</c> to <c>null</c> and <c>languageSize</c> to zero. If you just want language information, set <c>version</c> to <c>null</c> and <c>versionSize</c> to zero.
        /// <param name="path">Specifies the path to the file.</param>
        /// <param name="version">Returns the file version. Set to <c>null</c> for language information only.</param>
        /// <param name="versionSize">In and out buffer byte count. Set to 0 for language information only. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.</param>
        /// <param name="language">Returns the file language. Set to <c>null</c> for version information only.</param>
        /// <param name="languageSize">In and out buffer byte count. Set to 0 for version information only. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.AccessDenied"/>  File could not be opened to get version information.</para>
        /// <para><see cref="MsiError.E_Fail"/>  Unexpected error.</para>
        /// <para><see cref="MsiError.FileInvalid"/>  File does not contain version information.</para>
        /// <para><see cref="MsiError.FileNotFound"/>  File does not exist.</para>
        /// <para><see cref="MsiError.InvalidData"/>  The version information is invalid.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetFileVersion(string path, string version,
            ref uint versionSize, string language, ref uint languageSize);

        /// The <c>MsiGetPatchInfo</c> function returns information about a patch.
        /// <param name="patch">Specifies the patch code for the patch package.</param>
        /// <param name="attribute">Specifies the attribute to be retrieved.  (See <see cref="MsiInstallerProperty.LocalPackage"/>)</param>
        /// <param name="value">Pointer to a buffer that receives the property value. This parameter can be <c>null</c>.</param>
        /// <param name="valueSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>value</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The patch package is not installed.</para>
        /// <para><see cref="MsiError.UnknownProperty"/>  The property is unrecognized.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetPatchInfo(string patch, string attribute,
            string value, ref uint valueSize);

        /// The <c>MsiGetProductCode</c> function returns the product code of an application by using the component code of an installed or advertised component of the application. During initialization, an application must determine under which product code it has been installed or advertised.
        /// <param name="component">This parameter specifies the component code of a component that has been installed by the application. This will be typically the component code of the component containing the executable file of the application.</param>
        /// <param name="product">Pointer to a buffer that receives the product code. This buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The product code could not be determined.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  The specified component is unknown.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetProductCode(string component, string product);

        /// The <c>MsiGetProductInfo</c> function returns product information for published and installed products.
        /// <param name="product">Specifies the product code for the product.</param>
        /// <param name="property">Specifies the property to be retrieved. The properties in the following list can only be retrieved from applications that are already installed. Note that required properties are guaranteed to be available, but other properties are available only if that property has been set. See the indicated links to the installer properties for information about how each property is set.</param>
        /// <param name="value">Pointer to a buffer that receives the property value. This parameter can be <c>null</c>.</param>
        /// <param name="valueSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>value</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The patch package is not installed.</para>
        /// <para><see cref="MsiError.UnknownProperty"/>  The property is unrecognized.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetProductInfo(string product, string property,
            StringBuilder value, ref uint valueSize);

        /// The <c>MsiGetProductInfoFromScript</c> function returns product information for a Windows Installer script file.
        /// <param name="scriptFile">A null-terminated string specifying the full path to the script file. The script file is the advertise script that was created by calling <see cref="MsiAdvertiseProduct"/> or <see cref="MsiAdvertiseProductEx"/>.</param>
        /// <param name="product">Points to a buffer that receives the product code. The buffer must be 39 characters long. The first 38 characters are for the product code GUID, and the last character is for the terminating null character.</param>
        /// <param name="langId">Points to a variable that receives the product language.</param>
        /// <param name="version">Points to a buffer that receives the product version. </param>
        /// <param name="name">Points to a buffer that receives the product name. The buffer includes a terminating null character.</param>
        /// <param name="nameSize">Points to a variable that specifies the size, in characters, of the buffer pointed to by the <c>name</c> parameter. This size should include the terminating null character. When the function returns, this variable contains the length of the string stored in the buffer. The count returned does not include the terminating null character. If the buffer is not large enough, the function returns <see cref="MsiError.MoreData"/>, and the variable contains the size of the string in characters, without counting the null character.</param>
        /// <param name="package">Points to a buffer that receives the package name. The buffer includes the terminating null character.</param>
        /// <param name="packageSize">Points to a variable that specifies the size, in characters, of the buffer pointed to by the <c>package</c> parameter. This size should include the terminating null character. When the function returns, this variable contains the length of the string stored in the buffer. The count returned does not include the terminating null character. If the buffer is not large enough, the function returns <see cref="MsiError.MoreData"/>, and the variable contains the size of the string in characters, without counting the null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.CallNotImplemented"/>  This function is only available on Windows 2000 and Windows XP.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  Could not get script information.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetProductInfoFromScript(string scriptFile,
            string product, ref UInt16 langId, ref uint version, string name,
            ref uint nameSize, string package, ref uint packageSize);

        /// The <c>MsiGetProductProperty</c> function retrieves product properties. These properties are in the product database.
        /// <param name="productHandle">Handle to the product obtained from <see cref="MsiOpenProduct"/>.</param>
        /// <param name="property">Specifies the property to retrieve. This is case-sensitive.</param>
        /// <param name="value">Pointer to a buffer that receives the property value. This parameter can be <c>null</c>.</param>
        /// <param name="valueSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>value</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  The product handle is invalid.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetProductProperty(IntPtr productHandle,
            string property, string value, ref uint valueSize);

        /// The <c>MsiGetShortcutTarget</c> function examines a shortcut and returns its product, feature name, and component if available.
        /// <param name="target">A null-terminated string specifying the full path to a shortcut.</param>
        /// <param name="product">A GUID for the product code of the shortcut. This string buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character. This parameter can be null.</param>
        /// <param name="feature">The feature name of the shortcut. The string buffer must be <c><see cref="MaxFeatureChars"/> + 1</c> characters long. This parameter can be null.</param>
        /// <param name="component">A GUID of the component code. This string buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character. This parameter can be null.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetShortcutTarget(string target,
            string product, string feature, string component);

        /// The <c>MsiGetUserInfo</c> function returns the registered user information for an installed product.
        /// <param name="product">Specifies the product code for the product to be queried.</param>
        /// <param name="user">Pointer to a variable that receives the name of the user.</param>
        /// <param name="userSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>user</c> parameter. This size should include the terminating null character.</param>
        /// <param name="org">Pointer to a buffer that receives the organization name.</param>
        /// <param name="orgSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>org</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.</param>
        /// <param name="serial">Pointer to a buffer that receives the product ID.</param>
        /// <param name="serialSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>serial</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.</param>
        /// <returns>The <see cref="MsiUserInfoState"/> result.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiUserInfoState MsiGetUserInfo(string product,
            string user, ref uint userSize, string org, ref uint orgSize,
            string serial, ref uint serialSize);

        /// The <c>MsiInstallMissingComponent</c> function installs files that are unexpectedly missing.
        /// <param name="product">Specifies the product code for the product that owns the component to be installed.</param>
        /// <param name="component">Identifies the component to be installed.</param>
        /// <param name="state">Specifies the way the component should be installed. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The installation failed.</para>
        /// <para><see cref="MsiError.InstallSourceAbsent"/>  The source was unavailable.</para>
        /// <para><see cref="MsiError.InstallSuspend"/>  The installation was suspended.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user exited the installation.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code is unrecognized.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiInstallMissingComponent(string product,
            string component, MsiInstallState state);

        /// The <c>MsiInstallMissingFile</c> function installs files that are unexpectedly missing.
        /// <param name="product">Specifies the product code for the product that owns the file to be installed.</param>
        /// <param name="file">Specifies the file to be installed.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The installation failed.</para>
        /// <para><see cref="MsiError.InstallSourceAbsent"/>  The source was unavailable.</para>
        /// <para><see cref="MsiError.InstallSuspend"/>  The installation was suspended.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user exited the installation.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code is unrecognized.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiInstallMissingFile(string product, string file);

        /// The MsiInstallProduct function installs or uninstalls a product.
        /// <param name="product">A null-terminated string that specifies the path to the package.</param>
        /// <param name="commandLine">A null-terminated string that specifies the command line property settings. This should be a list of the format Property=Setting Property=Setting.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiInstallProduct(string product, string commandLine);

        ///
        /// <para>The <c>MsiIsProductElevated</c> function checks whether the product is installed with elevated privileges. An application is called a "managed application" if elevated (system) privileges are used to install the application.</para>
        /// <para>Note that <c>MsiIsProductElevated</c> does not take into account policies such as AlwaysInstallElevated, but verifies that the local system owns the product's registry data.</para>
        ///
        /// <param name="product">The full product code GUID of the product. This parameter is required and may not be null or empty.</param>
        /// <param name="elevated">A pointer to a <see cref="bool"/> for the result. This may not be null.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.CallNotImplemented"/>  This function is only available on Windows 2000 and Windows XP.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiIsProductElevated(string product, out bool elevated);

        /// The <c>MsiLocateComponent</c> function returns the full path to an installed component without a product code. This function attempts to determine the product using <see cref="MsiGetProductCode"/>, but is not guaranteed to find the correct product for the caller. <see cref="MsiGetComponentPath"/> should always be called when possible.
        /// <param name="component">Specifies the component ID of the component to be located.</param>
        /// <param name="path">Pointer to a variable that receives the path to the component. The variable includes the terminating null character.</param>
        /// <param name="pathSize">
        /// <para>Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>path</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. Upon success of the <c>MsiLocateComponent</c> function, the variable pointed to by pcchBuf contains the count of characters not including the terminating null character. If the size of the buffer passed in is too small, the function returns <see cref="MsiInstallState.MoreData"/>.</para>
        /// <para>If <c>path</c> is <c>null</c>, pcchBuf can be 0.</para>
        /// </param>
        /// <returns>The <see cref="MsiInstallState"/>.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallState MsiLocateComponent(string component,
            string path, ref uint pathSize);

        /// The <c>MsiOpenPackage</c> function opens a package for use with the functions that access the product database. The <see cref="MsiCloseHandle"/> function must be called with the handle when the handle is no longer needed.
        /// <param name="path">Specifies the path to the package. </param>
        /// <param name="handle">Specifies the path to the package. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The product could not be opened.</para>
        /// <para><see cref="MsiError.InstallRemoteProhibited"/>  Windows Installer does not permit installation from a Remote Desktop Connection.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to produ MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiOpenPackage(string path, out IntPtr handle);

        /// The <c>MsiOpenPackageEx</c> function opens a package for use with functions that access the product database. The <see cref="MsiCloseHandle"/> function must be called with the handle when the handle is no longer needed.
        /// <param name="path">Specifies the path to the package.</param>
        /// <param name="options">The <see cref="MsiOpenPackageFlags"/> option.</param>
        /// <param name="handle">Pointer to a variable that receives the product handle.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The product could not be opened.</para>
        /// <para><see cref="MsiError.InstallRemoteProhibited"/>  Windows Installer does not permit installation from a Remote Desktop Connection.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiOpenPackageEx(string path, MsiOpenPackageFlags options,
            out IntPtr handle);

        /// The <c>MsiOpenProduct</c> function opens a product for use with the functions that access the product database. The <see cref="MsiCloseHandle"/> function must be called with the handle when the handle is no longer needed.
        /// <param name="product">Specifies the product code of the product to be opened.</param>
        /// <param name="handle">Pointer to a variable that receives the product handle. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The product could not be opened.</para>
        /// <para><see cref="MsiError.InstallRemoteProhibited"/>  Windows Installer does not permit installation from a Remote Desktop Connection.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiOpenProduct(string product, out IntPtr handle);

        ///
        /// <para>The <c>MsiProvideAssembly</c> function returns the full path to a Windows Installer component containing an assembly. The function prompts for a source and performs any necessary installation. <c>MsiProvideAssembly</c> increments the usage count for the feature.</para>
        /// <para>This function is available starting with Windows Installer version 2.0.</para>
        ///
        /// <param name="assembly">The assembly's name as a string.</param>
        /// <param name="context">Set to <c>null</c> for global assemblies. For private assemblies, set <c>context</c> to the full path of the application configuration file (.cfg file) or to the full path of the executable file (.exe) of the application to which the assembly has been made private.</param>
        /// <param name="mode">Defines the installation mode.</param>
        /// <param name="info">Assembly information and assembly type.</param>
        /// <param name="path">Pointer to a variable that receives the path to the component. This parameter can be <c>null</c>.</param>
        /// <param name="pathSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>path</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.FileNotFound"/>  The feature is absent or broken.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The product could not be opened.</para>
        /// <para><see cref="MsiError.InstallNotUsed"/>  The component being requested is disabled on the computer.</para>
        /// <para><see cref="MsiError.InstallSourceAbsent"/>  The source was unavailable.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// <para><see cref="MsiError.NotEnoughMemory"/>  The system does not have enough memory to complete the operation. Available with Windows Server 2003 family.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  The component ID does not specify a known component.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  The feature ID does not identify a known feature.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code does not identify a known product.</para>
        /// <para><see cref="MsiInstallState.Unknown"/>  An unrecognized product or a feature name was passed to the function.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public uint MsiProvideAssembly(string assembly, string context,
            uint mode, MsiAssemblyInfo info, string path, ref int pathSize);

        /// The <c>MsiProvideComponent</c> function returns the full component path, performing any necessary installation. This function prompts for source if necessary and increments the usage count for the feature.
        /// <param name="product">Specifies the product code for the product that contains the feature with the necessary component.</param>
        /// <param name="feature">Specifies the feature ID of the feature with the necessary component.</param>
        /// <param name="component">Specifies the component code of the necessary component.</param>
        /// <param name="mode">Defines the installation mode.</param>
        /// <param name="path">Pointer to a variable that receives the path to the component. This parameter can be <c>null</c>.</param>
        /// <param name="pathSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>path</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.FileNotFound"/>  The feature is absent or broken.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The product could not be opened.</para>
        /// <para><see cref="MsiError.InstallNotUsed"/>  The component being requested is disabled on the computer.</para>
        /// <para><see cref="MsiError.InstallSourceAbsent"/>  The source was unavailable.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  A buffer is too small to hold the requested data.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  The feature ID does not identify a known feature.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code does not identify a known product.</para>
        /// <para><see cref="MsiInstallState.Unknown"/>  An unrecognized product or a feature name was passed to the function.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public uint MsiProvideComponent(string product, string feature,
            string component, uint mode, string path, ref int pathSize);

        /// The <c>MsiProvideQualifiedComponent</c> function returns the full component path for a qualified component and performs any necessary installation. This function prompts for source if necessary, and increments the usage count for the feature.
        /// <param name="component">Specifies the component ID for the requested component. This may not be the GUID for the component itself, but rather a server that provides the correct functionality, as in the ComponentId column of the PublishComponent table.</param>
        /// <param name="qualifier">Specifies a qualifier into a list of advertising components (from PublishComponent Table).</param>
        /// <param name="mode">Defines the installation mode.</param>
        /// <param name="path">Pointer to a variable that receives the path to the component. This parameter can be <c>null</c>.</param>
        /// <param name="pathSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>path</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FileNotFound"/>  The feature is absent or broken.</para>
        /// <para><see cref="MsiError.IndexAbsent"/>  The component qualifier is invalid or absent.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  The component ID does not specify a known component.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiProvideQualifiedComponent(string component,
            string qualifier, uint mode, string path, ref int pathSize);

        /// The <c>MsiProvideQualifiedComponent</c> function returns the full component path for a qualified component and performs any necessary installation. This function prompts for source if necessary, and increments the usage count for the feature.
        /// <param name="component">Specifies the component ID for the requested component. This may not be the GUID for the component itself, but rather a server that provides the correct functionality, as in the ComponentId column of the PublishComponent table.</param>
        /// <param name="qualifier">Specifies a qualifier into a list of advertising components (from PublishComponent Table).</param>
        /// <param name="mode">Defines the installation mode.</param>
        /// <param name="product">Specifies the product to match that has published the qualified component. If this is <c>null</c>, then this API works the same as <see cref="MsiProvideQualifiedComponent"/>.</param>
        /// <param name="unused1">Reserved. Must be zero.</param>
        /// <param name="unused2">Reserved. Must be zero.</param>
        /// <param name="path">Pointer to a variable that receives the path to the component. This parameter can be <c>null</c>.</param>
        /// <param name="pathSize">Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the <c>path</c> parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FileNotFound"/>  The feature is absent or broken.</para>
        /// <para><see cref="MsiError.IndexAbsent"/>  The component qualifier is invalid or absent.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  The component ID does not specify a known component.</para>
        /// <para>An error relating to an action, see <see cref="MsiError"/>.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiProvideQualifiedComponentEx(string component,
            string qualifier, uint mode, string product, uint unused1, uint unused2,
            string path, ref int pathSize);

        /// The <c>MsiQueryFeatureState</c> function returns the installed state for a product feature.
        /// <param name="product">Specifies the product code for the product that contains the feature of interest.</param>
        /// <param name="feature">Identifies the feature of interest.</param>
        /// <returns>The <see cref="MsiInstallState"/>.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallState MsiQueryFeatureState(string product,
            string feature);

        /// The <c>MsiQueryProductState</c> function returns the installed state for a product.
        /// <param name="product">Specifies the product code for the product of interest.</param>
        /// <returns>The <see cref="MsiInstallState"/>.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallState MsiQueryProductState(string product);

        /// The <c>MsiReinstallFeature</c> function reinstalls features.
        /// <param name="product">Specifies the product code for the product containing the feature to be reinstalled.</param>
        /// <param name="feature">Identifies the feature to be reinstalled.</param>
        /// <param name="mode">Specifies what to install.  (See <see cref="MsiReinstallMode"/>.)</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The installation failed.</para>
        /// <para><see cref="MsiError.InstallServiceFailure"/>  The installation service could not be accessed.</para>
        /// <para><see cref="MsiError.InstallSuspend"/>  The installation was suspended.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user exited the installation.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  The feature ID does not identify a known feature.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code does not identify a known product.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiReinstallFeature(string product,
            string feature, MsiReinstallMode mode);

        /// The <c>MsiReinstallProduct</c> function reinstalls products.
        /// <param name="product">Specifies the product code for the product containing the feature to be reinstalled.</param>
        /// <param name="mode">Specifies what to install.  (See <see cref="MsiReinstallMode"/>.)</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The installation failed.</para>
        /// <para><see cref="MsiError.InstallServiceFailure"/>  The installation service could not be accessed.</para>
        /// <para><see cref="MsiError.InstallSuspend"/>  The installation was suspended.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user exited the installation.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  The feature ID does not identify a known feature.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code does not identify a known product.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiReinstallProduct(string product,
            MsiReinstallMode mode);

        /// The <c>MsiSetExternalUI</c> function enables an external user-interface handler. This external UI handler is called before the normal internal user-interface handler. The external UI handler has the option to suppress the internal UI by returning a non-zero value to indicate that it has handled the messages.
        /// <param name="handler">The <see cref="MsiInstallUIHandler"/> handler delegate.</param>
        /// <param name="filter">Specifies which messages to handle using the external message handler. If the external handler returns a non-zero result, then that message will not be sent to the UI, instead the message will be logged if logging has been enabled. See <see cref="MsiEnableLog"/>.</param>
        /// <param name="context">Pointer to an application context that is passed to the callback function. This parameter can be used for error checking.</param>
        /// <returns>The return value is the previously set external handler, or <c>null</c> if there was no previously set handler.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallUIHandler MsiSetExternalUI(
            [MarshalAs(UnmanagedType.FunctionPtr)]
            MsiInstallUIHandler handler, MsiInstallLogMode filter,
            IntPtr context);

        /// The <c>MsiSetInternalUI</c> function enables the installer's internal user interface. Then this user interface is used for all subsequent calls to user-interface-generating installer functions in this process.
        /// <param name="level">Specifies the level of complexity of the user interface.</param>
        /// <param name="parentWindow">Pointer to a window. This window becomes the owner of any user interface created. A pointer to the previous owner of the user interface is returned. If this parameter is <c>null</c>, the owner of the user interface does not change.</param>
        /// <returns>The previous user interface level is returned. If an invalid <c>level</c> is passed, then <see cref="MsiInstallUILevel.NoChange"/> is returned.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallUILevel MsiSetInternalUI(MsiInstallUILevel level,
            ref IntPtr parentWindow);

        /// The <c>MsiSourceListAddSource</c> function adds to the list of valid network sources in the source list.
        /// <param name="product">Specifies the product code.</param>
        /// <param name="user">User name for per-user installation; null or empty string for per-machine installation. On Windows NT, Windows 2000, or Windows XP, the user name should always be in the format of DOMAIN\USERNAME (or MACHINENAME\USERNAME for a local user).</param>
        /// <param name="reserved">Reserved for future use. This value must be set to 0.</param>
        /// <param name="source">Pointer to the string specifying the source.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.AccessDenied"/>  The user does not have the ability to add a source.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.BadUserName"/>  Could not resolve the user name.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InstallServiceFailure"/>  The installation service could not be accessed.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code does not identify a known product.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSourceListAddSource(string product,
            string user, uint reserved, string source);

        /// The <c>MsiSourceListClearAll</c> function removes all network sources from the source list.
        /// <param name="product">Specifies the product code.</param>
        /// <param name="user">User name for per-user installation; null or empty string for per-machine installation. On Windows NT, Windows 2000, or Windows XP, the user name should always be in the format of DOMAIN\USERNAME (or MACHINENAME\USERNAME for a local user).</param>
        /// <param name="reserved">Reserved for future use. This value must be set to 0.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.AccessDenied"/>  The user does not have the ability to add a source.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.BadUserName"/>  Could not resolve the user name.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InstallServiceFailure"/>  The installation service could not be accessed.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code does not identify a known product.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSourceListClearAll(string product,
            string user, uint reserved);

        /// The <c>MsiSourceListForceResolution</c> function forces the installer to search the source list for a valid product source the next time a source is needed. For example, when the installer performs an installation or reinstallation, or when it needs the path for a component that is set to run from source.
        /// <param name="product">Specifies the product code.</param>
        /// <param name="user">User name for per-user installation; null or empty string for per-machine installation. On Windows NT, Windows 2000, or Windows XP, the user name should always be in the format of DOMAIN\USERNAME (or MACHINENAME\USERNAME for a local user).</param>
        /// <param name="reserved">Reserved for future use. This value must be set to 0.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.AccessDenied"/>  The user does not have the ability to add a source.</para>
        /// <para><see cref="MsiError.BadConfiguration"/>  The configuration data is corrupt.</para>
        /// <para><see cref="MsiError.BadUserName"/>  Could not resolve the user name.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InstallServiceFailure"/>  The installation service could not be accessed.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownProduct"/>  The product code does not identify a known product.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSourceListForceResolution(string product,
            string user, uint reserved);

        /// The <c>MsiUseFeature</c> function increments the usage count for a particular feature and indicates the installation state for that feature. This function should be used to indicate an application's intent to use a feature.
        /// <param name="product">Specifies the product code for the product that owns the feature to be used.</param>
        /// <param name="feature">Identifies the feature to be used.</param>
        /// <returns>The <see cref="MsiInstallState"/>.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallState MsiUseFeature(string product, string feature);

        /// The <c>MsiUseFeatureEx</c> function increments the usage count for a particular feature and indicates the installation state for that feature. This function should be used to indicate an application's intent to use a feature.
        /// <param name="product">Specifies the product code for the product that owns the feature to be used.</param>
        /// <param name="feature">Identifies the feature to be used.</param>
        /// <param name="mode">This can be <see cref="MsiInstallMode.NoDetection"/>.</param>
        /// <param name="reserved">Reserved for future use. This value must be set to 0. </param>
        /// <returns>The <see cref="MsiInstallState"/>.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiInstallState MsiUseFeatureEx(string product, string feature,
            MsiInstallMode mode, uint reserved);

        /// The <c>MsiVerifyPackage</c> function verifies that the given file is an installation package.
        /// <param name="path">Specifies the path and file name of the package.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The file is a package.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.PatchPackageInvalid"/>  The file is not a valid package.</para>
        /// <para><see cref="MsiError.PatchPackageOpenFailed"/>  The file could not be opened.</para>
        /// </returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiVerifyPackage(string path);
        #endregion	Installer Functions

        #region	Database Functions
        /// The <c>MsiCreateRecord</c> function creates a new record object with the specified number of fields. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="count">Specifies the number of fields the record will have. The maximum number of fields in a record is limited to 65535.</param>
        /// <returns>
        /// <para>If the function succeeds, the return value is handle to a new record object.</para>
        /// <para>If the function fails, the return value is <c>IntPtr.Zero</c>.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB)]
        extern static public IntPtr MsiCreateRecord(uint count);

        /// The <c>MsiCreateTransformSummaryInfo</c> function creates summary information of an existing transform to include validation and error conditions. Execution of this function sets the error record, accessible through <see cref="MsiGetLastErrorRecord"/>.
        /// <param name="database">Handle to the database that contains the new database Summary Information.</param>
        /// <param name="databaseRef">Handle to the database that contains the original Summary Information.</param>
        /// <param name="transformFile">The name of the transform to which the Summary Information is added.</param>
        /// <param name="errorConditions">The error conditions that should be suppressed when the transform is applied.</param>
        /// <param name="validation">Specifies those properties to be validated to verify the transform can be applied to the database.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InstallPackageInvalid"/>  Reference to an invalid Windows Installer package.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.OpenFailed"/>  The transform storage file could not be opened.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiCreateTransformSummaryInfo(IntPtr database,
            IntPtr databaseRef, string transformFile, MsiTransformError errorConditions,
            MsiValidationFlag validation);

        /// The <c>MsiDatabaseApplyTransform</c> function applies a transform to a database.
        /// <param name="database">Handle to the database obtained from <see cref="MsiOpenDatabase"/> to the transform.</param>
        /// <param name="transformFile">Specifies the name of the transform file to apply.</param>
        /// <param name="errorConditions">Error conditions that should be suppressed.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InstallTransformFailure"/>  Reference to an invalid Windows Installer package.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.OpenFailed"/>  The transform storage file could not be opened.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseApplyTransform(IntPtr database,
            string transformFile, MsiTransformError errorConditions);

        /// The <c>MsiDatabaseCommit</c> function commits changes to a database.
        /// <param name="database">Handle to the database obtained from <see cref="MsiOpenDatabase"/>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseCommit(IntPtr database);

        /// The <c>MsiDatabaseExport</c> function exports an installer table from an open database to a text archive file.
        /// <param name="database">Handle to the database obtained from <see cref="MsiOpenDatabase"/>.</param>
        /// <param name="table">Specifies the name of the table to export.</param>
        /// <param name="folder">Specifies the name of the folder that contains archive files.</param>
        /// <param name="fileName">Specifies the name of the exported table archive file.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadPathName"/>  An invalid path was passed to the function.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseExport(IntPtr database,
            string table, string folder, string fileName);

        /// The <c>MsiDatabaseGenerateTransform</c> function generates a transform file of differences between two databases. A transform is a way of recording changes to a database without altering the original database. You can also use <c>MsiDatabaseGenerateTransform</c> to test whether two databases are identical without creating a transform.
        /// <param name="database">Handle to the database obtained from <see cref="MsiOpenDatabase"/> that includes the changes.</param>
        /// <param name="databaseRef">Handle to the database obtained from <see cref="MsiOpenDatabase"/> that does not include the changes.</param>
        /// <param name="transformFile">A null-terimated string specifying the name of the transform file being generated. This parameter can be <c>null</c>. If <c>transformFile</c> is <c>null</c>, you can use <c>MsiDatabaseGenerateTransform</c> to test whether two databases are identical without creating a transform. If the databases are identical, the function returns <see cref="MsiError.NoData"/>. If the databases are different the function returns <see cref="MsiError.NoError"/>.</param>
        /// <param name="reserved1">This is a reserved argument and must be set to 0.</param>
        /// <param name="reserved2">This is a reserved argument and must be set to 0.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.CreateFailed"/>  The storage for the transform file could not be created.</para>
        /// <para><see cref="MsiError.NoData"/>  If <c>transformFile</c> is <c>null</c>, this value is returned if the two databases are identical. No transform file is generated.</para>
        /// <para><see cref="MsiError.NoError"/>  If <c>transformFile</c> is <c>null</c>, this is returned if the two databases are different.</para>
        /// <para><see cref="MsiError.InstallTransformFailure"/>  The transform could not be generated.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseGenerateTransform(IntPtr database,
            IntPtr databaseRef, string transformFile, int reserved1, int reserved2);

        /// The <c>MsiDatabaseGetPrimaryKeys</c> function returns a record containing the names of all the primary key columns for a specified table. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="database">Handle to the database.</param>
        /// <param name="table">Specifies the name of the table from which to obtain primary key names.</param>
        /// <param name="record">Pointer to the handle of the record that holds the primary key names.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.InvalidTable"/>  An invalid table was passed to the function.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseGetPrimaryKeys(IntPtr database,
            string table, out IntPtr record);

        /// The <c>MsiDatabaseImport</c> function imports an installer text archive table into an open database.
        /// <param name="database">Handle to the database obtained from <see cref="MsiOpenDatabase"/>.</param>
        /// <param name="folder">Specifies the path to the folder containing archive files.</param>
        /// <param name="fileName">Specifies the name of the file to import.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadPathName"/>  An invalid path was passed to the function.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseImport(IntPtr database,
            string folder, string fileName);

        /// The <c>MsiDatabaseIsTablePersistent</c> function returns an enumeration describing the state of a particular table.
        /// <param name="database">Handle to the database to which the relevant table belongs.</param>
        /// <param name="table">Specifies the name of the relevant table.</param>
        /// <returns>The <see cref="MsiCondition"/> of the table.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiCondition MsiDatabaseIsTablePersistent(IntPtr database,
            string table);

        /// The <c>MsiDatabaseMerge</c> function merges two databases together, allowing duplicate rows.
        /// <param name="database">Handle to the database obtained from <see cref="MsiOpenDatabase"/>.</param>
        /// <param name="merge">Handle to the database obtained from <see cref="MsiOpenDatabase"/> to merge into the base database.</param>
        /// <param name="table">Specifies the name of the table to receive merge conflict information.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.DatatypeMismatch"/>  Schema difference between the two databases.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidTable"/>  An invalid table was passed to the function.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseMerge(IntPtr database,
            IntPtr merge, string table);

        /// The <c>MsiDatabaseOpenView</c> function prepares a database query and creates a view object. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="database">Handle to the database to which you want to open a view object.</param>
        /// <param name="query">Specifies a SQL query string for querying the database.</param>
        /// <param name="view">Pointer to a handle for the returned view.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadQuerySyntax"/>  An invalid SQL query string was passed to the function.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDatabaseOpenView(IntPtr database,
            string query, out IntPtr view);

        /// The MsiDoAction function executes a built-in action, custom action, or user-interface wizard action.
        /// <param name="database">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>. </param>
        /// <param name="action">Specifies the action to execute.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.FunctionNotCalled"/>  The action was not found.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The action failed.</para>
        /// <para><see cref="MsiError.InstallSuspend"/>  The user suspended the installation.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user canceled the action.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  The action indicates that the remaining actions should be skipped.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiDoAction(IntPtr database, string action);

        /// The <c>MsiEnableUIPreview</c> function enables preview mode of the user interface to facilitate authoring of user-interface dialog boxes. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="database">Handle to the database.</param>
        /// <param name="preview">Pointer to a returned handle for user-interface preview capability.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.OutOfMemory"/>  Out of memory.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnableUIPreview(IntPtr database,
            out IntPtr preview);

        /// The <c>MsiEnumComponentCosts</c> function enumerates the disk-space per drive required to install a component. This information is needed to display the disk-space cost required for all drives in the user interface. The returned disk-space costs are expressed in multiples of 512 bytes.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="component">A null-terminated string specifying the component's name as it is listed in the Component column of the Component table. This parameter can be <c>null</c>. If <c>component</c> is <c>null</c> or an empty string, <c>MsiEnumComponentCosts</c> enumerates the total disk-space per drive used during the installation. In this case, <c>state</c> is ignored. The costs of the installer include those costs for caching the database in the secure folder as well as the cost to create the installation script. Note that the total disk-space used during the installation may be larger than the space used after the component is installed.</param>
        /// <param name="index">0-based index for drives. This parameter should be zero for the first call to the <c>MsiEnumComponentCosts</c> function and then incremented for subsequent calls.</param>
        /// <param name="state">Requested component state to be enumerated. If <c>component</c> is passed as <c>null</c> or an empty string, the installer ignores the <c>state</c> parameter.</param>
        /// <param name="drive">Buffer that holds the drive name including the null terminator. This is an empty string in case of an error.</param>
        /// <param name="driveSize">Pointer to a variable that specifies the size, in TCHARs, of the buffer pointed to by the <c>drive</c> parameter. This size should include the terminating null character. If the buffer provided is too small, the variable pointed to by <c>driveSize</c> contains the count of characters not including the null terminator.</param>
        /// <param name="cost">Cost of the component per drive expressed in multiples of 512 bytes. This value is 0 if an error has occurred. The value returned in <c>cost</c> is final disk-space used by the component after installation. If <c>component</c> is passed as <c>null</c> or an empty string, the installer sets the value at <c>cost</c> to 0.</param>
        /// <param name="tempCost">The component cost per drive for the duration of the installation, or 0 if an error occurred. The value in <c>tempCost</c> represents the temporary space requirements for the duration of the installation. This temporary space requirement is space needed only for the duration of the installation. This does not affect the final disk space requirement.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionNotCalled"/>  Costing is not complete.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  Buffer not large enough for the drive name.</para>
        /// <para><see cref="MsiError.NoMoreItems"/>  There are no more drives to return.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  The component is missing.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiEnumComponentCosts(IntPtr install,
            string component, uint index, MsiInstallState state, string drive,
            ref uint driveSize, out int cost, out int tempCost);

        /// The <c>MsiEvaluateCondition</c> function evaluates a conditional expression containing property names and values.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="condition">Specifies the conditional expression. This parameter must not be <c>null</c>.</param>
        /// <returns>The <see cref="MsiCondition"/>.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiCondition MsiEvaluateCondition(IntPtr install,
            string condition);

        /// The <c>MsiFormatRecord</c> function formats record field data and properties using a format string.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="record">Handle to the record to format. The template string must be stored in record field 0 followed by referenced data parameters.</param>
        /// <param name="result">Pointer to the buffer that receives the null terminated formatted string. Do not attempt to determine the size of the buffer by passing in a <c>null</c> for <c>result</c>. You can get the size of the buffer by passing in an empty string (for example ""). The function will then return <see cref="MsiError.MoreData"/> and <c>resultSize</c> will contain the required buffer size in TCHARs, not including the terminating null character. On return of <see cref="MsiError.Success"/>, <c>resultSize</c> contains the number of TCHARs written to the buffer, not including the terminating null character.</param>
        /// <param name="resultSize">Pointer to the variable that specifies the size, in TCHARs, of the buffer pointed to by the variable <c>result</c>. When the function returns <see cref="MsiError.Success"/>, this variable contains the size of the data copied to <c>result</c>, not including the terminating null character. If <c>result</c> is not large enough, the function returns <see cref="MsiError.MoreData"/> and stores the required size, not including the terminating null character, in the variable pointed to by <c>resultSize</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  Buffer not large enough for the drive name.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiFormatRecord(IntPtr install, IntPtr record,
            string result, ref uint resultSize);

        /// The <c>MsiGetActiveDatabase</c> function returns the active database for the installation. This function returns a read-only handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <returns>If the function succeeds, it returns a read-only handle to the database currently in use by the installer. If the function fails, the function returns <c>IntPtr.Zero</c>.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public IntPtr MsiGetActiveDatabase(IntPtr install);

        /// The <c>MsiGetComponentState</c> function obtains the state of a component.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="component">A null-terminated string specifying the component name within the product.</param>
        /// <param name="state">Receives the current installed state.</param>
        /// <param name="action">Receives the action taken during the installation.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  An unknown component was requested.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetComponentState(IntPtr install,
            string component, out MsiInstallState state, out MsiInstallState action);

        /// The <c>MsiGetDatabaseState</c> function returns the state of the database.
        /// <param name="database">Handle to the database obtained from <see cref="MsiOpenDatabase"/>.</param>
        /// <returns>The <see cref="MsiDbState"/>.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiDbState MsiGetDatabaseState(IntPtr database);

        /// The <c>MsiGetFeatureCost</c> function returns the disk space required by a feature and its selected children and parent features.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="feature">Specifies the name of the feature.</param>
        /// <param name="costTree">Specifies the value the function uses to determine disk space requirements.</param>
        /// <param name="state">Specifies the installation state.</param>
        /// <param name="cost">Receives the disk space requirements in units of 512 bytes. This parameter must not be null.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  An unknown feature was requested.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetFeatureCost(IntPtr install, string feature,
            MsiCostTree costTree, MsiInstallState state, out int cost);

        /// The <c>MsiGetFeatureState</c> function gets the requested state of a feature.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="feature">Specifies the feature name within the product.</param>
        /// <param name="state">Receives the current installed state.</param>
        /// <param name="action">Receives the action taken during the installation.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  An unknown feature was requested.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetFeatureState(IntPtr install,
            string feature, out MsiInstallState state, out MsiInstallState action);

        /// The <c>MsiGetFeatureValidStates</c> function returns a valid installation state.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="feature">Specifies the feature name within the product.</param>
        /// <param name="state">Receives the location to hold the valid installation states.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  An unknown feature was requested.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetFeatureValidStates(IntPtr install,
            string feature, out MsiFeatureInstallState state);

        /// The <c>MsiGetLanguage</c> function returns the numeric language of the installation that is currently running.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <returns>If the function succeeds, the return value is the numeric LANGID for the install.  Can be <see cref="MsiError.InvalidHandle"/> if the function fails, or zero if the installation is not running.</returns>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public UInt16 MsiGetLanguage(IntPtr install);

        /// The <c>MsiGetLastErrorRecord</c> function returns the error record that was last returned for the calling process. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <returns>A handle to the error record. If the last function was successful, <c>MsiGetLastErrorRecord</c> returns an <c>IntPtr.Zero</c>.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public IntPtr MsiGetLastErrorRecord();

        /// The <c>MsiGetMode</c> function is used to determine whether the installer is currently running in a specified mode.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="mode">Specifies the run mode.</param>
        /// <returns><c>true</c> if the mode matches requested,</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public bool MsiGetMode(IntPtr install, MsiRunMode mode);

        /// The MsiGetProperty function gets the value for an installer property.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="name">A null-terminated string that specifies the name of the property.</param>
        /// <param name="value">Pointer to the buffer that receives the null terminated string containing the value of the property. Do not attempt to determine the size of the buffer by passing in a <c>null</c> for <c>value</c>. You can get the size of the buffer by passing in an empty string (for example ""). The function will then return <see cref="MsiError.MoreData"/> and <c>valueSize</c> will contain the required buffer size in TCHARs, not including the terminating null character. On return of <see cref="MsiError.Success"/>, <c>valueSize</c> contains the number of TCHARs written to the buffer, not including the terminating null character.</param>
        /// <param name="valueSize">Pointer to the variable that specifies the size, in TCHARs, of the buffer pointed to by the variable <c>value</c>. When the function returns <see cref="MsiError.Success"/>, this variable contains the size of the data copied to <c>value</c>, not including the terminating null character. If <c>value</c> is not not large enough, the function returns <see cref="MsiError.MoreData"/> and stores the required size, not including the terminating null character, in the variable pointed to by <c>valueSize</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  The provided buffer was too small to hold the entire value.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetProperty(IntPtr install, string name,
            string value, ref uint valueSize);

        /// The <c>MsiGetSourcePath</c> function returns the full source path for a folder in the Directory table.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="folder"> null-terminated string that specifies a record of the Directory table. If the directory is a root directory, this can be a value from the DefaultDir column. Otherwise it must be a value from the Directory column.</param>
        /// <param name="path">Pointer to the buffer that receives the null terminated full source path. Do not attempt to determine the size of the buffer by passing in a <c>null</c> for <c>path</c>. You can get the size of the buffer by passing in an empty string (for example ""). The function will then return <see cref="MsiError.MoreData"/> and <c>pathSize</c> will contain the required buffer size in TCHARs, not including the terminating null character. On return of <see cref="MsiError.Success"/>, <c>pathSize</c> contains the number of TCHARs written to the buffer, not including the terminating null character.</param>
        /// <param name="pathSize">Pointer to the variable that specifies the size, in TCHARs, of the buffer pointed to by the variable <c>path</c>. When the function returns <see cref="MsiError.Success"/>, this variable contains the size of the data copied to <c>path</c>, not including the terminating null character. If <c>path</c> is not large enough, the function returns <see cref="MsiError.MoreData"/> and stores the required size, not including the terminating null character, in the variable pointed to by <c>pathSize</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.Directory"/>  The directory specified was not found in the Directory table.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  The provided buffer was too small to hold the entire value.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetSourcePath(IntPtr install, string folder,
            string path, ref uint pathSize);

        /// The <c>MsiGetSummaryInformation</c> function obtains a handle to the _SummaryInformation stream for an installer database. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="path">Specifies the path to the database. </param>
        /// <param name="updateCount">Specifies the maximum number of updated values.</param>
        /// <param name="summaryInfo">Pointer to the location from which to receive the summary information handle.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InstallPackageInvalid"/>  The installation package is invalid.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetSummaryInformation(IntPtr install,
            string path, uint updateCount, out IntPtr summaryInfo);

        /// The <c>MsiGetTargetPath</c> function returns the full target path for a folder in the Directory table.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="folder"> null-terminated string that specifies a record of the Directory table. If the directory is a root directory, this can be a value from the DefaultDir column. Otherwise it must be a value from the Directory column.</param>
        /// <param name="path">Pointer to the buffer that receives the null terminated full source path. Do not attempt to determine the size of the buffer by passing in a <c>null</c> for <c>path</c>. You can get the size of the buffer by passing in an empty string (for example ""). The function will then return <see cref="MsiError.MoreData"/> and <c>pathSize</c> will contain the required buffer size in TCHARs, not including the terminating null character. On return of <see cref="MsiError.Success"/>, <c>pathSize</c> contains the number of TCHARs written to the buffer, not including the terminating null character.</param>
        /// <param name="pathSize">Pointer to the variable that specifies the size, in TCHARs, of the buffer pointed to by the variable <c>path</c>. When the function returns <see cref="MsiError.Success"/>, this variable contains the size of the data copied to <c>path</c>, not including the terminating null character. If <c>path</c> is not large enough, the function returns <see cref="MsiError.MoreData"/> and stores the required size, not including the terminating null character, in the variable pointed to by <c>pathSize</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.Directory"/>  The directory specified was not found in the Directory table.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  The provided buffer was too small to hold the entire value.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiGetTargetPath(IntPtr install, string folder,
            string path, ref uint pathSize);

        /// The <c>MsiOpenDatabase</c> function opens a database file for data access. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="path">Specifies the full path or relative path to the database file.</param>
        /// <param name="persist">Receives the full path to the file or the persistence mode.  You can use one of the constants from <see cref="T:WindowsInstaller.MsiDbOpenPersistMode"/>.</param>
        /// <param name="handle">Pointer to the location of the returned database handle.</param>
        /// <returns>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiOpenDatabase(string path, MsiDbPersistMode persist,
            out IntPtr handle);

        /// The <c>MsiPreviewBillboard</c> function displays a billboard with the host control in the displayed dialog box.
        /// <param name="preview">Handle to the preview.</param>
        /// <param name="name">Specifies the name of the host control.</param>
        /// <param name="billboard">Specifies the name of the billboard to display.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiPreviewBillboard(IntPtr preview,
            string name, string billboard);

        /// The <c>MsiPreviewDialog</c> function displays a dialog box as modeless and inactive.
        /// <param name="preview">Handle to the preview.</param>
        /// <param name="dialog">Specifies the name of the dialog box to preview.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.FunctionNotCalled"/>  The function was not called.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The action failed.</para>
        /// <para><see cref="MsiError.InstallSuspend"/>  The user suspended the installation.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user canceled the action.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiPreviewDialog(IntPtr preview,
            string dialog);

        /// The <c>MsiProcessMessage</c> function sends an error record to the installer for processing.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="type">The <see cref="MsiInstallMessage"/>.</param>
        /// <param name="record">Handle to a record containing message format and data.</param>
        /// <returns>
        /// <para>-1 An invalid parameter or handle was supplied.</para>
        /// <para>0 No action was taken.</para>
        /// <para>A <see cref="DialogResult"/>.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public int MsiProcessMessage(IntPtr install,
            MsiInstallMessage type, IntPtr record);

        /// The <c>MsiRecordClearData</c> function sets all fields in a record to <c>null</c>.
        /// <param name="record">Handle to the record.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiRecordClearData(IntPtr record);

        /// The <c>MsiRecordDataSize</c> function returns the length of a record field. The count does not include the terminating null character.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <returns>
        /// <para>The <c>MsiRecordDataSize</c> function returns 0 if the field is null, nonexistent, or an internal object pointer. The function also returns 0 if the handle is not a valid record handle.</para>
        /// <para>If the data is in integer format, the function returns sizeof(int).</para>
        /// <para>If the data is in string format, the function returns the character count (not including the null character).</para>
        /// <para>If the data is in stream format, the function returns the byte count.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public uint MsiRecordDataSize(IntPtr record, uint field);

        /// The <c>MsiRecordGetFieldCount</c> function returns the number of fields in a record.
        /// <param name="record">Handle to the record.</param>
        /// <returns>The count returned by the <c>MsiRecordGetFieldCount</c> parameter does not include field 0. Read access to fields beyond this count returns null values. Write access fails.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public uint MsiRecordGetFieldCount(IntPtr record);

        /// The <c>MsiRecordGetInteger</c> function returns the integer value from a record field.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <returns>The MsiRecordGetInteger function returns <see cref="MsiNullInteger"/> if the field is null or if the field is a string that cannot be converted to an integer.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public int MsiRecordGetInteger(IntPtr record, uint field);

        /// The <c>MsiRecordGetString</c> function returns the string value of a record field.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <param name="value">Pointer to the buffer that receives the null terminated string containing the value of the record field. Do not attempt to determine the size of the buffer by passing in a <c>null</c> for <c>value</c>. You can get the size of the buffer by passing in an empty string (for example ""). The function will then return <see cref="MsiError.MoreData"/> and <c>valueSize</c> will contain the required buffer size in TCHARs, not including the terminating null character. On return of <see cref="MsiError.Success"/>, <c>valueSize</c> contains the number of TCHARs written to the buffer, not including the terminating null character.</param>
        /// <param name="valueSize">Pointer to the variable that specifies the size, in TCHARs, of the buffer pointed to by the variable <c>value</c>. When the function returns <see cref="MsiError.Success"/>, this variable contains the size of the data copied to <c>value</c>, not including the terminating null character. If <c>value</c> is not large enough, the function returns <see cref="MsiError.MoreData"/> and stores the required size, not including the terminating null character, in the variable pointed to by <c>valueSize</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  The provided buffer was too small to hold the entire value.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiRecordGetString(IntPtr record, uint field,
            StringBuilder value, ref uint valueSize);

        /// The <c>MsiRecordIsNull</c> function reports whether a record field is <c>null</c>.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <returns><c>true</c>, if the function succeeded and the field is null or the field does not exist; otherwise, The function succeeded and the field is not null or the record handle is invalid.</returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public bool MsiRecordIsNull(IntPtr record, uint field);

        /// The <c>MsiRecordReadStream</c> function reads bytes from a record stream field into a buffer.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <param name="buffer">A buffer to receive the stream field. You should ensure the destination buffer is the same size or larger than the source buffer.</param>
        /// <param name="bufferSize">Specifies the in and out buffer count. On input, this is the full size of the buffer. On output, this is the number of bytes that were actually written to the buffer.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidDataType"/>  The field is not a stream column.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiRecordReadStream(IntPtr record, uint field,
            string buffer, ref uint bufferSize);

        /// The MsiRecordSetInteger function sets a record field to an integer field.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <param name="value">Specifies the value to which to set the field.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidField"/>  An invalid field of the record was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiRecordSetInteger(IntPtr record, uint field,
            int value);

        /// The <c>MsiRecordSetStream</c> function sets a record stream field from a file. Stream data cannot be inserted into temporary fields.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <param name="path">Specifies the path to the file containing the stream.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.BadPathName"/>  An invalid path was supplied.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiRecordSetStream(IntPtr record, uint field,
            string path);

        /// The <c>MsiRecordSetString</c> function copies a string into the designated field.
        /// <param name="record">Handle to the record.</param>
        /// <param name="field">Specifies a field of the record.</param>
        /// <param name="value">Specifies the string value of the field.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiRecordSetString(IntPtr record, uint field,
            string value);

        /// The <c>MsiSequence</c> function executes another action sequence, as described in the specified table.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="table">Specifies the name of the table containing the action sequence.</param>
        /// <param name="mode">This parameter is currently unimplemented. It is reserved for future use and must be 0.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.FunctionNotCalled"/>  The function was not called.</para>
        /// <para><see cref="MsiError.InstallFailure"/>  The action failed.</para>
        /// <para><see cref="MsiError.InstallSuspend"/>  The user suspended the installation.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user canceled the action.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSequence(IntPtr install, string table,
            int mode);

        /// The <c>MsiSetComponentState</c> function sets a component to the requested state.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="component">Specifies the name of the component.</param>
        /// <param name="state">Specifies the state to set.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InstallUserExit"/>  The user canceled the action.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.UnknownComponent"/>  An unknown component was requested.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSetComponentState(IntPtr install, string component,
            MsiInstallState state);

        /// The <c>MsiSetFeatureAttributes</c> function can modify the default attributes of a feature at runtime. Note that the default attributes of features are authored in the Attributes column of the Feature table.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="feature">Specifies the feature name within the product.</param>
        /// <param name="attributes">Feature attributes specified at run time.  (Bit flags)</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  The feature is not known.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSetFeatureAttributes(IntPtr install,
            string feature, MsiInstallFeatureAttribute attributes);

        /// The <c>	MsiSetFeatureState</c> function sets a feature to a specified state.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="feature">Specifies the feature name within the product.</param>
        /// <param name="state">Specifies the state to set.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownFeature"/>  The feature is not known.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSetFeatureState(IntPtr install, string feature,
            MsiInstallState state);

        /// The <c>MsiSetInstallLevel</c> function sets the installation level for a full product installation.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="level">Specifies the installation level.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSetInstallLevel(IntPtr install, int level);

        /// The <c>MsiSetMode</c> function sets an internal engine Boolean state.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="mode">The <see cref="MsiRunMode"/>.  Only <see cref="MsiRunMode.RebootAtEnd"/> and <see cref="MsiRunMode.RebootNow"/> are supported.</param>
        /// <param name="state">Specifies the state to set to <c>true</c> or <c>false</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.AccessDenied"/>  Access was denied.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSetMode(IntPtr install, MsiRunMode mode,
            bool state);

        /// The <c>MsiSetProperty</c> function sets the value for an installation property.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="name">Specifies the name of the property.</param>
        /// <param name="value">Specifies the value of the property.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSetProperty(IntPtr install, string name,
            string value);

        /// The <c>MsiSetTargetPath</c> function sets the full target path for a folder in the Directory table.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <param name="folder">Specifies the folder identifier. This is a primary key in the Directory table.</param>
        /// <param name="path">Specifies the full path for the folder, ending in a directory separator.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.Directory"/>  The directory specified was not found in the Directory table.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSetTargetPath(IntPtr install, string folder,
            string path);

        /// The <c>MsiSummaryInfoGetProperty</c> function gets a single property from the summary information.
        /// <param name="summaryInfo">Handle to summary information.</param>
        /// <param name="id">Specifies the property ID.</param>
        /// <param name="type">Receives the returned property type.</param>
        /// <param name="intValue">Receives the returned integer property data.</param>
        /// <param name="fileTime">Pointer to a file value.</param>
        /// <param name="value">Pointer to the buffer that receives the null terminated summary information property value. Do not attempt to determine the size of the buffer by passing in a <c>null</c> for <c>value</c>. You can get the size of the buffer by passing in an empty string (for example ""). The function will then return <see cref="MsiError.MoreData"/> and <c>valueSize</c> will contain the required buffer size in TCHARs, not including the terminating null character. On return of <see cref="MsiError.Success"/>, <c>valueSize</c> contains the number of TCHARs written to the buffer, not including the terminating null character. This parameter is an empty string if there are no errors.</param>
        /// <param name="valueSize">Pointer to the variable that specifies the size, in TCHARs, of the buffer pointed to by the variable <c>value</c>. When the function returns <see cref="MsiError.Success"/>, this variable contains the size of the data copied to <c>value</c>, not including the terminating null character. If <c>value</c> is not large enough, the function returns <see cref="MsiError.MoreData"/> and stores the required size, not including the terminating null character, in the variable pointed to by <c>valueSize</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.MoreData"/>  The buffer passed in was too small to hold the entire value. </para>
        /// <para><see cref="MsiError.UnknownProperty"/>  The property is unknown.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSummaryInfoGetProperty(IntPtr summaryInfo,
            uint id, out VariantType type, out int intValue, out FILETIME fileTime,
            string value, ref int valueSize);

        /// The <c>MsiSummaryInfoGetPropertyCount</c> function returns the number of existing properties in the summary information stream.
        /// <param name="summaryInfo">Handle to summary information.</param>
        /// <param name="count">Location to receive the total property count.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSummaryInfoGetPropertyCount(IntPtr summaryInfo,
            out int count);

        /// The <c>MsiSummaryInfoPersist</c> function writes changed summary information back to the summary information stream.
        /// <param name="summaryInfo">Handle to summary information.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSummaryInfoPersist(IntPtr summaryInfo);

        /// The <c>MsiSummaryInfoSetProperty</c> function sets a single summary information property.
        /// <param name="summaryInfo">Handle to summary information.</param>
        /// <param name="id">Specifies the property to set.</param>
        /// <param name="type">Specifies the type of property to set.</param>
        /// <param name="intValue">Specifies the integer value.</param>
        /// <param name="fileTime">Specifies the file-time value.</param>
        /// <param name="value">Specifies the text value. </param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.DatatypeMismatch"/>  The data types were mismatched.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// <para><see cref="MsiError.UnknownProperty"/>  The property is unknown.</para>
        /// <para><see cref="MsiError.UnsupportedType"/>  The type is unsupported.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiSummaryInfoSetProperty(IntPtr summaryInfo,
            uint id, VariantType type, int intValue, FILETIME fileTime, string value);

        /// The <c>MsiVerifyDiskSpace</c> function checks to see if sufficient disk space is present for the current installation.
        /// <param name="install">Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.DiskFull"/>  The disk is full.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiVerifyDiskSpace(IntPtr install);

        /// The <c>MsiViewClose</c> function releases the result set for an executed view.
        /// <param name="view">Handle to a view that is set to release.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiViewClose(IntPtr view);

        /// The <c>MsiViewExecute</c> function executes a SQL view query and supplies any required parameters.
        /// The query uses the question mark token to represent parameters as described in SQL Syntax. The values of
        /// these parameters are passed in as the corresponding fields of a parameter record.
        /// <param name="view">Handle to the view upon which to execute the query.</param>
        /// <param name="record">Handle to a record that supplies the parameters. This parameter contains values to replace the parameter tokens in the SQL query. It is optional, so hRecord can be <c>IntPtr.Zero</c>.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiViewExecute(IntPtr view, IntPtr record);

        /// The <c>MsiViewFetch</c> function fetches the next sequential record from the view. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="view">Handle to the view to fetch from.</param>
        /// <param name="record">Pointer to the handle for the fetched record.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiViewFetch(IntPtr view, ref IntPtr record);

        /// The <c>MsiViewGetColumnInfo</c> function returns a record containing column names or definitions. This function returns a handle that should be closed using <see cref="MsiCloseHandle"/>.
        /// <param name="view">Handle to the view from which to obtain column information.</param>
        /// <param name="type">Specifies a flag indicating what type of information is needed.</param>
        /// <param name="record">Pointer to a handle to receive the column information data record.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiViewGetColumnInfo(IntPtr view,
            MsiColInfoType type, out IntPtr record);

        /// The <c>MsiViewGetError</c> function returns the error that occurred in the <see cref="MsiViewModify"/> function.
        /// <param name="view">Handle to the view.</param>
        /// <param name="columnNames">Pointer to the buffer that receives the null-terminated column name. Do not attempt to determine the size of the buffer by passing in a <c>null</c> for <c>columnNames</c>. You can get the size of the buffer by passing in an empty string (for example ""). The function will then return <see cref="MsiDbError.MoreData"/> and <c>columnNamesSize</c> will contain the required buffer size in TCHARs, not including the terminating null character. On return of <see cref="MsiDbError.NoError"/>, <c>columnNamesSize</c> contains the number of TCHARs written to the buffer, not including the terminating null character. This parameter is an empty string if there are no errors.</param>
        /// <param name="columnNamesSize">Pointer to the variable that specifies the size, in TCHARs, of the buffer pointed to by the variable <c>columnNames</c>. When the function returns <see cref="MsiDbError.NoError"/>, this variable contains the size of the data copied to <c>columnNames</c>, not including the terminating null character. If <c>columnNames</c> is not large enough, the function returns <see cref="MsiDbError.MoreData"/> and stores the required size, not including the terminating null character, in the variable pointed to by <c>columnNamesSize</c>.</param>
        /// <returns>The <see cref="MsiDbError"/></returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiDbError MsiViewGetError(IntPtr view,
            string columnNames, ref uint columnNamesSize);

        /// The MsiViewModify function updates a fetched record.
        /// <param name="view">Handle to a view.</param>
        /// <param name="mode">Specifies the modify mode.</param>
        /// <param name="record">Handle to the record to modify.</param>
        /// <returns>
        /// <para><see cref="MsiError.Success"/>  The function succeeded.</para>
        /// <para><see cref="MsiError.FunctionFailed"/>  The function failed.</para>
        /// <para><see cref="MsiError.InvalidData"/>  A validation was requested and the data did not pass. For more information, call <see cref="MsiViewGetError"/>.</para>
        /// <para><see cref="MsiError.InvalidHandle"/>  An invalid or inactive handle was supplied.</para>
        /// <para><see cref="MsiError.InvalidHandleState"/>  The handle is in an invalid state.</para>
        /// <para><see cref="MsiError.InvalidParameter"/>  One of the parameters was invalid.</para>
        /// </returns>
        /// <remarks>Please refer to the MSDN documentation for more information.</remarks>
        [DllImport(MSI_LIB, CharSet = CharSet.Auto)]
        extern static public MsiError MsiViewModify(IntPtr view, MsiModify mode,
            IntPtr record);
        #endregion	Database Functions
        #endregion	Interop Methods
    }
}