문제

I have added a custom page to my installer created using nsDialogs, however, the page is only necessary to be displayed to one of my InstType options.

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

In the example above, I'd like the extra page to be shown to only developers. What is the best practice?

  1. Inspect some attribute to determine the install type and suppress call to nsDialogs::Show? No idea what attribute to look for
  2. Some logic in the page routing that avoids the page being hit? No idea how to do this
  3. Something else?
도움이 되었습니까?

해결책

To skip a page, call abort in the create function callback for that page.

!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 ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top