MsiSetInstallLevel function

The MsiSetInstallLevel function sets the installation level for a full product installation.

Syntax

UINT MsiSetInstallLevel(
  MSIHANDLE hInstall,
  int       iInstallLevel
);

Parameters

hInstall

Handle to the installation that is provided to a DLL custom action or obtained by using MsiOpenPackage, MsiOpenPackageEx, or MsiOpenProduct.

iInstallLevel

The installation level.

Return Value

The MsiSetInstallLevel function returns one of the following values:

Remarks

The MsiSetInstallLevel function sets the following:

  • The installation level for the current installation to a specified value.
  • The Select and Installed states for all features in the Feature table.
  • The Action state of each component in the Component table, based on the new level.
For any installation, there is a defined install level, which is an integral value from 1 to 32,767. The initial value is determined by the INSTALLLEVEL property, which is set in the Property Table.

If 0 (zero) or a negative number is passed in the iInstallLevel parameter, the current installation level does not change, but all features are still updated based on the current installation level. For more information, see Calling Database Functions From Programs.

If the function fails, you can obtain extended error information by using MsiGetLastErrorRecord.

Requirements

   
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 Selection Functions