Archive: nsDialogs and quit


nsDialogs and quit
  Please, I need some help here. How can I set the installer to quit with nsDialogs? This is not working:


...

${
NSD_CreateButton} 335 137 75 23 "Quit"
Pop $BUTTON

>${NSD_OnClick} $BUTTON LeaveInstaller
>...

Function LeaveInstaller
Pop$0

Quit
FunctionEnd
>

Hi,

"not working" as in "throws an error" or as in "does not quit the installer"?

Also did you try the following?


GetFunctionAddress $0 LeaveInstaller
nsDialogs::OnClick /NOUNLOAD $BUTTON $0

Sorry, I meant does not quit the installer. The macro NSD_OnClick already handles the code you supplied.


Originally posted by zeeh3
The macro NSD_OnClick already handles the code you supplied.
True, sorry.

Well, at least I can say that it's the same here. The installer wont quit.

As long as it remains unresolved: Can you think of a workaround using the leave callback of the page?

nsis only checks the quit flag at some point in its code i think, you could probably hack around it by sending the wm_close message to $hwndparent


Another option is to use this instead:
http://nsis.sourceforge.net/Go_to_a_NSIS_page
You can supply X to initiate a cancel button click.

Another option, if Quit is handled say on page exit, you could try that function and just go to the next page after calling Quit.

Stu


Thanks for all the answers.


LeaveInstaller

Pop$0

SendMessage $HWNDPARENT${WM_CLOSE} 0 0
FunctionEnd
>

did the trick :)

Originally posted by Anders
nsis only checks the quit flag at some point in its code i think, you could probably hack around it by sending the wm_close message to $hwndparent
the problem is, you will still get to see the abort message :(

Originally posted by Yathosho
the problem is, you will still get to see the abort message :(
The abort message comes from Modern UI IIRC