Skip to content
⌘ NSIS Forum Archive

When one Section is acitivated an other is required

3 posts

Sp33dy G0nz4l3s#

When one Section is acitivated an other is required

Hello, I have a problem. I've make an installer. In this installer is a SectionGroup.

The user chan choose there some plugins. Now I have the question is it possible that when the user choose one Section in the SectionGroup an other Section in the SectionGroup is required and must be activated?

I hope you understand what I mean.

Thank you for your help.
Marc
CancerFace#
Here is an example using 3 sub-sections in a section group: if subsection 1 is selected then subsection 3 will also be selected (required). Adapted from onesection.nsi
!include "Sections.nsh"
!include "LogicLib.nsh"

Page components

SectionGroup /e "Group A" GA
Section /o "Group 1 - Option 1" g1o1
SectionEnd

Section /o "Group 1 - Option 2" g1o2
SectionEnd

Section /o "Group 1 - Option 3" g1o3
SectionEnd
SectionGroupEnd

Function .onSelChange
SectionGetFlags ${g1o1} $1
SectionGetFlags ${g1o3} $2
${If} $1 = 1
${AndIf} $2 = 0
SectionSetFlags ${g1o3} ${SF_SELECTED}
${EndIf}
FunctionEnd
CF