;"only" and "must" one section is selected. ;---------------------- ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;-------------------------------- ; Section define/macro header file ; See this header file for more info !include "Sections.nsh" ;-------------------------------- ;General ;Name and file !define APPNAME "istest" !define APPNAMEANDVERSION "v1.0" Name "${APPNAMEANDVERSION}" OutFile "istest.exe" ;Default installation folder InstallDir "$DESKTOP\istest" InstallDirRegKey HKLM "Software\${APPNAME}" "" ;-------------------------------- ;-------------------------------- ;Interface Configuration !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_COMPONENTSPAGE_TEXT_COMPLIST "" !define MUI_COMPONENTSPAGE_TEXT_INSTTYPE "" ;-------------------------------- ;Pages !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Installer Sections ;Set Section properties SetOverwrite on ShowInstDetails "show" ;-------------------------------- Section !Required SectionIn RO SectionEnd SubSection /e "color" "subs" Section /o "red" sec1 SectionEnd ;-------------------------------- Section /o "blue" sec2 SectionEnd ;-------------------------------- Section /o "green" sec3 SectionEnd ;-------------------------------- Section "gray" sec4 SectionEnd SubSectionEnd ;------------------------------------------------------- ;Problem!!!! ;the following code from "star" to "end" is to make one section "must" and "only" be selected,but it does not work well. ;--------------------------------start ; Functions ; $1 stores the status Function .onInit StrCpy $1 ${sec1} FunctionEnd ;-------------------------------- Function .onSelChange !insertmacro StartRadioButtons $1 !insertmacro RadioButton ${sec1} !insertmacro RadioButton ${sec2} !insertmacro RadioButton ${sec3} !insertmacro RadioButton ${sec4} !insertmacro EndRadioButtons FunctionEnd ;--------------------------------end