Archive: Cancel installation without confirmation


Cancel installation without confirmation
I have MUI_ABORTWARNING defined, but on a custom page I've written I want the Cancel button to close the installer without first asking for confirmation under certain circumstances. How can I do that?


use your own function with .onUserAbort instead


I get an "Error: Function named ".onUserAbort" already exists." error when I try to add a .onUserAbort function (MUI_ABORTWARNING is not defined)


!define MUI_CUSTOMFUNCTION_ABORT might be my answer


So I wanted to use $(MUI_TEXT_ABORTWARNING) in my custom abort function, but I get warnings like this:
LangString "MUI_TEXT_ABORTWARNING" is not set in language table of language English

If I define both MUI_CUSTOMFUNCTION_ABORT and MUI_ABORTWARNING I don't get that warning, but then I get two warning dialogs (the built-in MUI one and my own). Anyone know a way around this? Or am I just going to have to write my own LangString?


This is the code I ended up with

Function customOnUserAbort
StrCmp $PreReqOK "false" NoCancelAbort
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(ABORT_WARNING)" IDYES NoCancelAbort
Abort ; causes installer to not quit.
NoCancelAbort:
FunctionEnd
I found the MUI_TEXT_ABORTWARNING text in the language files shipped with nsis and just copied it to my own language file for the different languages I support.

Thanks for your help Anders