Archive: Section Dependency Question


Section Dependency Question
I'm looking for a way to have three co-dependent sections.
Here is an example:

Sec1
Sec2
Sec3
Sec4

Sec1 is required (I have this figured out).
What I need help with is handling the following:
Sec2 is optional. Sec3 and Sec 4 are independent of each other, but both require Sec2.
Possible Senarios (1, 1+2, 1+2+3, 1+2+4, 1+2+3+4)
Not Valid Senarios (1+3, 1+4, 1+3+4)

Hopefully this is clear.

Thanks for the help!


So logically in .onSelChange check if Sec3 or Sec4 are checked, and if one of them are, then check Sec2 (if it isn't already checked, but a logic check for that shouldn't be necessary!) This should be very easy to implement.

Hang in there and I'll put it up on the Wiki for others to use.

-Stu


http://nsis.sourceforge.net/Section_Dependency

-Stu


Thanks a lot! It works great.

Nit Picking...
It's not possible to deselect Sec2 unless Sec3 and Sec4 are unchecked. Is it possible to have it so deselecting Sec2 automatically deselects Sec3 and Sec4?

Thanks


I'll make up some new macros to do this that 'link' Sections together which you can use in conjunction with the existing macros.

Edit: I was unable to make it work properly because one set of macro's won't work with the other. I need to make it into one set of macro's which means that we will probably only be able to have one to one relationship Sections (e.g. only one Section is linked to another, not 2 Sections to 1), but I shall think about it.

-Stu


I got it working but It wasn't possible putting it into a macro because it isn't dynamic enough that way (unless everyone only wants 2 sections dependent on 1 other).

You have to use it 'as-is' shown in the working script itself. If you need help using it let me know. The script SectionDependency.nsh header is no longer needed and you can delete it unless you are happy with the old script.

http://nsis.sourceforge.net/Section_Dependency

-Stu


That's EXACTLY what I needed. You are my official NSIS hero.
Thanks