Old 21st December 2017, 14:08   #1
Lord Cris
Junior Member
 
Join Date: Dec 2017
Posts: 9
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:

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
Lord Cris is offline   Reply With Quote
Old 22nd December 2017, 15:11   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,644
"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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 8th January 2018, 15:14   #3
Lord Cris
Junior Member
 
Join Date: Dec 2017
Posts: 9
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 is offline   Reply With Quote
Old 8th January 2018, 17:36   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,644
SectionGetText

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 9th January 2018, 07:06   #5
Lord Cris
Junior Member
 
Join Date: Dec 2017
Posts: 9
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.
Lord Cris is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump