You can use the callback function, leaving the component page to check if it is selected.
Here is the code snippet that I use in the setup. I use a small macro to summarize the selected components in a variable. If not, the variable is null. I use the PageEx block to link the callback functions on the component page (since the callback is the third, I use the dummy function for the first two others)
Replace
Page components
by
PageEx components PageCallbacks DummyFunc DummyFunc componentsLeave PageExEnd
save the .onSelChange to handle the exclusive selection, then add it to the end of your script:
!define SECTIONCOUNT 3 ; total -1 ;SaveSections adds one bit to the given variable for each selected component !macro SaveSections VAR StrCpy ${VAR} 0 ${ForEach} $R0 ${SECTIONCOUNT} 0 - 1 IntOp ${VAR} ${VAR} << 1 ${If} ${SectionIsSelected} $R0 ;${DEBUG} "Section $R0 checked" IntOp ${VAR} ${VAR} + 1 ${EndIf} ${Next} !macroend Function DummyFunc FunctionEnd Function componentsLeave !insertmacro SaveSections $2 ${if} $2 = 0 MessageBox MB_OK|MB_ICONEXCLAMATION "Select something !" /sd IDOK Abort ${endif} FunctionEnd
source share