Share via


Installer.ProvideQualifiedComponent 方法

Installer物件的ProvideQualifiedComponent方法會傳回完整的元件路徑,並執行任何必要的安裝。 如有必要,此方法會提示來源,並遞增功能的使用計數。

語法

Installer.ProvideQualifiedComponent(
  Category,
  Qualifier,
  InstallMode
)

參數

類別

指定所要求元件的元件識別碼。 這可能不是元件本身的 GUID,而是提供正確功能的伺服器,如同 PublishComponent 資料表的 ComponentId 資料行。

Qualifier

PublishComponent 資料表) 指定廣告元件清單 (限定詞。

InstallMode

定義安裝模式。 此參數可以是下表所示的其中一個值。

InstallMode 意義
msiInstallModeDefault
0
提供元件,執行任何必要的安裝。
msiInstallModeExisting
–1
只有在功能存在時,才提供元件;否則會傳回空字串。 此模式會驗證元件金鑰檔是否存在。
msiInstallModeNoDetection
–2
只有在功能存在時,才提供元件;否則會傳回空字串。 此模式只會檢查元件是否已註冊,但不會驗證元件金鑰檔是否存在。
msiInstallModeNoSourceResolution
–3
只有在具有 msiInstallStateLocal的 InstallState 參數存在時,才提供元件路徑。 這會檢查元件的註冊,但不會驗證元件金鑰檔案是否存在。
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