MsiOpenPackage

[This is preliminary documentation and subject to change.]

The MsiOpenPackage function opens a package 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.

UINT MsiOpenPackage(
  LPCTSTR szPackagePath,  // the full path to the package
  MSIHANDLE *hProduct     // returned product handle, must be closed
);
 

Parameters

szPackagePath
Specifies the path to the package.
hProduct
Pointer to a variable that receives the product handle.

Return Values

ERROR_BAD_CONFIGURATION
The configuration information is corrupt.
ERROR_INSTALL_FAILURE
The product could not be opened.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_SUCCESS
The function completed successfully.

Remarks

MsiOpenPackage can accept an opened database handle in the form "#nnnn", where nnnn is the database handle in string form, i.e. #123, in lieu of a path to the package. This is intended for development tasks such as running validation actions, or for use with database management tools.

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

Product Query Functions