2003-01-09 20:13:10 +00:00
|
|
|
# This example demonstrates how to control section selection.
|
|
|
|
# It allows only one of the four optional section to be
|
|
|
|
# selected at any given time.
|
2003-01-09 20:09:02 +00:00
|
|
|
|
2003-11-25 17:18:45 +00:00
|
|
|
#############################################################
|
|
|
|
# New macros which make this so much easier can be found in #
|
|
|
|
# Include\Sections.nsh. #
|
|
|
|
#############################################################
|
|
|
|
|
2003-02-16 21:49:25 +00:00
|
|
|
#### Uncomment the next line for an example with subsections too
|
|
|
|
# !define USE_SUBSECTION
|
|
|
|
####
|
|
|
|
|
2002-08-08 10:20:28 +00:00
|
|
|
Name example
|
2002-10-02 17:51:16 +00:00
|
|
|
OutFile one-section.exe
|
2002-08-08 10:20:28 +00:00
|
|
|
|
2003-09-05 15:16:15 +00:00
|
|
|
Page components
|
2002-08-08 10:20:28 +00:00
|
|
|
|
2003-02-14 22:33:44 +00:00
|
|
|
# defines SF_*, SECTION_OFF and some macros
|
|
|
|
!include Sections.nsh
|
2002-10-02 16:59:40 +00:00
|
|
|
|
2002-08-08 10:20:28 +00:00
|
|
|
Section !Required
|
|
|
|
SectionIn RO
|
|
|
|
SectionEnd
|
|
|
|
|
2003-02-16 21:49:25 +00:00
|
|
|
!ifdef USE_SUBSECTION
|
2003-08-03 10:51:59 +00:00
|
|
|
SubSection /e "choose one" subsec
|
2003-02-16 21:49:25 +00:00
|
|
|
!endif
|
|
|
|
|
2002-08-08 10:20:28 +00:00
|
|
|
Section "optional #1" sec1
|
|
|
|
SectionEnd
|
|
|
|
|
2003-05-25 20:31:42 +00:00
|
|
|
Section /o "optional #2" sec2
|
2002-08-08 10:20:28 +00:00
|
|
|
SectionEnd
|
|
|
|
|
2003-05-25 20:31:42 +00:00
|
|
|
Section /o "optional #3" sec3
|
2002-08-08 10:20:28 +00:00
|
|
|
SectionEnd
|
|
|
|
|
2003-05-25 20:31:42 +00:00
|
|
|
Section /o "optional #4" sec4
|
2002-08-08 10:20:28 +00:00
|
|
|
SectionEnd
|
|
|
|
|
2003-02-16 21:49:25 +00:00
|
|
|
!ifdef USE_SUBSECTION
|
|
|
|
SubSectionEnd
|
|
|
|
!endif
|
|
|
|
|
2002-08-08 10:20:28 +00:00
|
|
|
Function .onInit
|
|
|
|
StrCpy $1 ${sec1} ; Gotta remember which section we are at now...
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function .onSelChange
|
2003-02-16 21:49:25 +00:00
|
|
|
!ifdef USE_SUBSECTION
|
2003-05-25 20:31:42 +00:00
|
|
|
; Check if the user have selected all of the sections using the sub-section
|
2003-08-27 13:10:41 +00:00
|
|
|
; This piece of code is not needed when there are only two sections
|
2003-12-24 16:30:22 +00:00
|
|
|
Push $0
|
|
|
|
|
2003-08-03 10:51:59 +00:00
|
|
|
SectionGetFlags ${subsec} $0
|
|
|
|
IntOp $0 $0 & ${SF_SELECTED}
|
|
|
|
StrCmp $0 0 skip
|
2003-02-16 21:49:25 +00:00
|
|
|
SectionSetFlags ${sec1} 0
|
|
|
|
SectionSetFlags ${sec2} 0
|
|
|
|
SectionSetFlags ${sec3} 0
|
|
|
|
SectionSetFlags ${sec4} 0
|
|
|
|
skip:
|
2003-12-24 16:30:22 +00:00
|
|
|
|
|
|
|
Pop $0
|
2003-02-16 21:49:25 +00:00
|
|
|
!endif
|
|
|
|
|
2003-12-24 16:30:22 +00:00
|
|
|
!insertmacro StartRadioButtons $1
|
|
|
|
!insertmacro RadioButton ${sec1}
|
|
|
|
!insertmacro RadioButton ${sec2}
|
|
|
|
!insertmacro RadioButton ${sec3}
|
|
|
|
!insertmacro RadioButton ${sec4}
|
|
|
|
!insertmacro EndRadioButtons
|
2002-08-08 10:20:28 +00:00
|
|
|
FunctionEnd
|