Question

I have a .NET setup project that installs and uninstalls my application fine but on uninstall it leaves the installation directory behind.

How can I delete this folder during/after the uninstall?

UPDATE: My application creates a cahce file in this directory when it runs which looks like the reason the folder is not removed during the uninstall.

Is there a way to remove this file so that the folder gets removed?

Was it helpful?

Solution

Normally the folder created during installation will be removed on uninstall.

This does not happen however, if that folder is not empty or another process has an open handle to that folder or a subfolder within. Therefore you should make sure that the folder is not opened somewhere in Explorer or a console window, you application is not running and you didn't place any additional files to that folder.

You can check with Process Explorer for open handles using the Find -> Find Handle or Dll command and entering the name of your installation folder.

You can get extended information and possible error messages by creating a log of your uninstallation:

msiexec /x myProgram.msi /l*vx log.txt

OTHER TIPS

yes you can remove these files/Folder by writing Custom Actions and adding entries in Remove File table. RemoveFile

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top