11

I have a NSIS installer, here I have some components that user can choose to install:

Section "Modules" SecModules
  SetOutPath "$INSTDIR"
  CreateDirectory $INSTDIR\modules
  ...
SectionEnd

Section "Freenode util" SecFreenode
  SetOutPath "$INSTDIR"
  CreateDirectory $INSTDIR\modules
  ...
SectionEnd

how can I make the second one unchecked? By default they all are checked

Petr
  • 13,747
  • 20
  • 89
  • 144

2 Answers2

18
; unselected because it is /o
Section /o "Modules" SecModules
  SetOutPath "$INSTDIR"
  CreateDirectory $INSTDIR\modules
  ...
SectionEnd

; selected
Section "Freenode util" SecFreenode
  SetOutPath "$INSTDIR"
  CreateDirectory $INSTDIR\modules
  ...
SectionEnd
Petr
  • 13,747
  • 20
  • 89
  • 144
  • Don't remember you should [accept your own answer](http://meta.stackexchange.com/questions/16930/is-it-ok-to-answer-your-own-question-and-accept-it) if you think it solves your problem :) – mgarciaisaia Mar 18 '14 at 18:14
7

Apart from Section /o, you can also use SectionIn to control default sections. The latter might be useful if you have several sections and you plan to offer several installation types (see InstType). Lastly, you can control the state of a section based on logic, using SectionSetFlags.

idleberg
  • 12,634
  • 7
  • 43
  • 70
  • I fail to understand how could I use that for my purpose. I want to have a list of optional components and some of them should be installed by default and some of them only if user check them. I don't understand what is SectionIn good for in that case – Petr Apr 17 '13 at 14:39