繁体   English   中英

使用nsDialog在NSIS中有条件地显示页面

[英]Conditional Display of pages in NSIS using nsDialog

我已经使用nsDialogs为我的安装程序添加了一个自定义页面,但是,该页面只需要显示给我的一个InstType选项。

InstType "Default" # 1
InstType "Developer" # 2

在上面的示例中,我希望仅向开发人员显示额外页面。 什么是最佳做法?

  1. 检查一些属性以确定安装类型并禁止调用nsDialogs::Show 不知道要寻找什么属性
  2. 页面路由中的一些逻辑可以避免页面被点击? 不知道怎么做
  3. 别的什么?

跳过页面 ,请在该页面的create function callback中调用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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM