杉宫竹苑工作室

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

NSIS 帮助按键

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

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

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

x
  1. ;需要HelpButton.dll
  2. ;--------------------------------

  3. Name "HelpButton"
  4. OutFile "HelpButton.exe"
  5. Caption "Runtime Help Button v0.7b"
  6. ShowInstDetails show
  7. InstallDir $EXEDIR
  8. ;SetFont "Tahoma" 5

  9. #DirText "Select a directory to write primes.txt. $_CLICK"

  10. ;--------------------------------

  11. ;Pages

  12. Page license start
  13. Page directory "" start_2
  14. Page instfiles "" "" start_3


  15. Function start
  16. HelpButton::show /NOUNLOAD "246,231" "blah blah blah" "built to the power of the llama ^o^" "/html=$EXEDIR\winampmb.htm"
  17. FunctionEnd

  18. Function start_3
  19. MessageBox MB_OK "Try pressing 'F1'"
  20. HelpButton::show /NOUNLOAD "0,50" "" "well you did ask!" "/file=$EXEDIR\help.rtf" wrap 20
  21. FunctionEnd

  22. Function start_2
  23. HelpButton::show /NOUNLOAD "232,231" "?" "now you've really done it..." "now why install?" wrap ; 20
  24. FunctionEnd

  25. Function .onGUIEnd
  26. # This needs to be called otherwise the dll will not be correctly unloaded and so will stay on the hd :o(
  27. HelpButton::end
  28. FunctionEnd

  29. ;--------------------------------

  30. Section ""
  31.   SetOutPath $INSTDIR
  32.   Call DoPrimes
  33. SectionEnd

  34. ;--------------------------------

  35. Function DoPrimes
  36. ; we put this in here so it doesn't update the progress bar (faster)

  37. !define PPOS $0 ; position in prime searching
  38. !define PDIV $1 ; divisor
  39. !define PMOD $2 ; the result of the modulus
  40. !define PCNT $3 ; count of how many we've printed

  41.   DetailPrint "2 is prime!"
  42.   DetailPrint "3 is prime!"
  43.   Strcpy ${PPOS} 3
  44.   Strcpy ${PCNT} 2
  45. outerloop:
  46.    StrCpy ${PDIV} 3
  47.    innerloop:
  48.      IntOp ${PMOD} ${PPOS} % ${PDIV}
  49.      IntCmp ${PMOD} 0 notprime
  50.      IntOp ${PDIV} ${PDIV} + 2
  51.      IntCmp ${PDIV} ${PPOS} 0 innerloop 0
  52.        DetailPrint "${PPOS} is prime!"
  53.        IntOp ${PCNT} ${PCNT} + 1
  54.        IntCmp ${PCNT} 100 0 innerloop
  55.        StrCpy ${PCNT} 0
  56.        MessageBox MB_YESNO "Process more?" IDNO stop
  57.      notprime:
  58.        IntOp ${PPOS} ${PPOS} + 2
  59.      Goto outerloop
  60.    stop:
  61. FunctionEnd
复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-19 14:48 , Processed in 0.098010 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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