自定义现有的 NSIS MUI2 页面 [英] Customizing an exsisting NSIS MUI2 page
问题描述
我已使用 MUI
在完成页面中为 MUI_PAGE_CUSTOMFUNCTION_PRE
和 MUI_PAGE_CUSTOMFUNCTION_SHOW
定义函数成功添加了一个复选框到 nsis 安装程序的完成页面.
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
.
但是如果我包含 MUI2
而不是 MUI
,复选框不会显示.我想在这方面 MUI2
与 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???
谢谢
推荐答案
MUI1 对欢迎和完成页面使用 InstallOptions,而 MUI2 使用 nsDialogs.
MUI1 uses InstallOptions for the Welcome and Finish pages and MUI2 uses nsDialogs.
这记录在 MUI2 自述文件中:
欢迎和结束页面没有使用时间更长的实现安装选项.相反,新使用 nsDialogs 插件.nsDialogs允许您创建自定义页面或直接从定制现有页面脚本.
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.
使用显示回调中的 nsDialogs 命令自定义页面:
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屋!