Archive: delete $INSTDIR

delete $INSTDIR

one more little question i can not resolve:

In my uninstall section i delete all my installed files.

Example: If i install my app and i choose C:\MyCompany\MyService as Installation Directory, my uninstaller will delete the content of C:\MyCompany\MyService.

How to delete the whole path C:\MyCompany\MyService?


RMDir or RMDir /R

In the uninstaller, $INSTDIR equals $EXEDIR. So it just contains the path where uninstall.exe is stored. If the user moved your uninstaller, you'll end up deleting the wrong files/directory. Check whether $INSTDIR is correct before you use RmDir /r.


RMDir or RMDir /R or RMDir /R /REBOOTOK doesn't work.

After uninstall only the last folder of the path is deleted. For example C:\MyCompany\MyService, MyService will be deleted, but MyCompany stays.

Any other idea?


You can use the GetParent macro: