Archive: Detect that user has cancelled


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


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


Yes that works well and is so simple. Sorry if the question was obvious, I looked and couldn't find an answer.

Thanks


Logically it's obvious once you know but unfortunately there is no note about this in the NSIS documentation.

-Stu