Old 29th November 2001, 08:41   #1
t-tex
Junior Member
 
Join Date: Jul 2001
Location: Uppsala, Sweden
Posts: 5
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
t-tex is offline   Reply With Quote
Old 29th November 2001, 09:51   #2
petersa
Senior Member
 
petersa's Avatar
 
Join Date: Apr 2001
Location: Melbourne, Australia
Posts: 207
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:

code:
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?
petersa is offline   Reply With Quote
Old 29th November 2001, 10:39   #3
t-tex
Junior Member
 
Join Date: Jul 2001
Location: Uppsala, Sweden
Posts: 5
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
t-tex is offline   Reply With Quote
Old 29th November 2001, 12:08   #4
Schultz
Member
 
Join Date: Oct 2001
Posts: 71
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..
Schultz 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