Archive: Installer pages based on install type


Installer pages based on install type
I have to make an installer that shows a custom dialog screen depending on what install type the user selects. Actually the problem is that there are there istall types, lets say A, B and C. C is basically both A and B combined. Now A and B are to be installed in separate directories. And if C is chosen, it needs both these directories.

Now the install directory page should also be shown based on what install type I have chosen. Also the custom dialog page itself would depend on the install type as information needed depends on the install type chosen.

There was an option where I could make blank 'Section', which are triggered on which install types I choose, but they are activated only at the file-copy stage. I need some information about the section chosen at the page just after the component install page so that I can build logic there?

At present I couldn't dig anything like that.


I have added this to the latest version in the CVS:

Hidden sections can now have SectionIn too. Old behaviour retained (hidden sections without SectionIn are in all install types).
This will make the task you are trying to accomplish a lot easier. You can now add hidden sections that are only in one install type, and according to their selection decide what install type was selected. The only problem is with custom install type.

To show or not show the directory page test for whatever you want to test in .onNextPage and .onPrevPage and use Abort if you need to skip pages.

Sections are selected/deselected in the component page. Their status, which you can get with SectionGetFlags, is also changed right after you click on them. You can check this status in .onNextPage and .onPrevPage and show/not show as mentioned before.

Hi kichik, thanks for the reply.

This will make the task you are trying to accomplish a lot easier. You can now add hidden sections that are only in one install type, and according to their selection decide what install type was selected. The only problem is with custom install type.
I had already thought of that, but the problem is that the information about which section has been selected needs to be had before the actual install proceeds. We can use this information only at the time of file copy.

Sections are selected/deselected in the component page. Their status, which you can get with SectionGetFlags, is also changed right after you click on them. You can check this status in .onNextPage and .onPrevPage and show/not show as mentioned before.
Actually, I haven't been able to figure out how to use SectionGetFlags and SectionSetFlags.

However, I decided to use my own method here. I use InstallOptions to have an extra page, from where I decide the install type using a listbox. I disable the default install selection box. So we can actually get the install type on .onNextPage. And in the hidden section installs, I use the flag that determines the section that I want installed to choose which files to install.

Pls advise as to if this method is OK, or I am simply trying to do a simple thing in a very roundabout way.

Thanks.

To understand how SectionGetFlags works look at one-section.nsi.
Instead of using a custom made IO page you can just disable custom selection using InstType /NOCUSTOM.
.onNextPage and .onPrevPage are called everytime the user moves to the next/previous page, so you can use them even if you don't use IO. Just count the pages and when you know you are after the components page use SectionGetFlags.