MsiEvaluateCondition Function

Windows Installer

MsiEvaluateCondition Function

The MsiEvaluateCondition function evaluates a conditional expression containing property names and values.

Syntax

C++MSICONDITION MsiEvaluateCondition(
  __in  MSIHANDLE hInstall,
  __in  LPCTSTR szCondition
);

Parameters

hInstall [in]

Handle to the installation provided to a DLL custom action or obtained through MsiOpenPackage, MsiOpenPackageEx, or MsiOpenProduct.

szCondition [in]

Specifies the conditional expression. This parameter must not be null. For the syntax of conditional expressions see Conditional Statement Syntax.

Return Value

MSICONDITION_ERROR

An invalid handle was passed to the function, or the conditional expression has a syntax error.

MSICONDITION_FALSE

An expression that evaluates to FALSE was passed to the function.

MSICONDITION_NONE

No expression was passed to the function.

MSICONDITION_TRUE

An expression that evaluates to TRUE was passed to the function.

Remarks

The following table shows the feature and component state values used by the MsiEvaluateCondition function. These states are not set until MsiSetInstallLevel is called, either directly or by the CostFinalize action. Therefore, state checking is generally only useful for conditional expressions in an action sequence table.

Value Meaning
INSTALLSTATE_ABSENT Feature or component not present.
INSTALLSTATE_LOCAL Feature or component on local computer.
INSTALLSTATE_SOURCE Feature or component run from source.
(null value) No action to be taken on feature or component.

 

Requirements

VersionWindows Installer 5.0 on Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003, Windows XP, and Windows 2000
HeaderMsiquery.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiEvaluateConditionW (Unicode) and MsiEvaluateConditionA (ANSI)

See Also

Installer Action Functions
Passing Null as the Argument of Windows Installer Functions

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.