MsiGetFeatureCost

[This is preliminary documentation and subject to change.]

The MsiGetFeatureCost function returns the disk space required by a feature and its selected children and parent features.

UINT MsiGetFeatureCost(
  MSIHANDLE hInstall,     // installer handle
  LPCTSTR szFeature,      // name of feature
  MSICOSTTREE iCostTree,  // portion of tree to cost
  INSTALLSTATE iState,    // requested state
  INT *piCost             // returned cost
);
 

Parameters

hInstall
Handle to the installation.
szFeature
Specifies the name of the feature.
iCostTree
Specifies the value the function uses to determine disk space requirements. This parameter can be one of the following values.
Value Meaning
MSICOSTTREE_CHILDREN The children of the indicated feature are included in the cost.
MSICOSTTREE_PARENTS The parent features of the indicated feature are included in the cost.
MSICOSTTREE_PRODUCT Unsupported.
MSICOSTTREE_SELFONLY The feature only is included in the cost.

iState
Specifies the installation state. This parameter can be one of the following values.
Value Meaning
INSTALLSTATE_UNKNOWN The product or feature is unrecognized.
INSTALLSTATE_ABSENT The product or feature is uninstalled.
INSTALLSTATE_LOCAL The product or feature is installed on the local drive.
INSTALLSTATE_SOURCE The product or feature is installed to run from source, CD, or network.
INSTALLSTATE_DEFAULT The product or feature will be installed to use the default location: local or source.

piCost
Specifies the returned disk space requirements in units of 512 bytes.

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

With the MsiGetFeatureCost function, the MSICOSTTREE_SELFONLY value indicates the total amount of disk space (in units of 512 bytes) required by the specified feature only. This returned value does not include the children or the parent features of the specified feature. This total cost is made up of the disk costs attributed to every component linked to the feature.

The MSICOSTTREE_CHILDREN value indicates the total amount of disk space (in units of 512 bytes) required by the specified feature and its children. For each feature, the total cost is made up of the disk costs attributed to every component linked to the feature.

The MSICOSTTREE_PARENTS value indicates the total amount of disk space (in units of 512 bytes) required by the specified feature and its parent features (up to the root of the Feature table). For each feature, the total cost is made up of the disk costs attributed to every component linked to the feature.

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