!include "Sections.nsh"
Name "One Section"
OutFile "one-section.exe"

;--------------------------------
; Pages
Page components

;--------------------------------
; Sections
SubSection "Application" ss0
  SubSection "Client" ss1
    Section "Group 1 - Option 1" g1o1
      SectionIn RO
    SectionEnd
    Section "Group 1 - Option 2" g1o2
    SectionEnd
    Section "Group 1 - Option 3" g1o3
    SectionEnd
  SubSectionEnd
  SubSection "Server" ss2
    Section /o "Group 2 - Option 1" g2o1
      SectionIn RO
    SectionEnd
    Section "Group 2 - Option 2" g2o2
      SectionIn RO
    SectionEnd
    Section "Group 2 - Option 3" g2o3
    SectionEnd
  SubSectionEnd
SubSectionEnd

;--------------------------------
; Functions
Function .onSelChange
  !insertmacro SectionFlagIsSet ${ss0} ${SF_SELECTED} 0 +2
  !insertmacro SectionFlagIsSet ${ss0} ${SF_PSELECTED} 0 lbl_Done
    !insertmacro SectionFlagIsSet ${ss1} ${SF_SELECTED} 0 +2
    !insertmacro SectionFlagIsSet ${ss1} ${SF_PSELECTED} 0 lbl_NoClient
    lbl_NoClient:

    !insertmacro SectionFlagIsSet ${ss2} ${SF_SELECTED} 0 +2
    !insertmacro SectionFlagIsSet ${ss2} ${SF_PSELECTED} 0 lbl_NoServer
    lbl_NoServer:

  lbl_Done:
FunctionEnd
