NSIS比较版本号
侧边栏壁纸
  • 累计撰写 29 篇文章
  • 累计收到 129 条评论

NSIS比较版本号

nsisfans
2022-03-21 / 0 评论 / 138 阅读 / 正在检测是否收录...

代码来自:少轻狂

Name ver
OutFile ver.exe
!include "MUI2.nsh"
!include "WordFunc.nsh"

Section - "比较版本号"
    ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
    MessageBox MB_OK "$R1"
    ${VersionCompare} "6.1" "$R1" $R2
    ${If} $R2 == 0
        MessageBox MB_OK "版本相同($R1)"
    ${ElseIf} $R2 == 1
        MessageBox MB_OK "已安装版本低($R1)"
    ${ElseIf} $R2 == 2
        MessageBox MB_OK "已安装版本高($R1)"
    ${EndIf}
SectionEnd
0

评论 (0)

取消