NSIS自定义页面的跳转
我们自定义两个安装页面
;自定义欢迎页面
Page custom WelcomePage
;自定义修改安装路径的页面
Page custom InstallationPage
从WelcomePage跳转到InstallationPage,这个就是“下一步”按钮的事件。
创建一个RelGotoPage方法:
Function RelGotoPage
IntCmp $R9 0 0 Move Move
StrCmp $R9 "X" 0 Move
StrCpy $R9 "120"
Move:
SendMessage $HWNDPARENT "0x408" "$R9" ""
FunctionEnd
官方解释:页面跳转(http://nsis.sourceforge.net/Go_to_a_NSIS_page)
If a number > 0: Goes foward that number of pages. Code of that page will be executed, not returning to this point. If it is bigger than the number of pages that are after that page, it simulates a “Cancel” click.
If a number < 0: Goes back that number of pages. Code of that page will be executed, not returning to this point. If it is bigger than the number of pages that are before that page, it simulates a “Cancel” click.
If X: Simulates a “Cancel” click. Code will Go to callback functions, not returning to this point.
If 0: Continues on the same page. Code will still be running after the call.
;跳转下一页
Function onClickNext
StrCpy $R9 1;跳转上一页StrCpy $R9 -1、跳转下一页的下一页StrCpy $R9 2
Call RelGotoPage
Abort
FunctionEnd