Archive: Double cancel on custom page


Double cancel on custom page
I have a simple custom page with a cancel button on it. Clicking the cancel button prompts the user if they really want to abort, just like normal. Clicking Yes returns to the custom page. Clicking the Cancel button again again prompts and then finally cancels.

It is not getting into the Leave function for the page, I checked that. Very little customization has been done from a HMEdit-wizard created script.

There is a custom function for UserAbort which when removed drops all prompting - you still need to click cancel twice.

I've done a bunch of searching but I can't find anything about this.


Seems MUI_ABORTWARNING is defined, also seems you're checking the return value of the dialog.


Yes, but ....
I've gone through a couple of iterations of this.

There is a wizard-added UserAbort function that was referenced by MUI_CUSTOMFUNCTION_ABORT. What I have now is the following:

; MUI Settings
!define MUI_ABORTWARNING
;!define MUI_CUSTOMFUNCTION_ABORT "UserAbort"

I'm not checking any result from the custom page:

Function DisplayCustomerInformation
StrCpy $REGSERIAL ""
StrCpy $REGEMAIL ""
!insertmacro MUI_HEADER_TEXT "Customer Information" "Customer Information"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "CustomerRegistration.ini"
Push $9
InstallOptions::dialog "$PLUGINSDIR\CustomerRegistration.ini"
Pop $9 ; must pop this back off the stack, it contains the last button clicked

Return
FunctionEnd

I put in a MessageBox after the Pop at the end of this to just say "Hi there" and it comes out after the SECOND cancel.


Just a thought here
There is validation on this page with fields that must have content in them.

Could this be the problem?


Remove that Return call. Shouldn't make any difference but you don't need it nonetheless.

Stu