Archive: Run function when NEXT is clicked on the components page


Run function when NEXT is clicked on the components page
Is there any way to run a function when the user clicks on NEXT on the components page?

I want this to do a check on a few things, but the check is only required when certain components are selected.

And how can I make the function STAY on the components page if it's found something wrong (and continue when everything is ok)?

I've got everything else covered... Just not sure on how to call this function (does an .onComponentsPageNext exist for example?), and how I can let it stay there if required.


You sould define a leave function for the components page, check the manual anout how to define a leave funcion as its use depends if you use MUI or not.

To get the function to stay on the current page just call the abort command from the leave function.

Vytautas


I'm using MUI indeed....

I noticed the leave-funtions, that's exactly what I want. But the MUI documentations only shows a leave-function for a custom page. MUI_COMPONENTSPAGE_LEAVE does not exist... :(


Asuming that your are using the latest version of NSIS this code should do the trick:

...
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE yourfunction
!insertmacro MUI_PAGE_COMPONENTS
...

Note that the leave functions should be defined before each page that they are required for.

Vytautas ;)

Hey... that works!

Not sure if you ment it that way, but:
- The function itself should be declared AFTER the sections (or the functions wont recognize sectionnames)
- The !define part must come BEFORE the !insertmacro part. This is what went wrong with me.

Thanks for your help... My Installer is mega-nifty now! NSIS rocks!