This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Problem while getting OS version in Installscript using Installshield 2012 spring
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 26, 2014
07:36 AM
Problem while getting OS version in Installscript using Installshield 2012 spring
Hi
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)
else
MessageBox("Not Windows 7 OS", INFORMATION)
endif;
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?
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)
else
MessageBox("Not Windows 7 OS", INFORMATION)
endif;
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?
- Tags:
- osversion
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 29, 2014
06:52 AM
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
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.
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 21, 2021
05:00 AM
can i get code example to allow install for above windows 7?