msiEvaluateConditionA 函式 (msiquery.h)

MsiEvaluateCondition函式會評估包含屬性名稱和值的條件運算式。

語法

MSICONDITION MsiEvaluateConditionA(
  [in] MSIHANDLE hInstall,
  [in] LPCSTR    szCondition
);

參數

[in] hInstall

處理提供給 DLL 自訂動作的安裝,或透過 MsiOpenPackageMsiOpenPackageExMsiOpenProduct取得。

[in] szCondition

指定條件運算式。 此參數不得為 Null。 如需條件運算式的語法,請參閱 條件陳述式語法

傳回值

此函式會傳回 MSICONDITION。

備註

下表顯示 MsiEvaluateCondition 函式所使用的功能和元件狀態值。 在直接或由CostFinalize 動作呼叫MsiSetInstallLevel之前,不會設定這些狀態。 因此,狀態檢查通常只適用于動作順序資料表中的條件運算式。

意義
INSTALLSTATE_ABSENT 功能或元件不存在。
INSTALLSTATE_LOCAL 本機電腦上的功能或元件。
INSTALLSTATE_SOURCE 從來源執行功能或元件。
(null 值) 不需對功能或元件採取任何動作。
 
 

注意

msiquery.h 標頭會將 MsiEvaluateCondition 定義為別名,根據 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
程式庫 Msi.lib
Dll Msi.dll

另請參閱

安裝程式動作函式

傳遞 Null 作為 Windows Installer 函式的引數