MsiGetFeatureValidStates

[This is preliminary documentation and subject to change.]

The MsiGetFeatureValidStates function returns a valid installation state.

UINT MsiGetFeatureValidStates(
  MSIHANDLE hInstall,            // installer handle
  LPCTSTR szFeature,             // feature name
  DWORD *dwInstallState          // install state
);
 

Parameters

hInstall
Handle to the installation.
szFeature
Specifies the feature name.
dwInstallState
Specifies the location to hold the valid installation states. This parameter will be a combination of the following values. For each valid install state, a bit is set of value: (1 << INSTALLSTATE).
Value Meaning
1 << INSTALLSTATE_ABSENT The feature can be uninstalled.
1 << INSTALLSTATE_ADVERTISED The feature can be advertised.
1 << INSTALLSTATE_LOCAL The feature can be installed on the local drive.
1 << INSTALLSTATE_SOURCE The feature can be configured to run from source, CD, or network.
1 << INSTALLSTATE_DEFAULT The feature can be configured to use the default location: local or source.

Return Values

ERROR_FUNCTION_FAILED
The function failed.
ERROR_INVALID_HANDLE
An invalid or inactive handle was supplied.
ERROR_INVALID_HANDLE_STATE
An invalid handle state was supplied.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_SUCCESS
The function succeeded.
ERROR_UNKNOWN_FEATURE
An unknown feature was requested.

Remarks

The MsiGetFeatureValidStates function determines state validity by querying all components that are linked to the specified feature without taking into account the current installed state of any component. If any of these components have a value of IRSOPTIONAL in the RunFromSource column, or if at least one component is marked IRSTLOCALONLY and at least one other component is marked IRSSOURCEONLY, then both INSTALLSTATE_LOCAL and INSTALLSTATE_SOURCE are valid states for the feature. If all components are set to IRSLOCALONLY, INSTALLSTATE_LOCAL is the only valid state. If all components are set to IRSSOURCEONLY, INSTALLSTATE_SOURCE is the only valid state.

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