Archive: one-section.nsi With Modern UI


one-section.nsi With Modern UI
Is there a way to modify the one-section.nsi code to be used with the modern UI while still having section descriptions? I tried this but it doesn't work. The idea is to have either group 1 and any or all of its sections or group 2 selected, not both.

Function .onInit
StrCpy $1 ${SecDummy1}
FunctionEnd

Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${SecDummy}
!insertmacro RadioButton ${SecDummy4}
!insertmacro EndRadioButtons
FunctionEnd

SubSection /e "Group 1" SecDummy

Section "Option 1" SecDummy1
SetOutPath "$INSTDIR"
IfFileExists "$INSTDIR\test.txt" 0 +2
Delete "$INSTDIR\test.txt"
File "test.txt"
SectionEnd

Section "Option 2" SecDummy2
SetOutPath "$INSTDIR"
IfFileExists "$INSTDIR\test.txt" 0 +2
Delete "$INSTDIR\test.txt"
File "test.txt"
SectionEnd

Section "Option 3" SecDummy3
SetOutPath "$INSTDIR"
IfFileExists "$INSTDIR\test.txt" 0 +2
Delete "$INSTDIR\test.txt"
File "test.txt"
SectionEnd

SubSectionEnd

Section /o "Group 2" SecDummy4
SetOutPath "$INSTDIR"
IfFileExists "$INSTDIR\test.txt" 0 +2
Delete "$INSTDIR\test.txt"
File "test.txt"
SectionEnd

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy1} $(DESC_SecDummy1)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy2} $(DESC_SecDummy2)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy3} $(DESC_SecDummy3)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDummy4} $(DESC_SecDummy4)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

Why not? Add

!include "MUI.nsh"

Change "Page components" -> !insertmacro MUI_PAGE_COMPONENTS
And after that add this line:
!insertmacro MUI_LANGUAGE "English"

I already have all of that. I have a working script, i just want to add the ability to use the one section function with the modern UI.


Okay I got it to work but now I'm getting some weird selection problems where you can select the second group and 2 of the three subsections in group 1. Is there a way to make it so when group 1 is selected not all of its sub sections have to be and when group 2 is selected none of groups 1 sub sections can be selected?