Archive: Required sections and SectionIn


Required sections and SectionIn
Hi,

I'm creating an installer which can install a client, a server or both on a system. What I would like to do is to have a specific configuration file for each option copied to the destination directory. I tried to achive this by creating three required sections in combination with a SectionIn, but it didn't seem to work.

I have two sections, "Client" and "Server" (plus a few other required sections), and three install options ("Client-only", "Server-only" and "Full"). My idea was to create three required sections, like this:

Section "-ClientCfg"
SectionIn 1
; Copy configuration file
SectionEnd

Section "-ServerCfg"
SectionIn 2
; Copy configuration file
SectionEnd

Section "-FullCfg"
SectionIn 3
; Copy configuration file
SectionEnd

Does anyone have any ideas how I could solve this problem? I would appreciate a quick response because I have to be done with this installer by tomorrow afternoon (CET).

Best regards,
T-Tex


Hi T-Tex,

A required section will be executed regardless of whether or not it is chosen in a section list.

By using some InstType switches, you can prevent the component list from showing up, as well as allowing certain sections not to run.

So, the script would then be like this:

ComponentText 'Please select the type of installation that suits you.'
InstType /NoCustom
InstType /ComponentsOnlyOnCustom
InstType 'Client Only'
InstType 'Server Only'
InstType Both

Section ClientCfg
SectionIn 1
; Copy configuration file
SectionEnd

Section ServerCfg
SectionIn 2
; Copy configuration file
SectionEnd

Section FullCfg
SectionIn 3
; Copy configuration file
SectionEnd
which seems to fulfill your needs. If not, just say so.

Just wondering, why exactly do you need the Client Only/Server Only/Both installation types instead of just two check boxes with 'Client' and 'Server'? What extra needs to be done if both are installed?

Hi petersa,

Thanks for the response. It almost works, it seems that the first switch is ignored. But that is ok, unless someone has an idea how to get around it.

The reason that I want this is because the configuration file should only contain the information needed for the particular installation selected by the user. It is not strictly needed, but it is nice to have a configuration file that isn't filled with information that isn't used by the application.

/T-Tex


If you are talking about the top one always being required the only work around to this that i know of is just have the top Section your program name and have no code executed under it..