MsiGetMode function

The MsiGetMode function is used to determine whether the installer is currently running in a specified mode, as listed in the table. The function returns a Boolean value of TRUE or FALSE, indicating whether the specific property passed into the function is currently set (TRUE) or not set (FALSE).

Syntax


BOOL MsiGetMode(
  _In_  MSIHANDLE hInstall,
  _In_  MSIRUNMODE iRunMode
);

Parameters

hInstall [in]

Handle to the installation provided to a DLL custom action or obtained through MsiOpenPackage, MsiOpenPackageEx, or MsiOpenProduct.

iRunMode [in]

Specifies the run mode. This parameter must have one of the following values.

ValueMeaning
MSIRUNMODE_ADMIN

The administrative mode is installing, or the product is installing.

MSIRUNMODE_ADVERTISE

The advertisements are installing or the product is installing or updating.

MSIRUNMODE_MAINTENANCE

An existing installation is being modified or there is a new installation.

MSIRUNMODE_ROLLBACKENABLED

Rollback is enabled.

MSIRUNMODE_LOGENABLED

The log file is active. It was enabled prior to the installation session.

MSIRUNMODE_OPERATIONS

Execute operations are in the determination phase.

MSIRUNMODE_REBOOTATEND

A reboot is necessary after a successful installation (settable).

MSIRUNMODE_REBOOTNOW

A reboot is necessary to continue the installation (settable).

MSIRUNMODE_CABINET

Files from cabinets and Media table files are installing.

MSIRUNMODE_SOURCESHORTNAMES

The source LongFileNames is suppressed through the PID_MSISOURCE summary property.

MSIRUNMODE_TARGETSHORTNAMES

The target LongFileNames is suppressed through the SHORTFILENAMES property.

MSIRUNMODE_RESERVED11

Reserved for future use.

MSIRUNMODE_WINDOWS9X

The operating system is a 9x version.

MSIRUNMODE_ZAWENABLED

The operating system supports demand installation.

MSIRUNMODE_RESERVED14

Reserved for future use.

MSIRUNMODE_RESERVED15

Reserved for future use.

MSIRUNMODE_SCHEDULED

A custom action called from install script execution.

MSIRUNMODE_ROLLBACK

A custom action called from rollback execution script.

MSIRUNMODE_COMMIT

A custom action called from commit execution script.

 

Return value

TRUE indicates the specific property passed into the function is currently set.

FALSE indicates the specific property passed into the function is currently not set.

Remarks

Note that not all the run mode values of iRunMode are available when calling MsiGetMode from a deferred custom action. For details, see Obtaining Context Information for Deferred Execution Custom Actions.

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

Header

Msiquery.h

Library

Msi.lib

DLL

Msi.dll

See also

Installer State Access Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft