返回列表 回复 发帖

关于xp sp3版本检测问题

我为xp sp3制作了一个补丁包,我想在安装前先检测一下xp的版本,是sp3就让安装,否则弹出警告,请问如何检测xp版本的注册表项
已经解决:注册表键值如下[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Installations\x86_Microsoft.Tools.VisualCPlusPlus.Runtime-Libraries.Resources_6595b64144ccf1df_6.0.0.0_zh-CN_5e1fba9c\Codebases\OS]
"Prompt"="Windows XP Professional Service Pack 3 CD"
"URL"="x-ms-windows-source:I386/asms/6000/MSFT/VCRTLINT/VCRTLINT.MAN"
提示: 作者被禁止或删除 内容自动屏蔽
这个插件是否可以解决XP sp3版本检测问题:xtInfoPlugin.dll
function:
xtInfoPlugin::GetWindowsServicePackId
====================================================
我是想用这个插件来判断windows的系统版本:2003、XP、Vista
function:
xtInfoPlugin::GetWindowsVersion


[ 本帖最后由 qunsheng_83 于 2008-12-5 02:03 PM 编辑 ]
Function .onInit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"
  IfErrors 0 +2
MessageBox MB_OK  "您正在使用的操作系统不是Windows NT系列!$\n对不起,无法识别系统版本号!" IDOK quit
StrCmp $0 "5.0" 0 +2
Goto +10
StrCmp $0 "5.1" 0 +2
Goto +10
StrCmp $0 "5.2" 0 +2
Goto +10
StrCmp $0 "6.0" 0 +2
Goto +10
StrCmp $0 "6.1" 0 +2
Goto +10
MessageBox MB_OK  "您正在使用的操作系统是 Windows NT $0"  IDOK quit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CSDVersion"
MessageBox MB_OK  "您正在使用的操作系统是 Windows 2000 $0"  IDOK quit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CSDVersion"
MessageBox MB_OK  "您正在使用的操作系统是 Windows XP $0"  IDOK quit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CSDVersion"
MessageBox MB_OK  "您正在使用的操作系统是 Windows 2003 $0"  IDOK quit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CSDVersion"
MessageBox MB_OK  "您正在使用的操作系统是 Windows Vista $0"  IDOK quit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CSDVersion"
MessageBox MB_OK  "您正在使用的操作系统是 Windows 2008 $0"  IDOK quit
quit:
Quit
FunctionEnd
感谢楼上朋友提供的方法
返回列表