safl
17th October 2005 11:07 UTC
SectionIsSelected in section?
Hello!
I'm trying to use SectionIsSelected from Sections.nsh, to write some config files when certain sections have been selected. I'm executing this code inside my first section:
${If} ${SectionIsSelected} ${SEC03}
WriteIniStr DIR GROUP KEY VALUE
WriteIniStr DIR GROUP KEY VALUE2
WriteIniStr DIR GROUP KEY VALUE3
${EndIf}
When i compile i get the warning:
"warning: unknown variable/constant "{SEC03}" detected, ignoring (macro:_SectionFlagIsSet:2)
How can i fix this? I've tried using the .selChange or what's it's name. but problem is that the config file i want to write to haven't been installed at this point.
Regards,
Simon
glory_man
17th October 2005 13:18 UTC
First you need to declare SEC03 constant. So use
Section "Name" SEC03
. After that use it.
safl
17th October 2005 14:40 UTC
Too bad. This means i can't do this when my section is declared before the section i wan't to check.
NHOCSUNG
17th October 2005 18:03 UTC
You can use Section Index to set flag, If i'm wrong 2 indicate to this section, so
${If} ${SectionIsSelected} 2
WriteIniStr DIR GROUP KEY VALUE
WriteIniStr DIR GROUP KEY VALUE2
WriteIniStr DIR GROUP KEY VALUE3
${EndIf}
there is no need to Name Sections
NHOCSUNG
17th October 2005 18:05 UTC
This mean you can set Section Description with Numbers
safl
17th October 2005 21:15 UTC
Ok, got it working.