Archive: Finish Page Cancel Button


Finish Page Cancel Button
Hi,
1. Enabling the Cancel button on the finish page
Either with !define MUI_FINISHPAGE_CANCEL_ENABLED) or
by calling EnableWindow on the cancel button handle

2. Register to the click event of the button
Either by !define MUI_CUSTOMFUNCTION_ABORT or
Register to the click event with NSD_OnClick within the finish page show function

3. When including MUI2 the button really becomes enabled
BUT
Clicking the button - does not reach the click callback
WHY?

4. When I have changed MUI2 to MUI the callback was called
BUT
The installer was not closed.
I have tried either Quit or Abort instructions
WHY?

So just to summarize - 2 questions please:

1. Why when using the MUI2 - the click callback is not called
2. Why the installer is not closed when the callback is called (when using MUI). How to close the installer?

Tx

Jammusi


Apparently MUI_FINISHPAGE_CANCEL_ENABLED is the issue.
Not that I understand why is that - I guess it is a bug???

When I use MUI_FINISHPAGE_CANCEL_ENABLED to enable the Cancel button (and only while using mui2) two things had happened:
1. The Click callback wan not called
2. The installer was not terminated

When I enabled the button withing the Show function of the page - I left MUI_FINISHPAGE_CANCEL_ENABLED was still there. This is why it had no affect.
Only when i marked the define - things had become OK.

Is this a deliberate behavior?

More over:

I dove a bit into the setup file and discover the following code in the interface.nsh

!macro MUI_FUNCTION_ABORTWARNING

Function .onUserAbort


!ifdef MUI_PAGE_FUNCTION_ABORTWARNING
Call ${MUI_PAGE_FUNCTION_ABORTWARNING}
!endif

!ifdef MUI_ABORTWARNING
!insertmacro MUI_ABORTWARNING
!endif

!ifdef MUI_CUSTOMFUNCTION_ABORT
Call "${MUI_CUSTOMFUNCTION_ABORT}"
!endif

FunctionEnd

!macroend
I had found that the MUI_PAGE_FUNCTION_ABORTWARNING is defined although NOT in my script
and even when i have undef this in the script - it always was there.

Now - when clicking the cancel button and since the MUI_PAGE_FUNCTION_ABORTWARNING was defined somehow, execution went into that if - and never "came back".

When I marked this ifdef the cancel button got back its expected behavior (at least that's what I would expect), even when MUI_FINISHPAGE_CANCEL_ENABLED was used.