Archive: UnselectSection is NOT working


UnselectSection is NOT working
According to some recommendations I code the following statements:

!include Sections.nsh
....
Section "first data.txt"
!insertmacro UnselectSection "first data.txt"
....
SectionEnd

If I run the installer afterwards the Section is still checked !!!
(a check is in the box in front of the section in the selction list). But I want to uncheck it by default.

Again: How do I do it?


Add a define nameto the Section command:

Section "first data.dat" firstdata

and use !insertmacro UnselectSection ${firstdata}


Still NOT working
Ok, I coded it like you suggest...
... but the box still contains a check


That's because you called this function inside the section. If you want it to be unchecked from the begning use it in .onInit. If you want to dynamically [un]check it use it in .onSelChange. Please be aware that there is a typo in the SelectSection macro. On line 22 there is a & sign instead of a | sign.


Insert the macro in the .onInit function and put the function after the section.