SYSINFO

InstallShield 2020 » InstallScript Language Reference

During setup initialization, the installation sets the members of the SYSINFO structure variable to identify the operating platform of the target computer. By inspecting the values assigned to members of this variable, your script can determine information such as the following:

The operating system
The major and minor version number of the operating system
The subversion of the operating system
The version of Internet Explorer
The latest service pack that is installed
If the end user has administrator rights under Windows NT
If the end user is a power user
If the system is 64-bit
If the system is a virtual machine
The language IDs of the system language, user language, and operating system language

The following table shows the meaning of each SYSINFO member:

SYSINFO Members

Member

Meaning

SYSINFO.bIntel

If TRUE, the processor is Intel.

SYSINFO.bIsVirtualMachine

If TRUE, a virtual machine is detected.

For more information, see Detecting Whether the Installation Is Being Run on a Virtual Machine.

SYSINFO.bIsWow64

If the installation is running on a 64-bit platform, this value is non-zero.

SYSINFO.bShellExplorer

If TRUE, the shell is Explorer.

SYSINFO.bWinServer2003R2

If this member is TRUE, the operating system is Windows Server 2003 R2.

SYSINFO.nISOSL

Value indicates the operating system of the target machine. Possible values are the following:

ISOSL_WINXP—Windows XP Edition
ISOSL_WINSERVER2003—Windows Server 2003
ISOSL_WINVISTA_SERVER2008 (or ISOSL_WINVISTA)—Note that Windows Vista and Windows Server 2008 use the same major and minor version numbers. Therefore, if you want to use InstallScript to distinguish between Windows Server 2008 and Windows Vista, check whether SYSINFO.nOSProductType = VER_NT_WORKSTATION; for Windows Vista, this is TRUE; for Windows Server 2008, it is FALSE.
ISOSL_WIN7_SERVER2008R2—Windows 7 or Windows Server 2008 R2
ISOSL_WIN8—Windows 8 or Windows Server 2012
ISOSL_WIN81—Windows 8.1 or Windows Server 2012 R2
ISOSL_WIN10—Windows 10 or Windows Server 2016

Note:Several client and server versions of Windows use the same major and minor version numbers:

Windows 8.1 and Windows Server 2012 R2 use the same major and minor version numbers.
Windows 8 and Windows Server 2012 use the same major and minor version numbers.
Windows 7 and Windows Server 2008 R2 use the same major and minor version numbers.
Windows Vista and Windows Server 2008 have the same major and minor version numbers.

Therefore, for these operating system versions, the installation considers the client versions to be the same as the equivalent server versions; thus, components that are marked for the client version are also installed on the server version. To distinguish between the client and server versions, you can check whether SYSINFO.nOSProductType is equal to VER_NT_WORKSTATION; on client versions, this is true. On server versions, this is false.

SYSINFO.nOSMajor

Value indicates operating system's major version number.

SYSINFO.nOSMinor

Value indicates operating system's major version number.

SYSINFO.nOSProductType

Value indicates the wProductType of the Windows OSVERSIONINFOEX structure as defined for the current platform. Possible values are the following:

VER_NT_WORKSTATION
VER_NT_DOMAIN_CONTROLLER
VER_NT_SERVER

You can also #define and test for any other constant supported by wProduct Type. To learn more, see OSVERSIONINFOEX Structure on the MSDN Web site.

SYSINFO.nOSSuiteMask

Value indicates the wSuitesMask of the Windows OSVERSIONINFOEX structure as defined for the current platform. Possible values are the following:

VER_SUITE_BACKOFFICE
VER_SUITE_DATACENTER
VER_SUITE_ENTERPRISE
VER_SUITE_PERSONAL
VER_SUITE_SMALLBUSINESS
VER_SUITE_SMALLBUSINESS_RESTRICTED
VER_SUITE_TERMINAL

You can also #define and test for any other constant supported by wSuiteMask. To learn more, see OSVERSIONINFOEX Structure on the MSDN Web site.

SYSINFO.nSuites

A combination of one or more bit flags that indicate the suite or suites on the target machine. Possible bit flags are the following:

ISOS_ST_ALL
ISOS_ST_XP_PRO
ISOS_ST_XP_HOME
ISOS_ST_SERVER
ISOS_ST_SERVER2003_R2
ISOS_ST_WORKSTATION
ISOS_ST_BACKOFFICE
ISOS_ST_DATACENTER
ISOS_ST_ENTERPRISE
ISOS_ST_SERVER2003_R2
ISOS_ST_SMALLBUSINESS
ISOS_ST_SMALLBUSINESS_RESTRICTED
ISOS_ST_TERMINAL
0 (zero)—indicates that no suite is detected on the target machine

To check whether a bit flag is set, use the bitwise AND (&) operator as in the following example:

if (SYSINFO.nSuites & ISOS_ST_XP_HOME) then

    /* Perform operations that are

    specific to Windows XP Home Edition. */

endif;

Note:The suites listed here are those that can be specified in the Windows API's OSVERSIONINFOEX data structure.

SYSINFO.nSystemDefaultUILangID

Value indicates the installed operating system language's ID.

SYSINFO.nSystemLangID

Value indicates the system language's ID.

SYSINFO.nUserLangID

Value indicates the user language's ID.

SYSINFO.nWinMajor

Value indicates Windows major version number.

SYSINFO.nWinMinor

Value indicates Windows minor version number.

SYSINFO.szInstalledIEVersion

Value indicates the Internet Explorer version on the system. This member is supported for versions 4 and later. If the version installed is earlier than 4, the value is null ("").

Note:Do not rely on the fact that this value is null for versions earlier than 4. Instead, test specifically for 4 or later, since in the future, this member variable could support detecting Internet Explorer versions earlier than 4.

SYSINFO.WINNT.bAdmin_Logged_On

If this member is TRUE, the end user is logged on under NT with administrator rights.

SYSINFO.WINNT.bPowerUser_Logged_On

If this member is TRUE, the current user belongs to the power user group.

SYSINFO.WINNT.bWin10

Note:This member is applicable to event-based InstallScript code; it is not applicable to InstallScript custom actions.

If this member is TRUE, the operating system is Windows 10 or Windows Server 2016.

SYSINFO.WINNT.bWin81

Note:This member is applicable to event-based InstallScript code; it is not applicable to InstallScript custom actions.

If this member is TRUE, the operating system is Windows 8.1 or Windows Server 2012 R2.

SYSINFO.WINNT.bWin8

Note:This member is applicable to event-based InstallScript code; it is not applicable to InstallScript custom actions.

If this member is TRUE, the operating system is Windows 8 or Windows Server 2012.

SYSINFO.WINNT.bWin7_Server2008R2

Note:This member is applicable to event-based InstallScript code; it is not applicable to InstallScript custom actions.

If this member is TRUE, the operating system is Windows 7 or Windows Server 2008 R2.

SYSINFO.WINNT.bWinNT

If this member is TRUE, the operating system is Windows NT (includes Windows XP).

SYSINFO.WINNT.bWinVista_Server2008
(SYSINFO.WINNT.bWinVista)

If either SYSINFO.WINNT.bWinVista_Server2008 or SYSINFO.WINNT.bWinVista is TRUE, the operating system is Windows Vista or Windows Server 2008.

To distinguish between Windows Server 2008 and Windows Vista, check whether SYSINFO.nOSProductType is equal to VER_NT_WORKSTATION; for Windows Vista, this is TRUE; for Windows Server 2008, it is FALSE.

SYSINFO.WINNT.bWinXP

If this member is TRUE, the operating system is Windows XP.

SYSINFO.WINNT.bWinServer2003

If this member is TRUE, the operating system is Windows Server 2003 or Windows Server 2003 R2.

SYSINFO.WINNT.nServicePack

The number of the installed service pack.

The installation obtains this information by calling the Windows API GetVersionEx and reading the nServicePackMajor value.

SYSINFO.WINNT.bWinServer2019

Returns TRUE in Windows Server 2019 else FALSE.

SYSINFO.nOSBuildNo

Stores the operating system build number

SYSINFO.nISOSL

Returns ISOSL_WIN10_SERVER2019 in Windows Server 2019.

Example

The following code fragment displays a message box if the operating system on the target system is Windows XP.

    if (SYSINFO.WINNT.bWinXP) then

        MessageBox("Installing on Windows XP",INFORMATION);

    endif;