Archive: Executing code if a Section has not been selected


Executing code if a Section has not been selected
I'm using NSIS 1.98.

What I want to do is display a message box if the user tries to install without selecting one of my optional sections.

The section is actually only semi-optional, as without it the program will throw the occasional error. But it's humongous, so I want to give the user the option of not installing it. If they decide not to include it, I want to add a message saying (basically) "Are you sure this is a good idea?" before allowing the user to pass the section selection screen.

How would I go about doing this? Sample source code would be lovely, as I have not played with the callback functions of NSIS at all, and I have a feeling they're going to be involved.


You will need to use SectionGetFlags as in this example:
http://www.clantpa.co.uk/nsis/wiki/i...llationOptions

You were right, you will need a callback for doing this. There are two callbacks that might fit, .onNextPage and .onSelChange. In .onNextPage you will have to count the number of pages past, and if you get to the page after the component page you will check for that section and let the user choose, use Abort to prevent from going to the next page if the user said he wants to change his selection. If you check it in .onSelChange the user will get the message right after he disselected that section. You will have to "remember" if you already used the message box so it won't show up even if the user changed another section and not that section.