Skip to content
⌘ NSIS Forum Archive

nsDialogs and quit

9 posts

zeeh3#

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 
elllit#
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
zeeh3#
Sorry, I meant does not quit the installer. The macro NSD_OnClick already handles the code you supplied.
elllit#
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?
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
Afrow UK#
Another option is to use this instead:

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
zeeh3#
Thanks for all the answers.

Function LeaveInstaller
  Pop $0
  SendMessage $HWNDPARENT ${WM_CLOSE} 0 0
FunctionEnd 

did the trick 🙂
Yathosho#
Originally Posted by Anders View Post
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 🙁
Anders#
Originally Posted by Yathosho View Post
the problem is, you will still get to see the abort message 🙁
The abort message comes from Modern UI IIRC