18

We're detecting the OS version for statistics. Starting with Windows 8.1, the OS "lies" about its version when using GetVersion. However, System.Environment.OSVersion still calls this API as of .NET 4.5.1. As such, we've added 8.1's GUID to the manifest, which works great.

Now, I'd like to prepare the same for Windows 10. Is the GUID for this known yet?

(edit) P/Invoking VerSetConditionMask and VerifyVersionInfo to check for 6.4 or greater does appear to work.

Sören Kuklau
  • 19,454
  • 7
  • 52
  • 86
  • For a better approach when collecting statistics, see http://stackoverflow.com/a/25986612/886887 – Harry Johnston Oct 01 '14 at 22:18
  • While that would probably work, it seems quite a dirty hack, and would also mean that the app doesn't assert compatibility with the new OS to Program Compatibility Assistant. – Sören Kuklau Oct 01 '14 at 22:48
  • If it was known, it would be subject to change. – Peter Ritchie Oct 01 '14 at 23:26
  • It's the documented method. Also, you probably shouldn't tell the PCA that your application is compatible with Windows 10 when you haven't actually tested it yet. :-) – Harry Johnston Oct 02 '14 at 00:01
  • "If it was known, it would be subject to change." — true, but the whole point for developer previews is to be able to prepare in time. – Sören Kuklau Oct 02 '14 at 18:37

2 Answers2

26
<!-- This Id value indicates the application supports Windows Threshold functionality-->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>

Source: http://social.msdn.microsoft.com/Forums/azure/en-US/07cbfc3a-bced-45b7-80d2-a9d32a7c95d4/supportedos-manifest-for-windows-10?forum=windowsgeneraldevelopmentissues

GoaLitiuM
  • 276
  • 3
  • 2
  • 7
    See [Manifest Madness](http://blogs.msdn.com/b/chuckw/archive/2013/09/10/manifest-madness.aspx). – Chuck Walbourn Dec 05 '14 at 21:29
  • [New link "Manifest Madness"](https://walbourn.github.io/manifest-madness/) (perhaps someone can fix up the above comment and remove mine?) – 0xC0000022L Mar 13 '22 at 19:20
8

Other GUIDs for other OS contexts:

OS GetVersionEx supportedOS Id
Windows 11 not tested <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> (same as Windows 10)
Windows 10 10.0† (6.4 prior to build 9926) <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
Windows 8.1 6.3 <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
Windows 8 6.2 <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
Windows 7 6.1 <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
Windows Vista 6.0 <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
Windows XP 5.1 n/a
Windows 2000 5.0 n/a
Windows NT 4 4.0 n/a
Windows NT 3.51 3.51 n/a
Windows NT 3.1 3.1 n/a

† was version 6.4 prior to build 9926. It reports 10.0 after build 9926 (23 January 2015).

The page that maintains the documentation for these values:

OS Contexts

When running on Windows 10 under a particular OS context, the versions returned are:

OS Context GetVersionEx
Windows Vista 6.2
Windows 7 6.2
Windows 8 6.2
Windows 8.1 6.3
Windows 10 10.0 (6.4 prior to build 9926)
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • 1
    For Windows 10 `GetVersionEx` returns `10.0` not `6.4`. see: https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions – kobik May 17 '17 at 09:44
  • UP TO DATE INFO: It looks like Window 11 uses the same guid as Win 10, see: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests?redirectedfrom=MSDN – Slappy May 22 '22 at 17:53