MsiSetComponentState

[This is preliminary documentation and subject to change.]

The MsiSetComponentState function sets a component to the requested state.

UINT MsiSetComponentState(
  MSIHANDLE hInstall,     // installer handle
  LPCTSTR szComponent,    // name of component within product
  INSTALLSTATE iState     // install state
);
 

Parameters

hInstall
Handle to the installation.
szComponent
Specifies the name of the component.
iState
Specifies the state to set. This parameter can be one of the following values.
Value Meaning
INSTALLSTATE_ABSENT The component was uninstalled.
INSTALLSTATE_LOCAL The component was installed on the local drive.
INSTALLSTATE_SOURCE The component will run from source, CD, or network.

Return Values

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

Remarks

The MsiSetComponentState function requests a change in the Action state of a record in the Component table.

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