Rolando
3rd February 2005 17:25 UTC
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
Anders
3rd February 2005 17:40 UTC
look in sections.nsh for helper macros
Rolando
3rd February 2005 19:33 UTC
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
kichik
3rd February 2005 19:51 UTC
"first" and "second" are not proper section identifiers. You need to use ${first} and ${second}.
Rolando
3rd February 2005 20:19 UTC
urm... I tried that but now only the first section is performed. Could it be that's because I'm using MUI ?
kichik
3rd February 2005 20:20 UTC
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.
Rolando
3rd February 2005 20:25 UTC
ah that was the case... it works now. Thanks.