MsiGetComponentState

[This is preliminary documentation and subject to change.]

The MsiGetComponentState function obtains the state of a component.

UINT MsiGetComponentState(
  MSIHANDLE hInstall,         // installer handle
  LPCTSTR szComponent,        // component name within product
  INSTALLSTATE *piInstalled,  // returned current install state
  INSTALLSTATE *piAction      // action taken during install session
);
 

Parameters

hInstall
Handle to the installation.
szComponent
Specifies the component name within the product.
piInstalled
Specifies the returned current installed state. This parameter can be one of the following values.
Value Meaning
INSTALLSTATE_ABSENT The component is not installed.
INSTALLSTATE_BADCONFIG The configuration data is corrupt.
INSTALLSTATE_DEFAULT The component will be installed in the default location: local or source.
INSTALLSTATE_FREECACHE The source files must be released from the client cache.
INSTALLSTATE_INCOMPLETE The installation is suspended or in progress.
INSTALLSTATE_INVALIDARG An invalid parameter was passed to the function.
INSTALLSTATE_LOCAL The component is installed on the local drive.
INSTALLSTATE_LOCKCACHE The source files in the client cache are locked.
INSTALLSTATE_MOREDATA The buffer overflow is returned.
INSTALLSTATE_SOURCE The component will run from the source, CD, or network.
INSTALLSTATE_SOURCEABSENT The component cannot run from the source because the source is unavailable.
INSTALLSTATE_UNKNOWN An unrecognized product or feature name was passed to the function.

piAction
Specifies the action taken during the installation. For return values, see piInstalled.

Return Values

ERROR_INVALID_HANDLE
An invalid or inactive handle was supplied.
ERROR_SUCCESS
The function succeeded.
ERROR_UNKNOWN_FEATURE
An unknown feature was requested.

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msiquery.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Database Access Reference, Installer Selection Functions