fbs icon indicating copy to clipboard operation
fbs copied to clipboard

[Windows] NSIS - Do not delete installation directory if not empty

Open fservida opened this issue 5 years ago • 1 comments

In: https://github.com/mherrmann/fbs/blob/master/fbs/_defaults/src/installer/windows/Installer.nsi RMDir should not have the /r flag on the uninstaller. As per documentation (https://nsis.sourceforge.io/Reference/RMDir) this runs the risk of the user involuntarily choosing an installation directory containing other data and wiping it upon uninstallation.

I've had one report from one user installing by error to desktop, and upon running the uninstaller to remove all the app files and reinstalling in the right folder, the uninstaller also took out the desktop folder, with all the user content.

fservida avatar Mar 21 '20 14:03 fservida

As far as i can remember: Without the /r flag RMDir only removes directories are empty. The solution to this problem is to make NSIS remember the list of files that were installed, then remove them one-by-one. There are solutions to this online I think.

I don't have time to fix this; But if you submit a Pull Request, I'd be happy to merge it.

mherrmann avatar Mar 23 '20 05:03 mherrmann