Session.SetInstallLevel Method

Windows Installer

Session.SetInstallLevel Method

The SetInstallLevel method of the Session object sets the install level for the current installation to a specified value and recalculates the Select and Installed states for all features in the Feature table. It also sets the Action state of each component in the Component table based on the new level.

Syntax

Script
SetInstallLevel(
  installLevel
)

Parameters

installLevel

Required requested new install level.

Return Value

This method does not return a value.

Remarks

The CostInitialize action must be executed prior to calling SetInstallLevel.

If 0 is passed for the installLevel parameter, the current install level is not changed, but all features are still updated based on the current install level. For example, this functionality could be used by the Handler module to reset all selections back to their initial default states at any point in the UI selection process.

If the method fails, you can obtain extended error information by using the LastErrorRecord method.

Requirements

VersionWindows 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
DLLMsi.dll
IIDIID_ISession is defined as 000C109E-0000-0000-C000-000000000046

See Also

Session

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.