[Incident]: Some users report they are unable to access the case portal. Please see this community notice for more information.

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

Problem while getting OS version in Installscript using Installshield 2012 spring

I'm creating an installable for which I need to know version of Operating System where setup will be installed. I tried to use many API's like VersionNT, SYSINFO.nWinMajor, SYSINFO.nWinMinor, GetSystemInfo. But still I'm not getting correct OS version. If I use following code, then I get error, VersionNT, undefined identifier.
ex. if (VersionNT == 601) then
MessageBox("Windows 7 OS", INFORMATION)
MessageBox("Not Windows 7 OS", INFORMATION)

If I use SYSINFO.nWinMajor, SYSINFO.nWinMinor then I get minor version as 0. So eventhough my OS is win 7, it displays message box "Not Windows 7 OS".

Let me know what's solution for this?
Labels (1)
0 Kudos
2 Replies
Level 13

VersionNT is for a Windows Installer / MSI installer. It is a public property supplied by the engine and cannot be utilized in a basic InstallScript installer.

SYSINFO.nOSMajor should be returning your value for you. Usually you can do the following
nOSVersion = SYSINFO.nOSMajor * 100 + SYSINFO.nOSMinor
. On windows 7 and server 2008 R2 this should provide 601.

To distinguish between a server class and workstation class check SYSINFO.nOSProductType.

Looking at what you typed above, it looks like you are trying to integrate WinAPI code where InstallShield already gives you the required information in their own wrapper. If you really want to utilize the windows API then you have to be sure you populate the structure before calling the members. The InstallShield solution wraps that structure for you and handles populating the values. Check out the help document for InstallShield and SYSINFO.
0 Kudos
Level 3

can i get code example to allow install for above windows 7? 

0 Kudos