杉宫竹苑工作室

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

NSIS 检测注册表键存在

[复制链接]
发表于 2017-2-25 21:28:20 | 显示全部楼层 |阅读模式

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

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

x
  1. ; OpenReg.nsi
  2. ; 检查某注册表键是否存在的NSIS例子
  3. ; 编写:zhfi <zhfi1022@tom.com>

  4. ;--------------------------------
  5. ;定义注册表主键
  6. !define HKEY_CLASSES_ROOT           0x80000000
  7. !define HKEY_CURRENT_USER           0x80000001
  8. !define HKEY_LOCAL_MACHINE          0x80000002
  9. !define HKEY_USERS                  0x80000003

  10. OutFile OpenReg.exe

  11. XPStyle on

  12. !include LogicLib.nsh

  13. ;--------------------------------
  14. Name OpenReg

  15. Section Nil
  16. SectionEnd

  17. Function .onInit
  18. System::Call "*(i 0) i .R0"
  19. Push "SOFTWARE\TENCENT\QQPinYin"
  20. system::call 'Advapi32::RegOpenKey(i ${HKEY_LOCAL_MACHINE}, t s, i R0) .iR1'
  21. system::call 'Advapi32::RegCloseKey(i R0)'
  22. system::free
  23. ${If} $R1 == 0
  24. Messagebox mb_ok "Key Exists!"
  25. ${ElseIf} $R1 == 2
  26. Messagebox mb_ok "Key doesn't Exists!"
  27. ${Else}
  28. Messagebox mb_ok "error!"
  29. ${EndIf}
  30. Pop $R1
  31. Pop $R0
  32. Quit
  33. FunctionEnd
复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-15 05:26 , Processed in 0.120369 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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