Search code examples
windowsregistrynsiswindows-10version-detection

Reliable way to get Windows Version from registry


I'm checking the windows version in an installer (made with NSIS) by checking the following registry key:

HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"

According to this post and this page from MSDN, the currentVersion number for Windows 10 should be 10.0.

I just installed the Windows 10 Pro Insider Preview and the version number given in the registry is still 6.3, instead of 10.10 as it should.

Is there another reliable way in registry to detect Windows 10?


Solution

  • Instead of reading the value CurrentVersion, read the new values CurrentMajorVersionNumber (which is 10) and CurrentMinorVersionNumber (which is 0) under Windows 10. Those 2 keys are new in Windows 10 to detect Windows Version from Registry.