msi.h) (MsiUseFeatureExA 函数
MsiUseFeatureEx 函数递增特定功能的使用计数,并指示该功能的安装状态。 此函数应用于指示应用程序使用功能的意图。
语法
INSTALLSTATE MsiUseFeatureExA(
[in] LPCSTR szProduct,
[in] LPCSTR szFeature,
[in] DWORD dwInstallMode,
[in] DWORD dwReserved
);
parameters
[in] szProduct
指定拥有要使用的功能的产品的产品代码。
[in] szFeature
标识要使用的功能。
[in] dwInstallMode
此参数可以具有以下值。
值 | 含义 |
---|---|
|
返回值指示安装状态。 |
[in] dwReserved
保留供将来使用。 此值必须设置为 0。
返回值
值 | 含义 |
---|---|
|
未安装该功能。 |
|
该功能已播发。 |
|
此功能在本地安装并可供使用。 |
|
此功能从源安装并可供使用。 |
|
此功能未发布。 |
注解
MsiUseFeatureEx 函数只应用于已知要发布的功能。 INSTALLSTATE_UNKNOWN指示程序正在尝试使用未发布的功能。 应用程序应通过调用 MsiQueryFeatureState 或 MsiEnumFeatures 来确定是否在调用 MsiUseFeature 之前发布该功能。 应用程序应在初始化时进行这些调用。 应用程序应仅使用已知已发布的功能。
注意
msi.h 标头将 MsiUseFeatureEx 定义为别名,该别名根据 UNICODE 预处理器常量的定义自动选择此函数的 ANSI 或 Unicode 版本。 将非特定编码别名与非非特定编码的代码混合使用可能会导致不匹配,从而导致编译或运行时错误。 有关详细信息,请参阅 函数原型的约定。
要求
最低受支持的客户端 | Windows Server 2012、Windows 8、Windows Server 2008 R2 或 Windows 7 上的 Windows Installer 5.0。 Windows Server 2008 或 Windows Vista 上的 Windows Installer 4.0 或 Windows Installer 4.5。 Windows Server 2003 或 Windows XP 上的 Windows Installer。 若要了解 Windows Installer 版本所需的最低 Windows Service Pack,请参阅 Windows Installer 运行时要求。 |
目标平台 | Windows |
标头 | msi.h |
Library | Msi.lib |
DLL | Msi.dll |
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈