Skip to content
⌘ NSIS Forum Archive

Section selection confusing

5 posts

Lord Cris#

Section selection confusing

Hello everybody,

I have a, for me Confusing Problemen where i need the help from you.

In for my i installer i got the call the some addons requirt a specific addon and when of these addons are selected that specific addon must be selected too. THe Selection of it had resolved, but now on testing i see that i cant unselect the addon and now i know t and tryed to fix it.

I have a number of 5 sections + the "must" section extensions.

I have atm the following code:


Function .onSelChange
SectionGetFlags ${extensionsSec} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
${IfNot} $R0 == ${SF_SELECTED}
IntOp $0 ${SF_SELECTED} & ${SF_SELECTED}
SectionSetFlags ${extensionsSec} $0
!insertmacro ClearSectionFlag ${extensionsSec} ${SF_RO}
${EndIf}
FunctionEnd
now the problems,
first how can i get the Section where is selected by user in runtime bevor installtion with out iteratin over all sections.
second how can i fix the problem that i cant unselect extensions when the addon where it needed is unselected.
I hope you can help me to solve this.

~ Cris
Anders#
"IntOp $0 ${SF_SELECTED} & ${SF_SELECTED}" makes no sense. LogicLib has ${SectionIsSelected} you can use in ${If} and Sections.nsh has macros you can use to manipulate the sections.

NSIS v3+ puts the section id of the changed section in $0 when it calls .onSelChange.
Lord Cris#
Sry for my late reply, but my request was for my work. But i can say it helped me a lot, but opend a new Question. Is there a way to get the Name of the section over the section ID? I did research a bit and didnt find anything.
Lord Cris#
Ty for your help. Oh man before i startet with this Project i tought to complicated and now im thinking to simpel and didnt realize some thing correctly.