Jump to content
Sign in to follow this  
Vadersapien

@OSVersion Trouble

Recommended Posts

Vadersapien

Hello everyone,

I have an Issue with @OSVersion...it works fine like this:

If @OSVERSION = 'WIN_VISTA' Then
    GUICtrlSetImage($Sync_Button, 'imageres.dll', 147, 1)
    GUICtrlSetImage($Settings_Button, 'imageres.dll', 114, 1)
Else
    GUICtrlSetImage($Sync_Button, 'shell32.dll', 19, 1)
    GUICtrlSetImage($Settings_Button, 'shell32.dll', 330, 1)
EndIf

But not like this:

If @OSVERSION >= 'WIN_VISTA' Then
    GUICtrlSetImage($Sync_Button, 'imageres.dll', 147, 1)
    GUICtrlSetImage($Settings_Button, 'imageres.dll', 114, 1)
Else
    GUICtrlSetImage($Sync_Button, 'shell32.dll', 19, 1)
    GUICtrlSetImage($Settings_Button, 'shell32.dll', 330, 1)
EndIf

:)

Edited by Vadersapien

Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.

Share this post


Link to post
Share on other sites
Authenticity

It should be >= and for less than or equal <=.

Edited by Authenticity

Share this post


Link to post
Share on other sites
Vadersapien

It should be >= and for less than or equal <=.

Whoops...typo...I actually already had it like that...

Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.

Share this post


Link to post
Share on other sites
GEOSoft

> is a math operator and @OSVersion returns a string.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Vadersapien

How would I detect if the OS version is equal to or greater that Windows Vista then?


Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.

Share this post


Link to post
Share on other sites
BrettF
Richard Robertson

I wonder how difficult it would be to get the version number. Like how XP is 5. 7 is well, 7.

They've all got "core" version numbers.

Share this post


Link to post
Share on other sites
Vadersapien

I wonder how difficult it would be to get the version number. Like how XP is 5. 7 is well, 7.

They've all got "core" version numbers.

Actually Windows 7 is 6.1.7600.

And I wonder if there is a way to get the kernel version?

If (@OS_VERSION = "VISTA") OR (@OS_VERSION = "WINDOWS_7") Then ... do stuff.

Does the current stable detect Windows 7 as 7...I've heard it identifies it as Vista...

Do the beta builds correctly detect 7?

Also what OSes contain imageres.dll?

Edited by Vadersapien

Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.

Share this post


Link to post
Share on other sites
GEOSoft

Actually Windows 7 is 6.1.7600.

And I wonder if there is a way to get the kernel version?

Does the current stable detect Windows 7 as 7...I've heard it identifies it as Vista...

Do the beta builds correctly detect 7?

Also what OSes contain imageres.dll?

imageres.dll first appeared in Vista. That's why what you had worked even if the If statement was removed.

Also Win 7 is correctly identified as Windows_7 in the Beta but I can't remember when that was fixed. I'm pretty sure the release version still detects it as Vista.

To get the Kernel version you could always use

Global Const $2K_VER = 5.0
Global Const $XP_VER = 5.1
Global Const $XP64_VER = 5.2
Global Const $VISTA_VER = 6.0
Global Const $W7_VER = 6.1

$iCurrVer = RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentVersion")
If iCurrVer > $XP_VER Then
    ;; Do something
EndIf

Edit: Changed a FileGetVersion() to the RegRead()

I'm sure there is a way to get the installed version from a DLL call as well but someone else will have to come along with that.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
rajeshontheweb
rajeshontheweb
GEOSoft

Wouldn't it be easier to use @OSBuild ?

That returns the build number which I'm not sure could always be considered a reliable test. It could probably be made a bit more reliable by checking the minimum build for a given version and building another table of Constants to go along with it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
GEOSoft

Only problem I can see is Windows Neptune, but seriously, how many uses that?

If they are using that old dog then the user has more problems than just getting the version number.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Richard Robertson

Why is Windows 7 the same version number as Vista?

Share this post


Link to post
Share on other sites
AdmiralAlkex

Why is Windows 7 the same version number as Vista?

Because it's only a minor upgrade to Vista, just like XP was to 2000.

Windows 2000 = NT 5.0

Windows XP = NT 5.1

Windows Vista = NT 6.0

Windows 7 = NT 6.1

;)

Or did you mean something else? :)

Share this post


Link to post
Share on other sites
GEOSoft

Why is Windows 7 the same version number as Vista?

The major version number is the same but the Minor version differs. That is often the case and even wose is that occasional situation where both the Major and Minor are the same. Then you have to also check the build number. I think such is the case with XP 64bit and Server 2003, both show as 5.2

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Richard Robertson

I figured that Windows 7 was named that way because it was version 7. If not, where did that number come from?

Share this post


Link to post
Share on other sites
GEOSoft

I knew this discussion was coming again. Up until Win 95 came along, the numbers used in the NAME were the same as the major version number and sometimes the minor version, e.g.Windows 2 or Windows 3.1. Starting with Windows 95 they changed the naming convention to reflect the year it was (supposed to be) released. I won't get into NT naming, thats another whole ball of wax. Beginning with Windows (e)XP(erience) the names have nothing to do with either the year or the version, they are simply the NAME of the OS.

Edit: Clear as mud yet? Lets just put it down to some quirky ideas by Microsoft. By the way, it gets even worse if you start looking at the project names.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.