/*
HelpButton是NSIS自定义帮助按钮的插件
HelpButton支持自定义帮助按钮,通过按F1键就可以调用,HelpButton支持富文本,文本文档,网页来显示你的帮助信息.
*/
!AddPluginDir "../Plugins"
OutFile "HelpButton.exe"
ShowInstDetails show
InstallDir $EXEDIR
Page license start
Page directory "" start_2
Page instfiles "" "" start_3
Function start
HelpButton::show /NOUNLOAD "246,231" "blah blah blah" "built to the power of the llama ^o^" "/html=$EXEDIRwinampmb.htm"
FunctionEnd
Function start_3
MessageBox MB_OK "Try pressing 'F1'"
HelpButton::show /NOUNLOAD "0,50" "" "well you did ask!" "/file=$EXEDIRhelp.rtf" wrap 20
FunctionEnd
Function start_2
HelpButton::show /NOUNLOAD "232,231" "?" "now you've really done it..." "now why install?" wrap ; 20
FunctionEnd
Function .onGUIEnd
# This needs to be called otherwise the dll will not be correctly unloaded and so will stay on the hd :o(
HelpButton::end
FunctionEnd
Section ""
SetOutPath $INSTDIR
Call DoPrimes
SectionEnd
Function DoPrimes
; we put this in here so it doesn't update the progress bar (faster)
!define PPOS $0 ; position in prime searching
!define PDIV $1 ; divisor
!define PMOD $2 ; the result of the modulus
!define PCNT $3 ; count of how many we've printed
DetailPrint "2 is prime!"
DetailPrint "3 is prime!"
Strcpy ${PPOS} 3
Strcpy ${PCNT} 2
outerloop:
StrCpy ${PDIV} 3
innerloop:
IntOp ${PMOD} ${PPOS} % ${PDIV}
IntCmp ${PMOD} 0 notprime
IntOp ${PDIV} ${PDIV} + 2
IntCmp ${PDIV} ${PPOS} 0 innerloop 0
DetailPrint "${PPOS} is prime!"
IntOp ${PCNT} ${PCNT} + 1
IntCmp ${PCNT} 100 0 innerloop
StrCpy ${PCNT} 0
MessageBox MB_YESNO "Process more?" IDNO stop
notprime:
IntOp ${PPOS} ${PPOS} + 2
Goto outerloop
stop:
FunctionEnd
THE END
暂无评论内容