Archive: enable cancel button to stop in the middle of installation


enable cancel button to stop in the middle of installation
Best regards.

For weeks I tried to add a cancel button to stop the installation process, ie enable cancel button while you are copying the files to the hard disk.

Thank you very much in advance.:up:

My nsi template


The issue is that NSIS is not a transactional installation system like MSI, thus what do you plan to do about the previously completed installation operations?

I performed a search on the forums, which I'm sure you already did... right?, and found several threads on the topic. None of which that seam to conclude in a working solution.

Unless you use a custom extraction plug-in or external utility, I don't see an easy solution without recompiling NSIS for your own needs.


I plan to delete the installation process if you click cancel. Uninstall the average installation. If the solution is a plugin, what I recommend?

It is very important for me to cancel the installation process, I'm installing a very large software and the person might regret in the middle of the process.

Thanks :up:


This question seems to pop up with some regularity. I can't really -recommend- trying to get around this, but it is possible. There's some old thread where I posted an example using the NSIS classic UI that I was going to point to - but then I saw somebody mentioned they couldn't get it to go with Modern UI 2.

So I gave it a reworking and decided to write up an NSIS WiKi page that contains the example and the steps taken to get from a skeleton installer to the end result, and why those steps were/had to be taken. That way everybody can add enhancements / correct problems / etc.

You can find it at the (hopefully quite logical) topic:
http://nsis.sourceforge.net/InstFile...ring_InstFiles
( InstFiles Cancel - Allowing a user to cancel installation during InstFiles )

Be warned - it's a pretty long topic, and even the end-result code may look daunting. As Zinthose mentioned.. you weren't meant to do this with NSIS. On the other hand, the fact that you -can- is testament to its flexibility? :D

Good luck!