; one-section.nsi ; ; This example demonstrates how to control section selection. ; It allows only one of the sections of a group to be selected. ;-------------------------------- ; Section define/macro header file ; See this header file for more info !include "Sections.nsh" ;-------------------------------- Name "One Section" OutFile "one-section.exe" ;-------------------------------- ; Pages Page components ;-------------------------------- ; Sections Section !Required SectionIn RO SectionEnd SubSection asd Section "Group 1 - Option 1" g1o1 SectionEnd Section /o "Group 1 - Option 2" g1o2 SectionEnd SubSectionEnd ;-------------------------------- ; Functions ; $1 stores the status of group 1 ; $2 stores the status of group 2 Function .onInit StrCpy $1 -1 FunctionEnd Function .onSelChange !insertmacro SectionFlagIsSet ${g1o1} ${SF_SELECTED} "" next StrCmp $1 ${g1o2} "" dontUnselect !insertmacro UnselectSection ${g1o2} dontUnselect: StrCpy $1 ${g1o1} next: !insertmacro SectionFlagIsSet ${g1o2} ${SF_SELECTED} "" next2 StrCmp $1 ${g1o1} "" dontUnselect2 !insertmacro UnselectSection ${g1o1} dontUnselect2: StrCpy $1 ${g1o2} next2: FunctionEnd