简体   繁体   中英

.NET Setup Project Remove Installtion Folder On Uninstall

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM