簡體   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