SYSINFO
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:
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:
Note:Several client and server versions of Windows use 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:
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:
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:
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.bWin11 |
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 11. |
||||||||||||||||||||||||||||||||||||||||||
SYSINFO.WINNT.bWinServer2022 |
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 Server 2022. |
||||||||||||||||||||||||||||||||||||||||||
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 |
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;