从注册表获取 Windows 版本的可靠方法 [英] Reliable way to get Windows Version from registry

查看:39
本文介绍了从注册表获取 Windows 版本的可靠方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" "CurrentVersion"

根据这篇文章this page 来自 MSDN,Windows 10 的当前版本号应为 10.0.

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

我刚刚安装了 Windows 10 Pro Insider Preview,注册表中给出的版本号仍然是 6.3,而不是应该的 10.10.

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.

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

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

推荐答案

不是读取值 CurrentVersion,而是读取新值 CurrentMajorVersionNumber(即 10)和 CurrentMinorVersionNumber(即 0)在 Windows 10 下.那些 2 个键是Windows 10 中的新功能,可从注册表中检测 Windows 版本.

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.

这篇关于从注册表获取 Windows 版本的可靠方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆