Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Identify OS version
Message
From
27/06/2014 16:46:21
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Identify OS version
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01602753
Message ID:
01602753
Views:
68
Noticed in various places that it shows that the OS() function returns 6.02 for Windows 8.1 and Server 2012R2, unless you specifically target for Win8.1 by specifying settings in the manifest file.
Further searching led to information indicating that the GetVersion() and GetVersionEx() apis have been superceded
http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx

Ah well... wait... those "functions" are defined in versionhelpers.h -- which Microsoft describes as API functions, but on further examination elsewhere, it appears that they could be used as such, but are in reality macros that are expanded to that calls various other API functions... ... and this versionhelpers.h only exists if you have the windows 8.1 SDK installed... .. and sometimes it doesn't work as this file includes the presence of some other files (of which I can't seem to get clear story on what).... ugh.

So... it appears that in various places people have gone and worked some of it out (at least for currently released versions of Windows ... as of 2014...)
http://www.codeproject.com/Articles/678606/Part-Overcoming-Windows-s-deprecation-of-GetVe
http://jpetermugaas.com/versionhelpers.html

Gee... and all wanted to get was the version of the OS... How complicated does this have to get?

This is looking to be even more convoluted than what one had to do back in DOS days when there was the DOSVER command that could be used to get the OS to essentially lie about itself to applications... And to work around that you had to do some probing in a few areas, just to make sure that DOS wasn't "lying" to you... gak!

Apparently it seems that the motivation for this is because there have been some programs that incorrectly checked OS version, and Microsoft was trying to get ways to make the OS compatible with these applications....
Next
Reply
Map
View

Click here to load this message in the networking platform