nsDialog を使用した NSIS でのページの条件付き表示
質問
nsDialogs を使用して作成したインストーラーにカスタム ページを追加しましたが、このページは InstType オプションの 1 つに表示するだけで済みます。
InstType "Default" # 1
InstType "Developer" # 2
上の例では、追加ページを開発者のみに表示したいと考えています。ベストプラクティスは何ですか?
- いくつかの属性を検査してインストール タイプを判断し、への呼び出しを抑制します。
nsDialogs::Show
? どの属性を調べればよいかわからない - ページのヒットを回避するページ ルーティングのロジックはありますか? やり方が分からない
- 他に何か?
解決
で中止、ページをスキップコールに
は、そのページの関数コールバックを作成します。
!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