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: InstallScript Question
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
‎Jul 17, 2013
05:00 AM
InstallScript Question
Hi,
I have an old VB6 Install Script project and I want to allow setup to run only on the following operating systems:
Windows XP, Windows Server 2003
Windows Vista, Windows Server 2008
Windows 7, Windows Server 2008 R2
Windows 8, Windows Server 2012
Windows 8.1, Windows Server 2012 R2
Since the newer Windows versions are not listed there, I have wrote a code, is this correct?
-------------
Before Move Data > On Begin
-------------
BOOL osAccept;
osAccept = FALSE;
if (SYSINFO.nOSMajor = 5) then
if (SYSINFO.nOSMinor = 1) || (SYSINFO.nOSMinor = 2) then
osAccept = TRUE;
endif;
endif;
if (SYSINFO.nOSMajor = 6) then
if (SYSINFO.nOSMinor = 0) || (SYSINFO.nOSMinor = 1) || (SYSINFO.nOSMinor = 2) || (SYSINFO.nOSMinor = 3) then
osAccept = TRUE;
endif;
endif;
if osAccept = FALSE then
MessageBox("Application is not compatible with the current operating system.", SEVERE);
abort;
endif;
I have an old VB6 Install Script project and I want to allow setup to run only on the following operating systems:
Windows XP, Windows Server 2003
Windows Vista, Windows Server 2008
Windows 7, Windows Server 2008 R2
Windows 8, Windows Server 2012
Windows 8.1, Windows Server 2012 R2
Since the newer Windows versions are not listed there, I have wrote a code, is this correct?
-------------
Before Move Data > On Begin
-------------
BOOL osAccept;
osAccept = FALSE;
if (SYSINFO.nOSMajor = 5) then
if (SYSINFO.nOSMinor = 1) || (SYSINFO.nOSMinor = 2) then
osAccept = TRUE;
endif;
endif;
if (SYSINFO.nOSMajor = 6) then
if (SYSINFO.nOSMinor = 0) || (SYSINFO.nOSMinor = 1) || (SYSINFO.nOSMinor = 2) || (SYSINFO.nOSMinor = 3) then
osAccept = TRUE;
endif;
endif;
if osAccept = FALSE then
MessageBox("Application is not compatible with the current operating system.", SEVERE);
abort;
endif;
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 17, 2013
09:25 AM
There are many different ways to approach this issue. In my case I have rather specific tests for certain service pack levels and certain editions of the OS which I test on OnBegin. However in your case it appears that all you really need to test is that the OS is not pre-Windows XP, since you are accepting every variation of operating systems since XP. So why not simplify your test to:
BOOL osAccept;
osAccept = TRUE;
/*accept any version of OS 5.1 or later, reject Win 2K or earlier*/
if ((SYSINFO.nOSMajor = 5) && (SYSINFO.nOSMinor < 1) || (SYSINFO.nOSMajor < 5)) then
osAccept = FALSE;
endif;
if osAccept = FALSE then
MessageBox("Application is not compatible with the current operating system.", SEVERE);
abort;
endif;
I did not look at Win 8.1 yet to see how the version information is defined in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion.
Generally I would not create a test for a specific version of a future OS, rather I would use < or > than to allow my setup to run on all future versions until I know of a problem that needs to be addressed. In an InstallScript project you can indicate which versions of the OS are not supported under Project Setting Platform tab.
BOOL osAccept;
osAccept = TRUE;
/*accept any version of OS 5.1 or later, reject Win 2K or earlier*/
if ((SYSINFO.nOSMajor = 5) && (SYSINFO.nOSMinor < 1) || (SYSINFO.nOSMajor < 5)) then
osAccept = FALSE;
endif;
if osAccept = FALSE then
MessageBox("Application is not compatible with the current operating system.", SEVERE);
abort;
endif;
I did not look at Win 8.1 yet to see how the version information is defined in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion.
Generally I would not create a test for a specific version of a future OS, rather I would use < or > than to allow my setup to run on all future versions until I know of a problem that needs to be addressed. In an InstallScript project you can indicate which versions of the OS are not supported under Project Setting Platform tab.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2013
06:26 AM
Thanks dude,
So it means if I just wanna install on said operating systems and prevent future ones my code is also correct?
So it means if I just wanna install on said operating systems and prevent future ones my code is also correct?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2013
09:01 AM
I do not know what the version values at the registry key indicated are set to for Windows 8.1 or Windows Server 2012 R2, or if 6.3 has been confirmed to be the correct value. Other than that the code will have the effect that you indicated to block any version not specifically listed in the code.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)