Skip to content
⌘ NSIS Forum Archive

Delete all files and folder on uninstalling

4 posts

Engelium#

Delete all files and folder on uninstalling

Hi

I've another problem: I realized a script with uninstaller .... the problem is that when I execute the uninstaller it removes only the files copied during the setup procedure, but in that directory there are also others files created by the program I realized.

How to set the uninstaller to remove ALL files and the entire directory?

Thanks🙂
fabian.rap.more#
Delete "$INSTDIR\file1"
Delete "$INSTDIR\file2"
Delete "$INSTDIR\uninst.exe"
RmDir /r "$INSTDIR"
Red Wine#
Consider the potential danger when using RmDir with the /r switch. It's been reported several times that the entire Program Files directory has been removed because of incorrect usage.
Here's a recent thread about,

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Engelium#
Well I solved the problem using

Delete "$INSTDIR\*.*"
RmDir /r "$INSTDIR"

There is any problem using this script?