MSI.QueryProductState

number MSI.QueryProductState ( 

string ProductCode )

Description

Calls the MsiQueryProductState function to get the installed state for a product.

Parameters

ProductCode

(string) The "product code" of the product whose state you want. This string must be an identifier string enclosed in curly braces, for example: "{78B82B0B-9AD9-40C0-B994-F72C21B52723}".

Returns

(number) The installed state of the product represented by one of the following values:

CONSTANT

VALUE

DESCRIPTION

INSTALLSTATE_INVALIDARG

-2

An invalid parameter was passed to the function.

INSTALLSTATE_UNKNOWN

-1

The product is neither advertised or installed.

INSTALLSTATE_ADVERTISED

1

The product is advertised but not installed.

INSTALLSTATE_ABSENT

2

The product is installed for a different user.

INSTALLSTATE_DEFAULT

5

The product is installed for the current user.

You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions