Skip to content
⌘ NSIS Forum Archive

Create InstType with dynamic section list

2 posts

bambou51#

Create InstType with dynamic section list

I need to select an installation type from a combo, each installation containing a specific required section (the user can not unselect it).
I tried the following but it is not working:

InstType "type1"
InstType "type2"
InstType /NOCUSTOM

Section "Section1" Section1
Section 1 RO
SectionEnd

Section "Section2" Section2
Section 2 RO
SectionEnd

...

Function .onSelChange
GetCurInstType $0
${If} $0 = 0
SectionSetText ${Section2} ""
SectionSetText ${Section1} "Section1"
${Else}
SectionSetText ${Section1} ""
SectionSetText ${Section2} "Section2"
${EndIf}
FunctionEnd
...

I also have the same thing within onInit.
My problem is that when selecting Type1 it is working fine, but when selecting type2 I only have an unselected empty section.

Any idea?
kichik#
Changing the section names in .onSelChange doesn't show or hide them. That only works before the components page actually shows. You can create a fake section that'll only have a name, either "Section1" or "Section2", depending on the installation type.