代码之家  ›  专栏  ›  技术社区  ›  Ray Hayes

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

  •  1
  • Ray Hayes  · 技术社区  · 14 年前

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

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

    1. 检查某些属性以确定安装类型并禁止调用 nsDialogs::Show ? 不知道该找什么属性
    2. 页面路由中的一些逻辑可以避免页面被击中吗?
    3. 还有别的吗?
    1 回复  |  直到 14 年前
        1
  •  4
  •   Anders    14 年前

    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
    
    推荐文章