Archive: Conditional Sections Order


Conditional Sections Order
Is there a way to call a function from a section based upon weather or not another section is selected?

example:

Section "#1 (required)" ; (default section)

if section #2 is checked
call section2
else
call otherFunction

SectionEnd

Section "#2 (otional) ; (optional section that needs to run 1st)

call backUp

SectionEnd

It may sound retarded but what i'm trying to accomplish is have a default section and the optional section #2 backs up files that are over written by section #1 so it actualy needs to run section #2 berfore it runs section #1 so the files don't get clobbered

if anyone knows how i could do this that would be great ... i guess i could do it with dialouge boxes and just one section but i'd rather have the check box option.


Something like this may do the trick -

Section "#1 (required)" ; (default section)

Push "N" ; Flag used to record if section 2 gets processed

SectionEnd


Section "#2 (otional)"

Call backUp
Pop $0
Push "Y" ; section 2 has been processed

SectionEnd


Section - ; hidden section to perform real section 1

Pop $0
StrCmp $0 "Y" isChecked notChecked

notChecked:
Call otherFunction

isChecked:

SectionEnd


HTH!

--
Dave Laundon.