正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- ################################################################################
- ### 注意:早期版本 (包括 2.46 官方版) 的 System 插件不支持 p 类型,需改为 i。
- ### 例如:pR1、p.R2、p${VS_VERSION_INFO} 等,改为 iR1、i.R2、i${VS_VERSION_INFO}
- ### 如果修改后结果仍为 0,请尝试使用最新 2.46.x、3.0 等版本的 System.dll 插件。
- ################################################################################
- !ifndef RT_VERSION
- !define RT_VERSION 16
- !endif
- !ifndef VS_FILE_INFO
- !define VS_FILE_INFO ${RT_VERSION}
- !endif
- !ifndef VS_VERSION_INFO
- !define VS_VERSION_INFO 1
- !endif
- # 获取真正的系统版本号
- Function GetRealOSVersion
- Push $R0
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- StrCpy $R0 0
- System::Call 'kernel32::LoadLibrary(t"kernel32.dll")p.R1'
- IntCmp $R1 0 _ver_err_done
- System::Call 'kernel32::FindResource(pR1,p${VS_VERSION_INFO},p${VS_FILE_INFO})p.R2'
- IntCmp $R2 0 _ver_err_free
- System::Call 'kernel32::LoadResource(pR1,pR2)p.R3'
- IntCmp $R3 0 _ver_err_free
- System::Call 'kernel32::LockResource(pR3)p.R4'
- IntCmp $R4 0 _ver_err_free
- System::Call "*$R4(&i2,&i2.R5,&i2,&w16,&i2,i,i,i.R6)"
- IntCmp $R5 0 _ver_err_free
- IntFmt $R0 "0x%08X" $R6
- _ver_err_free:
- System::Call "kernel32::FreeLibrary(pR1)"
- _ver_err_done:
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Exch $R0
- FunctionEnd
- ################################################################################
- ################################################################################
- !AddPluginDir .
- Name WinVer
- OutFile WinVer.exe
- InstallDir $TEMP
- XPStyle on
- InstallColors /windows
- ShowInstDetails show
- RequestExecutionLevel admin
- Page instfiles
- Section -Main
- # 0x00050000 5.0 Windows 2000
- # 0x00050001 5.1 Windows XP
- # 0x00050002 5.2 Windows XP (x64), Windows Server 2003, Windows Server 2003 R2
- # 0x00060000 6.0 Windows Vista, Windows Server 2008
- # 0x00060001 6.1 Windows 7, Windows Server 2008 R2
- # 0x00060002 6.2 Windows 8, Windows Server 2012
- # 0x00060003 6.3 Windows 8.1, Windows Server 2012 R2
- # 0x000A0000 10.0 Windows 10, Windows Server Technical Preview
- Call GetRealOSVersion
- Pop $R0
- # 如果结果为 0 请参考本文件顶部说明
- DetailPrint "$R0"
- IntOp $0 $R0 >> 16
- IntOp $1 $R0 & 0xFFFF
- DetailPrint "$0.$1"
- SectionEnd
复制代码
完整脚本附件下载
RealOSVer.zip |