Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

checkbox - Customizing an exsisting NSIS MUI2 page

I have added a checkbox successfully to nsis installer's finish page defining functions for MUI_PAGE_CUSTOMFUNCTION_PRE and MUI_PAGE_CUSTOMFUNCTION_SHOW in finish page using MUI.

But if I include MUI2 instead of MUI, the check box is not displayed. I suppose there is something different in MUI2 than MUI with respect to this. I could not find documentation on that an if anyone knows that, can I please know???

Thank you

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...