【问题标题】:Conditional Display of pages in NSIS using nsDialog使用 nsDialog 有条件地显示 NSIS 中的页面
【发布时间】:2010-08-05 11:42:52
【问题描述】:

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

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

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

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

【问题讨论】:

    标签: nsis nsdialogs


    【解决方案1】:

    skip a page,在该页面的创建函数回调中调用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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-07
      相关资源
      最近更新 更多