最新消息:

永恒心锁NSIS判断系统脚本(支持WIN10)

原创软件 永恒心锁 2965浏览 0评论

永恒心锁NSIS判断系统脚本(支持WIN10)

 

https://yunpan.cn/crJYU3gCHu4tm  提取码 43e4

;判断系统版本和是否是X86还是X64
 ;www.yhxs3344.net BY 永恒心锁
 !packhdr temp.dat 'cmd /c Copy /B temp.dat /B +www.yhxs3344.net.rar temp.dat' ;可去除
 ;#######################################################################################################
 SetCompressor /SOLID lzma
 ;头文件
 !include "WinVer.nsh"
 !include "MUI2.nsh"
 !define MUI_ICON "main.ico"
 ;#######################################################################################################
 ;变量声明
 Var WINDOWS_Version ;WINDOWS版本
 Var Service_Pack ;SP版本
 Var Kernel_version ;内核版本
 Var X86_X64 ;系统位数
 ; 安装界面包含的语言设置
 !insertmacro MUI_LANGUAGE "SimpChinese"
 ;文件版本声明

VIProductVersion "1.0.0.0"
 VIAddVersionKey /LANG=2052 "ProductName" "永恒心锁系统信息获取"
 VIAddVersionKey /LANG=2052 "Comments" "永恒心锁。"
 VIAddVersionKey /LANG=2052 "CompanyName" "http://www.yhxs3344.net"
 VIAddVersionKey /LANG=2052 "LegalTrademarks" "yhxs3344.net"
 VIAddVersionKey /LANG=2052 "LegalCopyright" "永恒心锁工作室"
 VIAddVersionKey /LANG=2052 "FileDescription" "永恒心锁系统信息获取"
 VIAddVersionKey /LANG=2052 "FileVersion" "1.0.0.0"

;#######################################################################################################
 XPStyle on
 OutFile "判断当前win操作系统.EXE"
 Name "判断当前win操作系统"
 ;#######################################################################################################
 SilentInstall silent ;静默
 Section
 ;判断系统版本
 ReadRegStr $WINDOWS_Version HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion" ;读取系统版本注册表键值
 StrCmp $WINDOWS_Version "" +1 +2
 ReadRegStr $WINDOWS_Version HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" "VersionNumber" ;读取系统版本注册表键值
 SetRegView 64
 ReadRegStr $Service_Pack HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CSDVersion"
 SetRegView 32
 ReadRegStr $Service_Pack HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CSDVersion" ;读取系统SP注册表键值

StrCmp $WINDOWS_Version "4.9" +1 +2
 StrCpy $WINDOWS_Version "98"
 StrCmp $WINDOWS_Version "5.0" +1 +2
 StrCpy $WINDOWS_Version "2000"
 StrCmp $WINDOWS_Version "5.1" +1 +2
 StrCpy $WINDOWS_Version "XP"
 StrCmp $WINDOWS_Version "5.2" +1 +2
 StrCpy $WINDOWS_Version "2003"
 StrCmp $WINDOWS_Version "6.0" +1 +2
 StrCpy $WINDOWS_Version "Vista"
 StrCmp $WINDOWS_Version "6.1" +1 +2
 StrCpy $WINDOWS_Version "7"
 StrCmp $WINDOWS_Version "6.2" +1 +2
 StrCpy $WINDOWS_Version "8"
 StrCmp $WINDOWS_Version "6.3" +1 +2
 StrCpy $WINDOWS_Version "10"
 ;#######################################################################################################
 ;判断是X86还是X64
 ${If} ${AtLeastWinXP}
 System::Alloc 36
 pop $Kernel_version
 ${EndIf}
 ${If} $Kernel_version <> 0
 System::Call 'kernel32::GetNativeSystemInfo(i $Kernel_version)'
 System::Call "*$Kernel_version(&i2.r1)"
 System::Free $Kernel_version

StrCmp $1 0 +1 +2
 StrCpy $X86_X64 "x86"
 StrCmp $1 6 +1 +2
 StrCpy $X86_X64 "ia64"
 StrCmp $1 9 +1 +2
 StrCpy $X86_X64 "x64"
 IntCmp $1 10 +1 +2 +1
 StrCpy $X86_X64 "unknown"
 ${EndIf}

${If} $Service_Pack == ""

WriteINIStr ".\Computer_information.ini" "电脑信息" "操作系统" "WIN$WINDOWS_Version"
 WriteINIStr ".\Computer_information.ini" "电脑信息" "系统位数" "$X86_X64"
 ${Else}
 WriteINIStr ".\Computer_information.ini" "电脑信息" "操作系统" "WIN$WINDOWS_Version"
 WriteINIStr ".\Computer_information.ini" "电脑信息" "SP版本" "$Service_Pack"
 WriteINIStr ".\Computer_information.ini" "电脑信息" "系统位数" "$X86_X64"
 ${EndIf}
 SectionEnd
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » 永恒心锁NSIS判断系统脚本(支持WIN10)

您必须 登录 才能发表评论!