MsiQueryProductState function (Windows)

Switch View :
ScriptFree
MsiQueryProductState function

Applies to: desktop apps only

The MsiQueryProductState function returns the installed state for a product.

Syntax

INSTALLSTATE MsiQueryProductState(
  __in  LPCTSTR szProduct
);

Parameters

szProduct [in]

Specifies the product code that identifies the product to be queried.

Return value

ValueMeaning
INSTALLSTATE_ABSENT

The product is installed for a different user.

INSTALLSTATE_ADVERTISED

The product is advertised but not installed.

INSTALLSTATE_DEFAULT

The product is installed for the current user.

INSTALLSTATE_INVALIDARG

An invalid parameter was passed to the function.

INSTALLSTATE_UNKNOWN

The product is neither advertised or installed.

 

Requirements

Version

Windows 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. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.

Header

Msi.h

Library

Msi.lib

DLL

Msi.dll

Unicode and ANSI names

MsiQueryProductStateW (Unicode) and MsiQueryProductStateA (ANSI)

See also

System Status Functions

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Community Content

Robert Flaming - MSFT
Hex Values for Win32 error codes Published as part of Open Protocol Specifications

As a part of the Open Protocol Specifications, the hex values for Win32 error codes can now be found at http://msdn2.microsoft.com/en-us/library/cc231199.aspx.