Archive: Allow user to cancel during install?


Allow user to cancel during install?
Once the installer has started copying files, it seems the cancel button becomes disabled, and it does not let a user cancel the install unless something goes wrong (in which case it displays an error and enables the cancel button). Is there some way I can tell NSIS to always have the cancel button enabled? If I just send the windows message to enable the button, is the installer going to function correctly (i.e. stop if a user hits cancel), or does it expect the cancel button to stay disabled?


You can't enable the cancel button yet. It was originally planned for v2 but it looks like it will have to wait for 2.1. Enabling it manually will not work as you expect it, you shouldn't do that.


Well... it seems all of the functionality is there for what I want to do (i.e. if the installer gets an error copying files, it exits out gracefully), it seems like it would be trivial for a user to trigger this condition... but okay, I'll wait and see if you get the feature in before our game ships.

Thanks for the quick response!


Well, there are still some issues with it such as stopping plug-ins, stopping executed programs and not leaving partially installed applications behind.


Well, for stopping Plugins, that's the purpose of the .onUserAbort thing, right?

And leaving partially installed applications behind is the expected behavior of canceling an install... in fact I think it might be the desired behavior, depending on the situation.

But, okay, I'll just keep on the lookout for when the feature is in...


Originally posted by Wasteland
Well, for stopping Plugins, that's the purpose of the .onUserAbort thing, right?
Not exactly. NSIS is not thread safe when it comes to scripting, it can't execute two scripts on the same time. So we can't execute .onUserAbort if a plug-in is already running. The plug-in will probably need to subclass and figure out if the user clicked the cancel button on its own. It'll probably be a opt-in option for plug-ins.

We'll cross all those bridges when we get to them, currently we have NSIS 2 to release first :)

So, now that 2.0 is out :) any word on canceling during file extraction? I have a plug-in that decompresses files and I'm decompressing close to 3 gig of data... I would like to put a cancel option in if possible without having to resort to something like what the realprogress plugin does (for the progress bar) and hijack or mimick the cancel button...

Owen.


No. But there's this:

http://sourceforge.net/tracker/index...49&atid=373087