PDA

View Full Version : How to delete files created by the app while uninstallation?



karlmueller
01-01-2005, 09:11 AM
I have created a setup for an application wich created additional files at its first startup. But when the user uninstalls this app or removes the feature to wich those files belong those files will stay their.

What shall I do to let setup delete this files at uninstallation or removal of the feature?

Thank You

Christopher Painter
01-01-2005, 09:18 AM
Please look at the documentation on the RemoveFiles table.

karlmueller
01-01-2005, 12:37 PM
I have tried this but it dosn't works for me because the app creates files in multible subidirs of a driectory an I need a methode to remove the entire contents of an folder or even the folder itself.

Thank You

Christopher Painter
01-01-2005, 01:17 PM
Sucks don't it? Thank Microsoft and read this thread:

http://community.installshield.com/showthread.php?t=141971

If its just one folder you should be ok. But if you have many possible sub folders your table entries are going to get complex. You may end up having to create a custom action.

karlmueller
01-01-2005, 03:20 PM
So I will have to create a custom action.

I think I will go and add a custom action using the deltree.exe

Thank You

Christopher Painter
01-01-2005, 03:36 PM
You could use deltree.exe, but make sure it exists on your target machines. It doesn't come with NT products like XP. InstallScript has a file FolderDelete function, if you can withstand the cost of bringing the IScript engine along. Basically there are many ways to skin this cat.

karlmueller
01-02-2005, 11:59 AM
OK, I have sucessfully created a custom action wich deltes the entire folder wich includes the files created by the app.

But a the moment the directory will be deleted even if the user just removes the help and support files feature wich destroys the app completely. What shall I do to let setup perform those custom action only when the user removes the main-app feature?

Thank You

Christopher Painter
01-02-2005, 05:01 PM
You can build a custom action based on a conditional expression based around a feature operatior. This has been covered in Help and other threads. Reply if you cant find the information on the Feature operator.