Archive: Force user to choose a selection


Force user to choose a selection
Hi,

i want to force the user to choose a selection on the components page. If nothing is selected the Next-Button should be disabled.

How can I solve this problem with less code?


There's one piece of example code here:
http://nsis.sourceforge.net/Components_Page_Next_Button

It's not the clearest of examples, but you can probably get the general idea:
1. Create a callback function for section changes (.onSelChange - used by NSIS internally).

2.1 set a variable to false / 0 / whatever to indicate that no sections are presumed to be selected
2.2 In that callback function loop over all sections
2.3 and check if they are selected or not
2.4 if even just one of them is found to be selected
2.5 then set the variable to true / 1 / whateverelse

3. based on whether that variable is true (a section is selected) or false (no sections selected), enable / disable the Next button.