st80rules
26th April 2006 22:06 UTC
Detect that user has cancelled
Hi,
I have a custom page that uses the Modern UI, which has validations at the end of the function. Right now if I press Cancel, the usual dialog pops up confirming if I want to abort the install, if I say Yes then the validations are performed and possibly popup another message, something I'd obviously like to avoid.
I want to bypass the validations if the user cancels or presses the back button. How can I detect those two states?
Thanks
Afrow UK
26th April 2006 22:16 UTC
You aren't meant to validate the form in the Show function of a custom page. You are meant to validate it in the Leave function. Firstly, the Leave function is only called when the user clicks the Next button, and secondly the Leave function is actually called before the plugin exits.
Page Custom ShowFunc LeaveFunc
-Stu
st80rules
26th April 2006 22:21 UTC
Yes that works well and is so simple. Sorry if the question was obvious, I looked and couldn't find an answer.
Thanks
Afrow UK
26th April 2006 22:39 UTC
Logically it's obvious once you know but unfortunately there is no note about this in the NSIS documentation.
-Stu