windows 如何确定计算机是否正在运行 XP Service Pack 3
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/862940/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I determine if a computer is running XP Service pack 3
提问by Duncan Edwards
Using either the registry or the file system. The reason for the restriction is that I am doing this as an MSI conditional statement.
使用注册表或文件系统。限制的原因是我这样做是作为 MSI 条件语句。
Cheers!
干杯!
采纳答案by kloucks
under registry key
在注册表项下
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
look for key pair:
寻找密钥对:
CurrentVersion = Microsoft Windows NT 5.1.2600 Service Pack 3
当前版本 = Microsoft Windows NT 5.1.2600 Service Pack 3
回答by em70
You should find enough information to determine the OS service pack (in the worst case you can always use the build string) in the following registry key:
您应该在以下注册表项中找到足够的信息来确定操作系统服务包(在最坏的情况下,您始终可以使用构建字符串):
HKLM\Software\Microsoft\Windows NT\CurrentVersion
回答by Kevin Kibler
If you're using an MSI, you should be able to use the VersionNTand ServicePackLevelproperties right in the conditional statement.
如果您使用的是 MSI,您应该能够直接在条件语句中使用VersionNT和ServicePackLevel属性。
eg. The following code checks for Windows XP sp3 or greater:
例如。以下代码检查 Windows XP sp3 或更高版本:
VersionNT=501 And ServicePackLevel>2
You can also check the WindowsBuildproperty if you also need the build number.
如果您还需要内部版本号,还可以检查WindowsBuild属性。
回答by Jason Owen
The VerifyVersionInfofunction should allow you to check the version of Windows being run meets your application's requirements, without the pitfalls that can occur with checking for an exact version with GetVersionEx(such as breaking on major version changes - your application will most likely run on Vista, and Windows 7, and future versions not yet developed).
该VerifyVersionInfo功能应该允许你检查的Windows正在运行的版本满足你的应用程序的要求,而不能够与检查用一个确切的版本出现的陷阱GetVersionEx(如打破主要版本的变化-在Vista应用程序将最有可能运行、Windows 7 以及尚未开发的未来版本)。
回答by Jimbo66
"Run" (Windows key + r or start/run) msinfo32 or sysdm.cpl
“运行”(Windows 键 + r 或开始/运行)msinfo32 或 sysdm.cpl