Archive: Cancel installation


Cancel installation
Hello.

I have made an installer that downloads several packages and unzips them, and I have the following (unrelated?) problem.

When I press "cancel" during the installation, the installer simply proceeds to the next package download, i.e. I have to press cancel about 70 times to actually cancel the installation.

Is there any way of making NSIS going all the way to the "Installation aborted" screen by pressing cancel only ONCE?


You may want to refer to NSIS documentation,
4.7.2.1.9 .onUserAbort,
4.9.4.8 IfAbort,
These should help.


IfAbort couldn't be used as the documentation said, as I'm using modernUI (Page instfiles instfilesLeave vs !insertmacro MUI_PAGE_INSTFILES).

.onUserAbort didn't work either, it just aborts the current NSISDL-job and goes on to download the next package, just like before.


IfAbort couldn't be used as the documentation said, as I'm using modernUI (Page instfiles instfilesLeave vs !insertmacro MUI_PAGE_INSTFILES).
See MUI documentation chapter 4. Custom functions


.onUserAbort didn't work either, it just aborts the current NSISDL-job and goes on to download the next package, just like before.
Perhaps you should add a Quit somewhere on that function.

Check the return value of NSISdl (see the readme file). When the download has been cancelled, you can abort the installation.


the return value was what I was looking for


thanks a TON!!!


Now I have a similar problem with nsisunz :)

The cancel button is completely GREYED OUT during the unzipping process, is there any way to fix that at all, or can I just give up about that right away? :)


No possible to enable the cancel button on page InstFiles pre function, because if you do so, the nsisunz plugin refuses to load the zip file.
It might be possible with the button event plugin though, no tested, you should give it a try.
http://nsis.sourceforge.net/File:ButtonEvent.zip
Even if somehow you'd achieve it, you should take in count what you're going to do with the remaining half extracted files on $INSTDIR.