Archive: Avoiding the use of "RMDir /r @INSTDIR"


Avoiding the use of "RMDir /r @INSTDIR"
I've seen the warning about using "RMDir /r @INSTDIR" and the code sample for Uninstalling only installed files and that all make sense. But what I can't see in that example is how to safely delete the installation directory during uninstall - it just removes the files. Is there a safe way of doing this or do I just leave an empty directory?

Thanks for any help.


RmDir only removes a directory if it's empty. This means it's always safe to RmDir $INSTDIR. If you want to remove subdirs, then you can use the Locate macro in FileFunc.nsh: http://nsis.sourceforge.net/Docs/AppendixE.html#E.1.2