Customizing an exsisting NSIS MUI2 page

谁说胖子不能爱 提交于 2019-11-29 16:59:01
Anders

MUI1 uses InstallOptions for the Welcome and Finish pages and MUI2 uses nsDialogs.

This is documented in the MUI2 readme:

The welcome and finish page are no longer implemented using InstallOptions. Instead, the new nsDialogs plug-in is used. nsDialogs allows you to create custom pages or customize existing pages directly from the script.

Edit: Customize the page by using the nsDialogs commands in the show callback:

var Checkbox

Function MyFinishShow
${NSD_CreateCheckbox} 120u 110u 100% 10u "&Something"
Pop $Checkbox
SetCtlColors $Checkbox "" "ffffff"
FunctionEnd

Function MyFinishLeave
${NSD_GetState} $Checkbox $0
${If} $0 <> 0
    MessageBox mb_ok "Custom checkbox was checked..."
${EndIf}
FunctionEnd

!define MUI_FINISHPAGE_RUN "calc.exe" ;See note after the code...
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyFinishShow
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE MyFinishLeave
!insertmacro MUI_PAGE_FINISH

Or if you are not using the existing finish page checkboxes, you can use those for custom stuff without using the show callback...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!