Link to home
Start Free TrialLog in
Avatar of atomicgs12
atomicgs12Flag for United States of America

asked on

Visual Studio setup, how to uninstall folder with files in it.

I have a Microsoft Visual Studio 2010 win32 application and recently I’ve added a Setup Project to create a .msi install/uninstall file. I created a custom folder, let’s call it c:\myfolder\logs, that gets created on install. When my application runs it creates a log file that it creates and placed in the ‘c:\myfolder\logs’ folder. My problem is that on uninstall everything is uninstalled except for the ‘..\logs’ folder’. I believe this is because there are files within the …\logs folder.

Is there some way to tell the Setup Project I want this folder and all files within deleted on uninstall?

I really don’t want to have to create a ‘custom dll’. Seems like a lot of work for a simple request.

Thanks.
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

You can use the  RemoveFiles action, for that you will need to use the RemoveFile Table.
Alternatively you can create a simple bat file to delete the directory.
Avatar of atomicgs12

ASKER

if I created a bat file how would I get VS setup to run the bat file at uninstall time?
Thanks
Action Test
Type 34
Source SystemFolder
Target cmd.exe /c c:\test.bat
ExtendedType <blank>
ASKER CERTIFIED SOLUTION
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial