UseFeature Method (productCode, feature, installMode)

DTF API

Copy image CopyHover image
Deployment Tools Foundation UseFeature Method (productCode, feature, installMode)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerInstallerUseFeature(String, String, InstallMode)
increments the usage count for a particular feature and returns the installation state for that feature. This method should be used to indicate an application's intent to use a feature.
Declaration Syntax
C# Visual Basic Visual C++ F#
public static InstallState UseFeature(
	string productCode,
	string feature,
	InstallMode installMode
)
Public Shared Function UseFeature ( 
	productCode As String,
	feature As String,
	installMode As InstallMode
) As InstallState
public:
static InstallState UseFeature(
	String^ productCode, 
	String^ feature, 
	InstallMode installMode
)
static member UseFeature : 
        productCode : string * 
        feature : string * 
        installMode : InstallMode -> InstallState 
Parameters
productCode (String)
The product code of the product.
feature (String)
The feature to be used.
installMode (InstallMode)
Must have the value NoDetection.
Return Value
InstallState
The installed state of the feature.
Remarks

The UseFeature method should only be used on features known to be published. The application should determine the status of the feature by calling either the FeatureState method or Features method.

Win32 MSI APIs: MsiUseFeature, MsiUseFeatureEx

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.11.1.2318)