MsiSetMode function (msiquery.h)

The MsiSetMode function sets an internal engine Boolean state.

Syntax

UINT MsiSetMode(
  [in] MSIHANDLE  hInstall,
  [in] MSIRUNMODE eRunMode,
  [in] BOOL       fState
);

Parameters

[in] hInstall

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

[in] eRunMode

Specifies the run mode. This parameter must be one of the following values. While there are many values for this parameter, as described in MsiGetMode, only one of the following values can be set.

Value Meaning
MSIRUNMODE_REBOOTATEND
A reboot is necessary after a successful installation.
MSIRUNMODE_REBOOTNOW
A reboot is necessary to continue installation.

[in] fState

Specifies the state to set to TRUE or FALSE.

Return value

This function returns UINT.

Requirements

Requirement Value
Minimum supported client 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
Target Platform Windows
Header msiquery.h
Library Msi.lib
DLL Msi.dll

See also

Installer State Access Functions