MsiGetComponentState function
The MsiGetComponentState function obtains the state of a component.
Syntax
UINT MsiGetComponentState( _In_ MSIHANDLE hInstall, _In_ LPCTSTR szComponent, _Out_ INSTALLSTATE *piInstalled, _Out_ INSTALLSTATE *piAction );
Parameters
- hInstall [in]
-
Handle to the installation provided to a DLL custom action or obtained through MsiOpenPackage, MsiOpenPackageEx, or MsiOpenProduct.
- szComponent [in]
-
A null-terminated string that specifies the component name within the product.
- piInstalled [out]
-
Receives the current installed state. This parameter must not be null. This parameter can be one of the following values.
- piAction [out]
-
Receives the action taken during the installation. This parameter must not be null. For return values, see piInstalled.
Return value
The MsiGetComponentState function returns the following values:
- ERROR_INVALID_HANDLE
-
An invalid or inactive handle was supplied.
- ERROR_SUCCESS
-
The function succeeded.
- ERROR_UNKNOWN_COMPONENT
-
An unknown component was requested.
Remarks
If the function fails, you can obtain extended error information by using MsiGetLastErrorRecord.
For more information, see Calling Database Functions From Programs.
Requirements
|
Version | Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP |
|---|---|
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | MsiGetComponentStateW (Unicode) and MsiGetComponentStateA (ANSI) |
See also
Build date: 11/30/2012
