msiSetInstallLevel 函式 (msiquery.h)

MsiSetInstallLevel 函式會設定完整產品安裝的安裝層級。

語法

UINT MsiSetInstallLevel(
  [in] MSIHANDLE hInstall,
  [in] int       iInstallLevel
);

參數

[in] hInstall

處理提供給 DLL 自定義動作的安裝,或使用 MsiOpenPackageMsiOpenPackageExMsiOpenProduct 取得。

[in] iInstallLevel

安裝層級。

傳回值

MsiSetInstallLevel 函式會傳回下列其中一個值:

備註

MsiSetInstallLevel 函式會設定下列各項:

  • 目前安裝的安裝層級為指定的值。
  • 功能資料表中所有功能的 [選取] 和 [已安裝] 狀態。
  • 元件數據表中每個元件的動作狀態,以新層級為基礎。
對於任何安裝,都有定義的安裝層級,這是從 1 到 32,767 的整數值。 初始值是由 INSTALLLEVEL 屬性所決定,這是在 Property Table 中設定的。

如果 0 (零) 或負數傳入 iInstallLevel 參數,則目前的安裝層級不會變更,但所有功能仍會根據目前的安裝層級更新。 如需詳細資訊,請參閱 從程式呼叫資料庫函式

如果函式失敗,您可以使用 MsiGetLastErrorRecord 來取得擴充的錯誤資訊。

規格需求

需求
最低支援的用戶端 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
程式庫 Msi.lib
Dll Msi.dll

另請參閱

安裝程式選取函式