Product 物件

Product物件代表公告、安裝或未知之產品的唯一實例。

物件可以使用 Product 屬性具現化為 「WindowsInstaller.Installer.Product (ProductCodeUserSidCoNtext) 」。 每部電腦內容的UserSid必須是 Null。 當內容不是每部電腦時,UserSid可以是 Null 來指定目前的使用者。 需要 ProductCodeCoNtext 參數。

成員

Product物件具有下列類型的成員:

方法

Product物件具有這些方法。

方法 描述
SourceListAddMediaDisk 將磁片新增至已註冊的磁片集。
SourceListAddSource 將網路或 URL 來源新增至來源清單。
SourceListClearAll 清除指定來源類型的完整來源清單。
SourceListClearMediaDisk 從來源清單中移除已註冊磁片集的磁片。
SourceListClearSource 從來源清單中移除網路或 URL 來源。
SourceListForceResolution 清除上次使用的來源。 這會在下次需要來源時強制來源清單解析。

 

屬性

Product物件具有這些屬性。

屬性 描述
ComponentState
這個產品實例的指定元件狀態。
Context
此產品實例的內容為 MSIINSTALLCONTEXT 值。
FeatureState
這個產品實例之指定功能的狀態。
InstallProperty
指定屬性的值。
MediaDisks
列舉此產品實例的所有媒體磁片。
ProductCode
傳回產品代碼。
SourceListInfo
取得並設定來源資訊屬性。 這是讀取或寫入屬性。
來源
列舉此產品實例的所有來源。
狀態
產品的安裝狀態。
UserSid
傳回 User SID,在此帳戶下,此產品實例可供使用。

 

規格需求

需求
版本
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 2000 上的 Windows Installer 3.0 或更新版本
DLL
Msi.dll
IID
IID_IProduct定義為 000C10A0-0000-0000-C000-000000000046

另請參閱

Windows Installer 腳本範例