takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
896 stars 119 forks source link

Cannot cancel the installation #236

Closed mattiatantardini closed 2 years ago

mattiatantardini commented 2 years ago

Hi, I've noticed that the cancel button is not clickable once the installation is launched (the step after setting the installation path). Not a real issue, but it is annoying in case of heavy installations if you did some mistake in setting the path.

takluyver commented 2 years ago

Good question. Pynsist is built on top of NSIS, and it's not something Pynsist changes, so I did a bit of googling about why NSIS is that way.

The basic answer seems to be that the way NSIS installers run doesn't make it easy to undo the steps that have already been done, so 'just' cancelling would leave a half-complete installation which it may not be easy to uninstall again (e.g. it might not have written the uninstaller exe). In theory, you can write NSIS code to enable the cancel button and try to undo the partial installation, but it'd be a real pain to test. It's probably better for everyone just to let the installation complete, and then go and uninstall it again.

I think making an MSI based installer would get round this, because that's based on a system that will record & roll back changes. I did play around with using WiX at one point, but it's a very different system to NSIS, so making a Python wrapper for it would be a completely new project.

mattiatantardini commented 2 years ago

I understand, thank you for the explanation. Fair enough, then I'll go for the standard way

takluyver commented 2 years ago

Thanks!