Export (0) Print
Expand All
Expand Minimize

MsiOpenProduct function

The MsiOpenProduct function opens a product for use with the functions that access the product database. The MsiCloseHandle function must be called with the handle when the handle is no longer needed.

Note  Initialize COM on the same thread before calling the MsiOpenPackage, MsiOpenPackageEx, or MsiOpenProduct function.

Syntax


UINT MsiOpenProduct(
  _In_   LPCTSTR szProduct,
  _Out_  MSIHANDLE *hProduct
);

Parameters

szProduct [in]

Specifies the product code of the product to be opened.

hProduct [out]

Pointer to a variable that receives the product handle.

Return value

ValueMeaning
ERROR_BAD_CONFIGURATION

The configuration information is corrupt.

ERROR_INSTALL_FAILURE

The product could not be opened.

ERROR_INSTALL_SOURCE_ABSENT

The source was unavailable.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_SUCCESS

The function completed successfully.

ERROR_UNKNOWN_PRODUCT

The product code was unrecognized.

 

Requirements

Version

Windows Installer 5.0 on Windows Server 2012, Windows 8, 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 or Windows XP. 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

MsiOpenProductW (Unicode) and MsiOpenProductA (ANSI)

See also

Product Query Functions

 

 

Community Additions

ADD
Show:
© 2015 Microsoft