Archive: Choosing sections to apply


Choosing sections to apply
Is it possible to choose which section to apply and which not to apply if I'm NOT using a components page ?

I'm using a custom page with radiobuttons and I want each button associated with a different section.

Thanks,
Rolando


look in sections.nsh for helper macros


ok I found SelectSection and UnselectSection macros but they can't seem to work properly. Here's the code I'm using:

Function select

ReadINIStr $0 "$PLUGINSDIR\opts.ini" "Settings" "State"
StrCmp $0 0 sel
Abort

sel:
!insertmacro MUI_INSTALLOPTIONS_READ $0 "opts.ini" "Field 5" "State"
StrCmp $0 "1" s1
!insertmacro MUI_INSTALLOPTIONS_READ $0 "opts.ini" "Field 6" "State"
StrCmp $0 "1" s2

s1:
!insertmacro SelectSection first
!insertmacro UnselectSection second
goto end

s2:
!insertmacro UnselectSection first
!insertmacro SelectSection second
goto end

end:

FunctionEnd

"first" and "second" are not proper section identifiers. You need to use ${first} and ${second}.


urm... I tried that but now only the first section is performed. Could it be that's because I'm using MUI ?


If only the first section is performed, it's probably because you put the function above the section definitions. The section identifier are only defined after the section instruction is processed. Move the function below the sections and it should work.


ah that was the case... it works now. Thanks.