PDA

View Full Version : Testing for Window version range



NewsArchive
04-02-2008, 06:22 AM
I discovered my attempts to test for "All windows after NT..." were
coming unstuck because $WIN_NT$ (and the others) do not reflect the
Microsoft version numbers (i.e $WIN_XP$ = 64; $WIN_VISTA$ = 256...)...

Is there a 'proper' way to test for a range of versions, or do I use
logical/binary expressions to test bits?

Thanks,

John Newman
Software Partners Australia

NewsArchive
04-02-2008, 06:22 AM
Hi John,

>I discovered my attempts to test for "All windows after NT..." were
> coming unstuck because $WIN_NT$ (and the others) do not reflect the
> Microsoft version numbers (i.e $WIN_XP$ = 64; $WIN_VISTA$ = 256...)...
>
> Is there a 'proper' way to test for a range of versions, or do I use
> logical/binary expressions to test bits?

What about this (if your app needs NT and greater)

If %WINVER% Less Than "$WIN_NT$" Then
! Sorry, you need at least Windows NT
End

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-02-2008, 06:23 AM
> If %WINVER% Less Than "$WIN_NT$" Then
> ! Sorry, you need at least Windows NT
> End


In one case I was looking for Vista or later, but %WINVER% >=
$WIN_VISTA$ was true for XP because '64' is greater than '256'...

Is there a way I can force numeric comparisons (and are the $WIN...
constants always bigger for later Windows releases)?

Thanks,

John Newman
Software Partners Australia

NewsArchive
04-02-2008, 06:23 AM
> In one case I was looking for Vista or later, but %WINVER% >=
> $WIN_VISTA$ was true for XP because '64' is greater than '256'...
>
> Is there a way I can force numeric comparisons (and are the $WIN...
> constants always bigger for later Windows releases)?

To look for Vista or later:

If %WINVER% Less Than "$WIN_VISTA$" Then
! Sorry, you are not running Vista or Windows Server 2008
End

And of course, you can use "Get System Information" to build your own logic.
The function supports Major Windows Version, Minor Windows Version, Service
Pack Number, Windows Product Type, Windows Suit Mask.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
04-02-2008, 06:24 AM
> To look for Vista or later:

Well Friedrich, my original code works now. I don't know what happened.
Sorry to waste your time. :-!


John Newman
Software Partners Australia

NewsArchive
04-02-2008, 06:24 AM
> Well Friedrich, my original code works now. I don't know what happened.
> Sorry to waste your time. :-!

Great :) I'm glad it is working now.

Friedrich