I have 4 sections:
- Section 0 (Read only, always selected)
- Section 1
- Section 2
- Section 3 (This section is independent of the others)
The thing is section 1 is a dependency of section 2, so when section 2 is selected I want section 1 to be selected automatically, and when section 1 is deselected I want section 2 to be deselected automatically as well. However, section 1 should also be free of section 2 in that when section 2 is not selected, section 1 can still be selected anyways.
So far I've only been able to get the two to be selected/deselected at the same time based on what I've found in this board and in the docs, but I haven't been able to let section 1 be selected when section 2 is not selected. Also this only allows one of the sections to be checked/unchecked; the other is always locked in the checked state, which is undesirable. I should probably note that the NSIS logic syntax feels awkward to me so I might be missing something that is really simple.
Here's my code (all section flags are initially set to the checked state):
Thanks in advance for your help!
Function .onSelChange
Push $0
SectionGetFlags ${Section2} $0
IntOp $0 $0 & ${SF_SELECTED}
SectionsetFlags ${Section1} $0
Pop $0
FunctionEnd