MsiSetPropertyA 函数 (msiquery.h)
MsiSetProperty 函数设置安装属性的值。
语法
UINT MsiSetPropertyA(
[in] MSIHANDLE hInstall,
[in] LPCSTR szName,
[in] LPCSTR szValue
);
parameters
[in] hInstall
提供给 DLL 自定义操作或通过 MsiOpenPackage、MsiOpenPackageEx 或 MsiOpenProduct 获取的安装的句柄。
[in] szName
指定属性的名称。
[in] szValue
指定属性的值。
返回值
此函数返回 UINT。
注解
如果未定义 属性,则它由 MsiSetProperty 函数创建。 如果值为 null 或空字符串,则会删除 属性。
注意
msiquery.h 标头将 MsiSetProperty 定义为别名,该别名根据 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 |
标头 | msiquery.h |
Library | Msi.lib |
DLL | Msi.dll |
请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈