Skip to content
⌘ NSIS Forum Archive

Folders don't get removed even though they are empty...

2 posts

Marbled#

Folders don't get removed even though they are empty...

Hi!

In the uninstall procedure of my install program once the files have been removed I tried to remove the install directory and its parent (the install directory is the name of the product, the parent directory the name of the company).

Unfortunately it doesn't work (both the installation directory and its parent stay there... I understand the parent cannot be removed if the installation directory is still there but why isn't the installation directory removed if it is empty...

This is the relevant part:


; If the install directory is empty, we remove it...
RMDir $INSTDIR

; if the parent directory of the install directory is empty, we remove it...
${GetParent} $INSTDIR $R0
RMDir $R0
I know I could put a "/r" but I don't want to erase files that were not part of our application (or created by the install program or the application).

I am pretty sure all of it worked before and the only thing of significance I did since that time was update to 3.0 RC1... I could be wrong though...

Any ideas as to what might be wrong?

Thank you and have a nice day!

Nick
Anders#
RMDir /r is not more powerful when it comes to removing empty directories.

Two common issues are; not actually empty or locked by something. It could be locked by some other process (Explorer etc.) or by the installer. You could try "SetOutPath $Temp" before RMDir. Process Explorer can search for open handles to filesystem objects and that might be worth a shot...