读取注册表版本号

name "NSISDemo"
outfile 'NSISDemo.exe'
Section "NSISDemo"

ReadRegStr $R0 HKLM SOFTWAREMicrosoftWindowsCurrentVersionUninstallTTPlayer "DisplayVersion"

IntCmp $R0 "5.0" is5 lessthan5 morethan5


is5:
DetailPrint "$R0 == 5.0"
Goto int
lessthan5:
DetailPrint "$R0 < 5.0"
Goto error2
morethan5:
DetailPrint "$R0 > 5.0"
Goto error1
int:
MessageBox MB_OK "你系统中现有版本为$R0,点击OK安装更新" IDOK
DetailPrint "安装版本为: $R0"
goto done
error1:
MessageBox MB_ICONSTOP|MB_OK "你系统中版本$R0高于更新版本" IDOK
error2:
MessageBox MB_ICONSTOP|MB_OK "你系统中版本$R0低于更新版本" IDOK

done:
SectionEnd
© 版权声明
THE END
喜欢就支持一下吧
点赞9 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容