MsiGetProductInfo

[This is preliminary documentation and subject to change.]

The MsiGetProductInfo function returns product information for published and installed products.

INSTALLSTATE MsiGetProductInfo(
  LPCTSTR szProduct,   // product code
  LPCTSTR szProperty,  // product property
  LPTSTR lpValueBuf,   // buffer to return property value
  DWORD *pcchValueBuf  // in/out buffer character count, 
                       // including NULL
);
 

Parameters

szProduct
Specifies the product code for the product.
szProperty
Specifies the property to be retrieved. The properties in the following list can only be retrieved from applications that are already installed.
Installed Properties Description
INSTALLPROPERTY_INSTALLEDPRODUCTNAME Installed product name
INSTALLPROPERTY_VERSIONSTRING Product version
INSTALLPROPERTY_HELPLINK Support link
INSTALLPROPERTY_HELPTELEPHONE Support telephone
INSTALLPROPERTY_INSTALLLOCATION Installation location
INSTALLPROPERTY_INSTALLSOURCE Installation source
INSTALLPROPERTY_INSTALLDATE Installation date
INSTALLPROPERTY_PUBLISHER Publisher
INSTALLPROPERTY_LOCALPACKAGE Local cached package
INSTALLPROPERTY_URLINFOABOUT URL information
INSTALLPROPERTY_URLUPDATEINFO URL update information
INSTALLPROPERTY_VERSIONMINOR Minor product version
INSTALLPROPERTY_VERSIONMAJOR Major product version
INSTALLPROPERTY_PACKAGECODE Identifier of package product was installed from
INSTALLPROPERTY_VERSION Product

version


The properties in the following list can also be retrieved from applications that are advertised.

Advertised Properties Description
INSTALLPROPERTY_TRANSFORMS Transforms
INSTALLPROPERTY_LANGUAGE Product language
INSTALLPROPERTY_PRODUCTNAME Human readable product name

lpValueBuf
Pointer to a buffer that receives the property value. This parameter can be NULL.
pcchValueBuf
Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpValueBuf parameter. This size should include the terminating NULL character.

If lpValueBuf is NULL, pcchValueBuf can be NULL.

Return Values

ERROR_BAD_CONFIGURATION
The configuration data is corrupt.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_MORE_DATA
A buffer is too small to hold the requested data.
ERROR_SUCCESS
The function completed successfully.
ERROR_UNKNOWN_PRODUCT
The product is unadvertised or uninstalled.
ERROR_UNKNOWN_PROPERTY
The property is unrecognized.

Remarks

When the MsiGetProductInfo function returns, the pcchValueBuf parameter contains the length of the class string stored in the buffer. The count returned does not include the terminating NULL character. If the buffer is not big enough, MsiGetProductInfo returns ERROR_MORE_DATA, and MsiGetProductInfo contains the size of the string, in characters, without counting the NULL character.

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msi.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

System Status Functions