Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 26th February 2004, 20:45   #1
Devion
Junior Member
 
Join Date: Feb 2004
Posts: 18
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.
Devion is offline   Reply With Quote
Old 26th February 2004, 21:14   #2
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
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
Vytautas is offline   Reply With Quote
Old 26th February 2004, 21:28   #3
Devion
Junior Member
 
Join Date: Feb 2004
Posts: 18
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...
Devion is offline   Reply With Quote
Old 26th February 2004, 21:36   #4
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Asuming that your are using the latest version of NSIS this code should do the trick:
code:
...
!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
Vytautas is offline   Reply With Quote
Old 26th February 2004, 21:55   #5
Devion
Junior Member
 
Join Date: Feb 2004
Posts: 18
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!
Devion is offline   Reply With Quote
Reply
Go Back   Winamp 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