The OpenPackage method of the Installer object opens an installer package for use with functions that access the product database and install engine, returning an Session object.
Syntax
Script
OpenPackage(
packagePath,
options
)
Parameters
- packagePath
-
Required string containing the path name of the package.
- options
-
An optional integer value that specifies whether or not OpenPackage should ignore the current computer state when creating the Session object. No value or a value of 0 for options defaults to the original behavior. When options is 1, the OpenPackage Method ignores the current computer state when opening the package. A value of 1 prevents changes to the current computer state. For more information, see MsiOpenPackageEx.
Return Value
This method does not return a value.Remarks
The OpenPackage method can accept the database handle directly instead of the string for the package path.
Note that only one Session object can be opened by a single process. OpenPackage cannot be used in a custom action because the active installation is the only session allowed.
A safe Session object ignores the current computer state when opening the package and prevents changes to the current computer state. For more information, see MsiOpenPackageEx.
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 |
---|---|
DLL | Msi.dll |
IID | IID_IInstaller is defined as 000C1090-0000-0000-C000-000000000046 |
Send comments about this topic to Microsoft
Build date: 8/13/2009
© 2009 Microsoft Corporation. All rights reserved.