PDA

View Full Version : Does System.GetOSName() return "" when a SUF7 runs on a Win7 box



lclague
12-07-2009, 06:35 PM
According to SUF7 documentation...

System.GetOSName () Returns: (string) A string containing the name of the OS the user is running on their system. If this action fails, a blank string "" is returned.

You can use Application.GetLastError to determine whether this action failed, and why.

If Application.GetLastError Returns: 1800 = "Could not get the OS Version information."


Questions:

In SUF7...Does System.GetOSName() return "" when a SUF7 runs on a Win7 box ?

Does Application.GetLastError() return 1800 when System.GetOSName() returns "" ?

jassing
12-07-2009, 08:42 PM
Windows 7 did not exist even as a beta when suf7 was out. So how could it?

Your best be would be to use the windows api to get the version #'s and figure out if it's win7 based on that.


Of ourse, the easist solution is to upgrade to suf8.

Ulrich
12-07-2009, 08:44 PM
In SUF7...Does System.GetOSName() return "" when a SUF7 runs on a Win7 box ?

Yes.


Does Application.GetLastError() return 1800 when System.GetOSName() returns "" ?

No.

You can use System.GetOSVersionInfo() to retrieve the version, which is 6.1.7100 for the RC and 6.1.7600 for the current release of Windows 7.

Ulrich

jassing
12-07-2009, 10:13 PM
When I said "use the windows api" -- I (internally) implied using:

System.GetOSVersionInfo().MajorVersion
System.GetOSVersionInfo().MinorVersion
and
System.GetOSVersionInfo().ProductType

with those 3, you should be able to tell a win7 system.

I don't recall the values off the top of my head....

-josh

lclague
12-08-2009, 11:03 AM
Thanks.

I'll probably do the upgrade to SUF8...just needed a quick fix to resolve an app problem related to XP/Vista/7.