从注册表中获取Windows版本的可靠方法

sku*_*lpa 10 windows registry nsis version-detection windows-10

我正在通过检查以下注册表项来检查安装程序(由NSIS制作)中的Windows版本:

HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"
Run Code Online (Sandbox Code Playgroud)

根据这篇文章和MSDN的这个页面,Windows 10的当前版本号应该是10.0.

我刚刚安装了Windows 10 Pro Insider预览版,注册表中给出的版本号仍为6.3,而不是10.10.

在注册表中是否有另一种可靠的方法来检测Windows 10?

mag*_*981 14

不是读取值CurrentVersion,而是在Windows 10下读取新值CurrentMajorVersionNumber(10)和CurrentMinorVersionNumber(0).这两个键在Windows 10中是新的,用于从Registry中检测Windows版本.