1

It appears that the version info functions in the Win32 API that I know and love have changed their behavior. GetVersionEx now return what the program's manifest is set for, not the actual version.

The new function IsWindows10OrGreater seems pointless since it is only available on windows 10 or greater, so if the program includes it and successfully links it will always return TRUE.

But, in an installer or similar program, how does it determine whether the current environment really is Windows 10 or greater? It needs this to know what to download or which options to set up for other programs.

JDługosz
  • 5,592
  • 3
  • 24
  • 45
  • Have a look at this: http://stackoverflow.com/questions/31072543/reliable-way-to-get-windows-version-from-registry I once saw an even better approach here on SO but wasnt able to find it again – Marged Dec 31 '15 at 11:42
  • See also: http://stackoverflow.com/questions/33566988/ – Remy Lebeau Dec 31 '15 at 21:21

1 Answers1

2

Your premise is false. The IsWindows10OrGreater function is a macro, so provided you are using a suitably recent version of the SDK the compiled program will work on all currently supported versions of Windows. (As well as Windows XP and I think even Windows 2000.)

(Of course, this mistake is understandable, since the documentation is wrong.)

Note that the program's manifest must still indicate that it supports Windows 10 in order for the macro to work.

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
  • Doc is wrong: so it doesn't actually return 8, but still returns the actual older version if called on such a version. That only makes sense, but it makes me realize how poorly written it is. – JDługosz Dec 31 '15 at 12:14
  • Windows 8 is actually version 6.2 (sort of). You can write your own function for `IsWindows10orGreater`. See also this answer: http://stackoverflow.com/a/34326017/4603670 – Barmak Shemirani Dec 31 '15 at 21:57