Need a guaranteed way to check if user is running Vista

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ocean
Posts: 16
Joined: Wed May 03, 2006 4:29 am

Need a guaranteed way to check if user is running Vista

Post by Ocean » Thu Feb 21, 2008 8:14 pm

A thread in the mailing list mentions that if the systemVersion returns "NT 6.0" then the user is running Windows Vista.

However, it appears certain Windows XP Pro builds also return "NT 6.0" as the systemVersion!

Is there a better way to check for Vista?

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Thu Feb 21, 2008 8:54 pm

You can check the registry entries under the following keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion, CurrentVersion
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion, ProductName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion, CurrentBuildNumber
using the queryRegistry in Rev

Code: Select all

queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion") 
queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName")
queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber")
For a mostly correct list of windows versions and names, you can visit my old an not updated since early 2004 page at:

http://www.paraboliclogic.com/Windows_V ... mation.htm

I don't have a Vista install right now to check what informatin is given back from Vista, but I'm pretty sure that the "ProductName" will not retrun "Windows XP Home" or otherwise on a Vista system. And of course if it returns nothing, then it's likely a 95 through ME system since the reg entry path is different.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Feb 21, 2008 8:54 pm

Ocean,

Which XP Pro builds are those, exactly?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Ocean
Posts: 16
Joined: Wed May 03, 2006 4:29 am

Post by Ocean » Sat Feb 23, 2008 1:15 am

Garrett:

Thanks for the info! We are now using the "ProductName" and it appears to work great. Vista systems return strings like this: "Windows Vista (TM) Home Premium" :)

Mark:

No idea which builds they are, but we've only received 2 reports so far and are attempting to obtain more info regarding the specific builds.

Post Reply

Return to “Talking LiveCode”