Installer.ProvideQualifiedComponent 方法

Installer 对象的 ProvideQualifiedComponent 方法用于返回完整的组件路径并执行任何必要的安装。 如有必要,此方法会提示输入源并递增功能的使用计数。

语法

Installer.ProvideQualifiedComponent(
  Category,
  Qualifier,
  InstallMode
)

参数

类别

指定所请求组件的组件 ID。 这可能不是组件本身而是提供正确功能的服务器的 GUID,如 PublishComponent 表的 ComponentId 列中所示。

Qualifier

指定播发组件列表的限定符(来自 PublishComponent 表)。

InstallMode

定义安装模式。 此参数可以是下表中显示的值之一。

InstallMode 含义
msiInstallModeDefault
0
提供组件,执行任何必要的安装。
msiInstallModeExisting
–1
只有在功能存在时才提供组件,否则返回一个空字符串。 此模式验证组件的密钥文件是否存在。
msiInstallModeNoDetection
–2
只有在功能存在时才提供组件,否则返回一个空字符串。 此模式仅检查组件是否已注册,但不验证组件的密钥文件是否存在。
msiInstallModeNoSourceResolution
–3
只有在该功能存在且 InstallState 参数为 msiInstallStateLocal 时才提供组件路径。 它检查组件的注册情况,但不验证组件的密钥文件是否存在。
msiReinstallMode 标志的组合
 
使用此参数作为 ReinstallMode 参数调用 ReinstallFeature 以重新安装该功能,然后提供组件。

 

返回值

此方法不返回值。

要求

要求 值
版本
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
DLL
Msi.dll
IID
IID_IInstaller 定义为 000C1090-0000-0000-C000-000000000046

另请参阅

MsiProvideQualifiedComponent