Archive: SelectSection doesn't work


SelectSection doesn't work
i'm using the SelectSection macro from the "Sections.nsh" header included with NSIS to manually select/unselect sections (using a custom InstallOptions page instead of the Components page) but it doesn't work. This is the code I use:

ReadINIStr $R0 "$PLUGINSDIR\demo_select.ini" "Field 2" "State"
StrCmp $R0 "1" xcomdemo check
xcomdemo: !insertmacro SelectSection XcomDemoSec
check:
ReadINIStr $R0 "$PLUGINSDIR\demo_select.ini" "Field 3" "State"
StrCmp $R0 "1" tftddemo end
tftddemo: !insertmacro SelectSection TFTDDemoSec
end:

So... what am I doing wrong?

You can't put different commands on the same line. So split up the labels from !insertmacro SelectSection.


Originally posted by deguix
You can't put different commands on the same line. So split up the labels from !insertmacro SelectSection.
i've always done it without problems.
and... it still doesn't work :(

have you included Sections.nsh ?


Deguix, a label and a command can be on the same line.

There are two problems I see. First, Sections.nsh macros can not control InstallOptions pages. Second, XcomDemoSec is the define name, use ${XcomDemoSec}.


Deguix, a label and a command can be on the same line.
I said that because I never used it, and that lately I'm not using NSIS as often as before.

Originally posted by kichik
Deguix, a label and a command can be on the same line.

There are two problems I see. First, Sections.nsh macros can not control InstallOptions pages. Second, XcomDemoSec is the define name, use ${XcomDemoSec}.
First, it's the InstallOptions page that controls the macros. Second, thanks, it works now :)