Archive: SectionIn and SetCurInstType


SectionIn and SetCurInstType
I am trying to design an Installer that will in some cases ask the user for an Installation type ("Client" or "Server"), and in other cases default to "Server". In the latter case, in .onInit, I use SetCurInstType to set the value to "1" -- "0" being the Client installation.

I realize that the Installation Type is 0-based, and SectionIn values are 1-based. But when I set the Installation Type to "1" in the onInit function, a section that has a "SectionIn 2" statement is not included during that installation.

The script has the following order:

- General definitions and macros
- Configuration
- Install Options
- Modern UI Configuration
- Pages
- Languages
- Language Strings
- Data
- Reserve Files
- Install Sections
- Descriptions
- Uninstall Section
- Functions:
- .onInit
- etc.

Any thoughts?

Dave


Can you attach an example script that compiles on every system?

Also note that SetCurInstType only works when your installer has a components page that is shown during the installer configuration.


See, that's just it. For this particular installation, I don't want to display a components page. There is no choice to make, so I want to bypass it altogether and set the installation type myself.

As for attaching example script, I'm not sure how to pick out the parts that might be relevant. It's just as I described above. During .onInit, I set the current installation type to "1", but the SectionIn commands don't seem to care.

Why is a components page required? Why doesn't the SectionIn command simply check the current installation type? I suppose I could include a components page if required...


This is a limitation of the current installation type system. If you don't want to display a components page you'll have to add some script code in your sections (for example, check the value of a variable you have set).