Archive: 2 sections like radio buttons


2 sections like radio buttons
I have 2 sections in COMPONENTS page.
I want to make the following: when the user will choose the first section the second section was disabled, when will choose the second - the first was disabled. Like radio buttons.

And if the first section has been chosen the install path will be such c:\sec1, if the second section has been chosen the install path will be such c:\sec2.

How it to make?


See sections.nsh and the one-section.nsi example (there is radiobutton macro in the section.nsh). To change install path during installation use SetOutPath in the section


I want, when the user will choose the first section then in MUI_PAGE_DIRECTORY the install path was c:\sec1 (in "Install path" text-box), if 2nd section - in MUI_PAGE_DIRECTORY the install path was c:\sec2.


Use code like this:


InstallDir "c:\sec1\"
...
Function .onSelChange

...radiobutton code here...

!insertmacro SectionFlagIsSet ${sec1} ${SF_SELECTED} 0 sec2
StrCpy $INSTDIR "c:\sec1\"
goto end
sec2:
StrCpy $INSTDIR "c:\sec2\"
end:
FunctionEnd

Thanks! It works.

Where I can read the help about SectionFlagIsSet? In NSIS User Manual about it is not written.


SectionFlagIsSet is a part of Sections.nsh. There are some comments in this file above this macro.


[edit]
From doc:

4.9.13 Section Management
...
For useful macros and definitions, see Include\Sections.nsh.
...
However, if you want to add more information in the documentation about those macroses you can add feature request. :) Maybe this will be helpful someone.