Archive: RadioButtons within a SectionGroup


RadioButtons within a SectionGroup
I am using RadioButtons within my installer to ensure that uses cannot select conflicting sections. To do this I followed the example provided in the one-section.nsi script provided with the NSIS installation. This works exactly as describe.

However, for the sake of clarity I decided to place all the radiobutton sections into a SectionGroup and I am getting some rather odd results.

RadioSelection still work, however if the user clicks on the SectionGroup check box the radiobuttons cease to work correctly.

As an example, take the following grouped sections:

MyRadButGroup
-RadBut1
-RadBut2
-RadBut3

RadBut1 is selected by default, if the user clicks on RadBut2 radio select works and RadBut1 is deselected. With RadBut2 selected, if the user click on MyWidgetGroup RadBut1 and 3 are selected and RadBut3 is deselected. Obviously if the user click next at this point the installer will attempt to execute sections 1 and 3.

A working example of this behaviour can be seen in the attach amended copy of one-section.nsi


After spending a few days hunting around for a potential solution to this problem I have to admit I have hit a wall, can anybody make any suggestions (no matter how crazy)?


In .onSelChange, before the radio button macros, you should check to see if all of the sections are selected. If they are, the section group was clicked and you should simply unselect them all and reselect the last selected section.

Search the forum for "radio button" a bit, there are threads about this with code examples.