题
我已将自定义页面添加到使用 nsDialogs 创建的安装程序中,但是,该页面只需显示到我的 InstType 选项之一。
InstType "Default" # 1
InstType "Developer" # 2
在上面的示例中,我希望仅向开发人员显示额外的页面。最佳实践是什么?
- 检查某些属性以确定安装类型并禁止调用
nsDialogs::Show
? 不知道要寻找什么属性 - 页面路由中的一些逻辑可以避免页面被点击? 不知道该怎么做
- 还有别的事吗?
解决方案
到 跳过一页, ,在该页面的创建函数回调中调用 abort。
!include LogicLib.nsh
InstType "Normal"
InstType "Developer"
Page Components
Page Custom myDevPage
;Page start menu etc...
Page InstFiles
Section /o "" ${SEC_Dev}
;This (hidden) section is used just to check the insttype state, but you could also use it to install dev specific files etc
SectionIn 2
Sectionend
Function myDevPage
${IfNot} ${SectionIsSelected} ${SEC_Dev}
Abort
${EndIf}
;nsDialog code goes here
FunctionEnd
不隶属于 StackOverflow