DeleteFiles

Got a problem you cannot solve? Try here.
Post Reply
cdmackie
Posts: 4
Joined: Mon Feb 28, 2005 1:09 pm

DeleteFiles

Post by cdmackie »

I can't seem to get the DeleteFiles function to work. I am trying to delete the folder in Docs and Sets\\<username>\\Application Data\\My Company\\My Product and calling DeleteFiles() during my uninstall, but it doesn't seem to do anything.

I tried just setting DeleteFiles to delete "c:\\temp\\test" and that didn't do anything either. Am I doing somthing wrong? And does it delete recursively?

Thanks.



Colin.
sinan
Site Admin
Posts: 1035
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

This is a common source of confusion. What you need to do is the following:

1) Cut the command that executes in the uninstall routine
2) Paste it into your install routine
3) The command has two check boxes: "delete on install" and "delete on uninstall". Make sure only the latter one is checked.

Because of the way MSI works, this counter-intuitive way is the right way to do this. Think of it as "scheduling" the command for execution during uninstallation. Please read the help file topic "Getting Results\\Setup Commands Preceding Apply Uninstall" for more information - it does a great job of explaining exactly what's going on and why it works this way.

Let me know if you need more help!
Sinan
Post Reply