caveat on detecting major/minor OS version without an application manifest

Posted by Fiendish on Thu 09 Nov 2017 06:19 PM — 5 posts, 20,054 views.

USA Global Moderator #0
https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx

says:
Quote:
In Windows 8.1 and Windows 10, the GetVersion and GetVersionEx functions have been deprecated. In Windows 10, the VerifyVersionInfo function has also been deprecated. While you can still call the deprecated functions, if your application does not specifically target Windows 8.1 or Windows 10, you will get Windows 8 version (6.2.0.0).


So until an application manifest gets added, it looks like Windows 8.1 and 10 will misreport their versions in GetInfo(265) and GetInfo(266)
Amended on Thu 09 Nov 2017 06:56 PM by Fiendish
USA Global Moderator #1
https://github.com/nickgammon/mushclient/pull/39/commits/53bbda9e39b69647e45f53418e1fa77261581f03

I hope this is correct. I've never embedded a manifest before.
Australia Forum Administrator #2
I seem to recall doing that before, which had side-effects. See: http://www.gammon.com.au/forum/?id=4782
USA Global Moderator #3
Yeah but then you made code changes to address some visual glitches. I don't know if they fully resolved those issues or not. I think it would be fine to remove the bottom dependency section in the manifest. The important part of the manifest is the compatibility block, which is what gets GetVersion to stop lying about the OS, and from testing it seems to need to be embedded in the executable and doesn't work just as its own file.
Amended on Fri 10 Nov 2017 08:52 PM by Fiendish
USA Global Moderator #4
I've amended the proposed manifest to delete that section.