Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 12th August 2007, 19:17   #1
bl4d3
Junior Member
 
Join Date: Jul 2007
Posts: 16
Question selecting a subsection change anothers subsection status

hi,
as my subjects says i've the following problem:

if the subsection one is selected, the subsection two should automatically selected by installer. so the user must not select option two manually. the reason why i'm need this, is that option two is required for option one or with other words without installing option two option one isn't working afterwards the installation.

when option two is deselected option one also must automatically deselected.

PHP Code:
...
InstType "Full"
InstType "Minimum"
InstType "Custom"
...
SectionGroup "first"
 
Section /"option one"
 
SectionIn 1
  
...
 
SectionEnd

 Section 
"option two" //is required and only needed when option one is selected
 
SectionIn 1 2
  
...
 
SectionEnd
 Section 
"option three"
 
SectionIn 1
  
...
 
SectionEnd
 
...
SectionGroupEnd


SectionGroup 
"second"
 
...
SectionGroupEnd
... 
i've already searched for a solution, but i'm not sure about what to search. what i have found so far is that it should have to do something with the example one-section.nsi and .onSelChange and SectionSetFlags. problem is, what i've found so far doesn't seem approaching my problem.

can anyone help?

graphically:
Sectiongroup first
[_] option one
[_] option two
[_] option three
...

user make his choice:
Sectiongroup first
[x] option one
[_] option two
[_] option three
...

so the installer sets option two automatically as selected:
Sectiongroup first
[x] option one
[x] option two
[_] option three
...
bl4d3 is offline   Reply With Quote
Old 14th August 2007, 18:14   #2
darthvader
Junior Member
 
Join Date: Jun 2007
Posts: 38
I am not really sure about this method but give it a try

In the .onSelChange function Use the SectionGetFlags for the Section 1 and check if its selected by checking the SF_SELECTED flag. if so then Use the SectionSetFLags for the section 2. Now also check if section 2 is selected without selecting Section 1 by the above method. If so then deselect it by SectionSetFlags.

I hope this helps.
darthvader is offline   Reply With Quote
Old 17th August 2007, 16:54   #3
bl4d3
Junior Member
 
Join Date: Jul 2007
Posts: 16
Lightbulb

i'm very confused about how to do this stuff. i've searched again and found this topic: h t t p ://forums.winamp.com/showthread.php?s=&threadid=272007&highlight=SectionSetFlags (so sorry guys for my double post)

Afrow UK gives an very good example there on how to do this. i take his code and made an example installer (without the possibility to install of course). see this example in the attached file here.

problem is that i don't really understand what's going on in this code.
another prob is that, you must select "option two" twice beforce the required "option one" is automatically selected.


ps: if a forum moderator read this, i have two questions: why is it impossible two post a link to a nsis forum site and why is it also impossible to search for the keyword "winamp"?
Attached Files
File Type: nsi section_dependencies.nsi (1.4 KB, 188 views)
bl4d3 is offline   Reply With Quote
Old 18th August 2007, 03:10   #4
darthvader
Junior Member
 
Join Date: Jun 2007
Posts: 38
Here you go. I have modified the script to be executed correctly.

How does it work??

Assume 2 states which require modification


State 0 : When option 2 is selected option 1 needs to be selected.

State 1: When option 1 is unselected option 2 needs to be deselected.

I have initialized to state 0 in oninit. When it both the options are selected it automatically moves to state 1(since we need to keep checking if option 1 is selected). If option 2 are deselected it moves to state 0(since we need to keep checking for option 2 being checked so that we can check option 1).

I hope my explanation helped.
Attached Files
File Type: nsi section_dependencies.nsi (1.4 KB, 241 views)
darthvader is offline   Reply With Quote
Reply
Go Back   Winamp 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