Redigera

Dela via


Installer Function Reference

To enable Windows Installer in your application, you must use the installer functions. The tables in this topic identify the functions by category.

User Interface and Logging Functions

Name Description
MsiSetInternalUI Enables the internal user interface of the installer.
MsiSetExternalUI Enables an external user-interface handler that receives messages in a string format.
MsiSetExternalUIRecord Enables an external user-interface handler that receives messages in a record format.
MsiEnableLog Sets the log mode for all installations in the calling process.

 

Handle Management Functions

Name Description
MsiCloseHandle Closes an open installation handle.
MsiCloseAllHandles Closes all open installation handles. Do not use for cleanup.

 

Installation and Configuration Functions

Name Description
MsiAdvertiseProduct Advertises a product.
MsiAdvertiseProductEx Advertises a product.
MsiAdvertiseScript Copies an advertise script file into specified locations.
MsiInstallProduct Installs or removes an application or application suite.
MsiConfigureProduct Installs or removes an application or application suite.
MsiConfigureProductEx Installs or removes an application or application suite. A product command-line can be specified.
MsiReinstallProduct Reinstalls or repairs an installation.
MsiConfigureFeature Configures the installed state of a feature.
MsiReinstallFeature Validates or repairs features.
MsiInstallMissingComponent Installs missing components.
MsiInstallMissingFile Installs missing files.
MsiNotifySidChange Notifies and updates the Windows Installer internal information with changes to user SIDs. Available beginning with Windows Installer 3.1.
MsiProcessAdvertiseScript Processes an advertise script file into specified locations.
MsiSourceListAddSource Adds or reorders the sources of a patch or product in a specified context.
MsiSourceListAddSourceEx Adds or reorders the sources of a patch or product in a specified context. Creates a source list for a patch that does not exist in a specified context. Available in Windows Installer  3.0.
MsiSourceListClearSource Removes an existing source for a product or patch in a specified context. Available in Windows Installer  3.0.
MsiSourceListClearAll Removes all the existing sources of a specific source type for a specified product instance.
MsiSourceListClearAllEx Removes all the existing sources of a specific source type for a specified product instance. Available in Windows Installer  3.0.
MsiSourceListForceResolution Removes the registration of the current source of the product or patch, which is registered as the property "LastUsedSource". This function does not affect the registered source list.
MsiSourceListForceResolutionEx Removes the registration of the current source of the product or patch, which is registered as the property "LastUsedSource". This function does not affect the registered source list. Available in Windows Installer  3.0.
MsiSourceListGetInfo Retrieves information about the source list for a product or patch in a specific context.
MsiSourceListSetInfo Sets the most recently used source for a product or patch in a specified context. Available in Windows Installer  3.0.
MsiSourceListEnumMediaDisks Enumerates the list of disks registered for the media source for a patch or product. Available in Windows Installer  3.0.
MsiSourceListAddMediaDisk Adds or updates a disk of the media source of a registered product or patch. Available in Windows Installer  3.0.
MsiSourceListClearMediaDisk Removes an existing registered disk under the media source for a product or patch in a specific context. Available in Windows Installer  3.0.
MsiSourceListEnumSources Enumerates the sources in the source list of a specified patch or product. Available in Windows Installer  3.0.

 

Component-Specific Functions

Name Description
MsiProvideAssembly Installs and returns the full component path for an assembly.
MsiProvideComponent Installs and returns the full component path of a component.
MsiProvideQualifiedComponent Installs and returns the full component path of a qualified component.
MsiProvideQualifiedComponentEx Installs and returns the full component path of a qualified component that is published by a product.
MsiGetComponentPath Returns the full path or registry key to an installed component.
MsiGetComponentPathEx Returns the full path or registry key to an installed component across user accounts and installation context. Windows Installer 4.5 and earlier: Not supported.
MsiLocateComponent Returns the full path to an installed component without a product code.
MsiQueryComponentState Returns the installed state for a component. Can query components of an instance of a product installed under user accounts other than the current user. Available in Windows Installer  3.0 or later.

 

Application-Only Functions

Name Description
MsiCollectUserInfo Stores user information from an installation wizard.
MsiUseFeature Increments usage count for a feature and indicates installation state.
MsiUseFeatureEx Increments usage count for a feature and indicates installation state.
MsiGetProductCode Returns product code using the component code.

 

System Status Functions

Name Description
MsiEnumProducts Enumerates advertised products.
MsiEnumProductsEx Enumerates through all the instances of advertised or installed products in a specified context. Available in Windows Installer  3.0 or later.
MsiEnumRelatedProducts Enumerates currently installed products having a specified upgrade code.
MsiEnumFeatures Enumerates published features.
MsiEnumComponents Enumerates the installed components.
MsiEnumComponentsEx Enumerates the installed components across user accounts and installation context. Windows Installer 4.5 and earlier: Not supported.
MsiEnumClients Enumerates the clients of an installed component.
MsiEnumClientsEx Enumerates the clients of an installed component across user accounts and installation context. Windows Installer 4.5 and earlier: Not supported.
MsiEnumComponentQualifiers Enumerates the advertised qualifiers for a component.
MsiQueryFeatureState Returns the installed state of a feature.
MsiQueryFeatureStateEx Returns the installed state for a product feature. Can query features of an instance of a product installed under user accounts other than the current user. Available in Windows Installer  3.0 or later.
MsiQueryProductState Returns the installed state for an application or application suite.
MsiGetFeatureUsage Returns usage metrics for a feature.
MsiGetProductInfo Returns product information for published and installed products.
MsiGetProductInfoEx Returns product information for advertised and installed products. Can retrieve information on an instance of a product installed under a user account other than the current user. Available in Windows Installer  3.0 or later.
MsiGetUserInfo Returns registered user information for an installed product.

 

Product Query Functions

Name Description
MsiOpenProduct Opens a product to use with the functions that access the database.
MsiOpenPackage Opens a package to use with the functions that access the database.
MsiOpenPackageEx Opens a package to use with the functions that access the database.
MsiIsProductElevated Checks whether the product is installed with elevated privileges.
MsiGetProductInfoFromScript Returns product information for an installer script file.
MsiGetProductProperty Retrieves properties in the product database.
MsiGetShortcutTarget Examines a shortcut and returns its product, feature name, and component if available.
MsiGetFeatureInfo Returns descriptive information for a feature.
MsiVerifyPackage Verifies that a specified file is an installation package.

 

Patching Functions

Name Description
MsiApplyPatch Invokes an installation and applies a patch package.
MsiEnumPatches Returns the GUID for each patch that is applied to a product, and a list of transforms from each patch that apply to the product.
MsiGetPatchInfo Returns information about a patch.
MsiRemovePatches Uninstalls a patch from a product. Available in Windows Installer 3.0.
MsiDeterminePatchSequence Determines the best application sequence for a set of patches and product. Available in Windows Installer 3.0.
MsiApplyMultiplePatches Applies one or more patches to products. Available in Windows Installer 3.0.
MsiEnumPatchesEx Enumerates all patches applied for a product in a particular context or across all contexts. Available in Windows Installer 3.0.
MsiGetPatchFileList When provided a list of .msp files this function retrieves the list of files that can be updated by the patches for the targe. Available in Windows Installer 4.0.
MsiGetPatchInfoEx Queries for information about the application of a specified patch to a specified product. Available in Windows Installer 3.0.
MsiExtractPatchXMLData Extracts information from a patch. Available in Windows Installer 3.0.
MsiDetermineApplicablePatches Determines the best set of patches required to update a product or set of products. Available in Windows Installer 3.0.

 

File Query Functions

Name Description
MsiGetFileHash Takes the path to a file and returns a 128-bit hash of that file.
MsiGetFileSignatureInformation Takes the path to a file that has been digitally signed and returns the file's signer certificate and hash.
MsiGetFileVersion Returns the version string and language string.

 

Transaction Management Functions

Name Description
MsiBeginTransaction Starts transaction processing of a multiple-package installation and returns an identifier for the transaction. This function is available beginning with Windows Installer 4.5.
MsiJoinTransaction Requests that the Windows Installer make the current process the owner of the transaction installing a multi-package installation. This function is available beginning with Windows Installer 4.5.
MsiEndTransaction Commits or rolls back all the installations belonging to the transaction. This function is available beginning with Windows Installer 4.5.

 

Database Functions

In addition to the Windows Installer functions identified in the previous tables, you can manipulate information in the installation database by using the database access functions that are described in the Database Functions section.

Installer Structures

In addition, some information in the installation database is handled using the structures described in the Installer Structures section.