Session object (Windows Installer)

The Session object controls the installation process. It opens the Installer database, which contains the installation tables and data. This object is associated with a standard set of action functions, each performing particular operations on data from one or more tables. Additional custom actions may be added for particular product installations. The basic engine function is a sequencer that fetches sequential records from a designated sequence table, evaluates any specified condition expression, and executes the designated action. Actions not recognized by the engine are deferred to the UI handler object for processing, usually dialog box sequences.

Note that only one Session object can be opened by a single process.


The Session object has these types of members:


The Session object has these methods.

Method Description
DoAction Executes the specified action.
EvaluateCondition Evaluates a logical expression containing symbols and values and returns an integer of the enumeration msiEvaluateConditionErrorEnum.
FeatureInfo Returns a FeatureInfo object containing descriptive information for the specified feature.
FormatRecord Returns a formatted string from template and record data.
Message Performs any enabled logging operations and defers execution to the UI handler object associated with the engine.
Sequence Opens a query on the specified table, ordering the actions by the numbers in the Sequence column. For each row fetched, the DoAction method is called, provided that any supplied condition expression does not evaluate to False.
SetInstallLevel Sets the install level for the current installation to a specified value and recalculates the Select and Installed states for all features.



The Session object has these properties.

Property Access type Description
Returns a RecordList object enumerating the disk space per drive required to install a component.
Returns the current installed state of the designated component.
Obtains or requests a change in the Action state of a row in the Component table.
Returns the database for the current installation session.
Returns the total amount of disk space (in units of 512 bytes) required by the specified feature and its parent features (up to the root of the Feature table).
Returns the current installed state of the designated feature.
Obtains or requests a change in the Select state of a feature's record and subrecords.
Returns an integer representing bit flags with each relevant bit representing a valid installation state for the specified feature.
Returns the active installer object.
Language (Session Object)
Represents the numeric language identifier used by the current installation session.
This property is a value representing the designated mode flag for the current installation session.
Represents the string value of a named installer property.
Property (Session Object)
Retrieves product properties from the product database.
Provides the full path to the designated folder on the source media or server image.
Provides the full path to the designated folder on the installation target drive.
Returns true if enough disk space exists, and false if the disk is full.



Requirement Value
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
IID_ISession is defined as 000C109E-0000-0000-C000-000000000046

See also

Windows Installer Scripting Examples