自定义现有的NSIS MUI2页面 [英] Customizing an exsisting NSIS MUI2 page

查看:1748
本文介绍了自定义现有的NSIS MUI2页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功添加了一个复选框到nsis安装程序的完成页面,在完成页面中定义 MUI_PAGE_CUSTOMFUNCTION_PRE MUI_PAGE_CUSTOMFUNCTION_SHOW 的函数 MUI



但如果我包括 MUI2 MUI ,则不会显示此复选框。我想对于 MUI2 MUI 有不同的东西。如果有人知道,我找不到文件。



谢谢



这在 MUI2自述文件


欢迎和完成页面没有
更长的实现使用
InstallOptions。相反,使用新的
nsDialogs插件。 nsDialogs
允许您创建自定义页面或
直接从
脚本自定义现有页面。


修改:使用show callback中的nsDialogs命令自定义网页:

  var复选框

功能MyFinishShow
$ {NSD_CreateCheckbox} 120u 110u 100%10u& something
Pop $复选框
SetCtlColors $复选框ffffff
FunctionEnd

函数MyFinishLeave
$ {NSD_GetState} $复选框$ 0
$ {if} $ 0<> 0
MessageBox mb_ok自定义复选框已选中...
$ {EndIf}
FunctionEnd

!定义MUI_FINISHPAGE_RUNcalc.exe code ...
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyFinishShow
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE MyFinishLeave
!insertmacro MUI_PAGE_FINISH


b $ b

或者,如果您不使用现有的完成页复选框,您可以使用
的自定义内容

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

解决方案

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

这篇关于自定义现有的NSIS MUI2页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆