Old 10th October 2006, 08:47   #1
Shadowbird
Junior Member
 
Join Date: Oct 2006
Posts: 1
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?

code:
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

Shadowbird is offline   Reply With Quote
Old 10th October 2006, 16:57   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 18th October 2006, 04:37   #3
sunlight112
Senior Member
 
Join Date: Oct 2006
Posts: 129
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,
sunlight112 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump