Archive: SectionGetFlags only gets the first section


SectionGetFlags only gets the first section
Hi. I'm new to this (only installed NSIS yesterday), so please forgive me if this is a stupid question, but here goes. The code below always shows the flags of Sec1. That is, when Sec1 is selected, the message is "1,1,1", and when not selected, it's "0,0,0", regardless of other sections. I was expecting to show each of the section's flags in each variable, what am I doing/understanding wrong?

Name "Test"
OutFile "test.exe"
InstallDir "$PROGRAMFILES\test"

Page components

Function .onSelChange
SectionGetFlags SID_1 $0
SectionGetFlags SID_2 $1
SectionGetFlags SID_3 $2
MessageBox MB_OK "$0, $1, $2"
FunctionEnd

Section "Sec1" SID_1
SectionEnd

Section "Sec2" SID_2
SectionEnd

Section "Sec3" SID_3
SectionEnd

It's ${SID_1} not SID_1 for SectionGetFlags ${SID_1} is just a constant that contains the section index. You also need to move Function .onSelChange below all your Sections.

-Stu


I have the same problem, so I must post here.
I want to create mandatory section and I has read on Wiki about SectionGetFlags.However, I only create one require but my purpose want to create a lot
My code here:

Name "One Section"
OutFile "one-section.exe"

Page components

Section !Require
SectionIn RO
SectionEnd

Section "Set up JDK-1_5_0_08-windows-i586-p" SEC0000
SectionEnd

Section /o "Set up my sql 5.0" mysql
SectionEnd

Section "Set up game" game
SectionEnd

Function .onInit
SectionSetFlags ${SEC0000} 17
FunctionEnd

My opinion that user must set up JDK. After JDK is installed, RadioButton on JDK must be checked and next will install My SQL and so on.
What do we know when user click on radiobutton JDK to start process?
One more question "How can we know JDK is checked and run My SQL?"
Thank alot,