杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2183|回复: 0

NSIS 读取注册表版本号

[复制链接]
发表于 2017-2-26 13:47:15 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. name "NSISDemo"
  2. outfile 'NSISDemo.exe'
  3. Section "NSISDemo"

  4. ReadRegStr $R0 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TTPlayer "DisplayVersion"

  5. IntCmp $R0 "5.0" is5 lessthan5 morethan5


  6. is5:
  7. DetailPrint "$R0 == 5.0"
  8. Goto int
  9. lessthan5:
  10. DetailPrint "$R0 < 5.0"
  11. Goto error2
  12. morethan5:
  13. DetailPrint "$R0 > 5.0"
  14. Goto error1
  15. int:
  16. MessageBox MB_OK "你系统中现有版本为$R0,点击OK安装更新" IDOK
  17. DetailPrint "安装版本为: $R0"
  18. goto done
  19. error1:
  20. MessageBox MB_ICONSTOP|MB_OK "你系统中版本$R0高于更新版本" IDOK
  21. error2:
  22. MessageBox MB_ICONSTOP|MB_OK "你系统中版本$R0低于更新版本" IDOK

  23. done:
  24. SectionEnd
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-4-29 08:08 , Processed in 0.108641 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表