views:

92

answers:

1

I have an uninstall issue with an app which is using sqlite: during installation a blank sqlite db is created in [CommonAppData]\MyApp\mydb.sqlite, e.g. C:\Documents and Settings\All Users\Application Data\MyApp\mydb.sqlite. When I uninstall my app it can't delete the sqlite db, despite it removing the applications that are connectng to it. Using process explorer I can see that it's explorer.exe that has a lock on the MyApp folder (not on the sqlite file).

I've not seen this sort of thing before. Is it possible this is caused by the app not correctly closing/disposing of connections? I understand that at some level windows manages the fact that several threads & processes are accessing my db file, and it handles the locking. Is it possible that if my app isn't closing connections etc correctly then windows gets confused about whether the file is locked or not?

Or is that not possible and it must simply be something wrong with my MSI?

thanks for any suggestions!

UPDATE: not only can I not delete the folder or file, if I create a new file in that folder (e.g. a new txt doc) I can then not delete that file! So it's some wacky lock on the folder....

UPDATE: actually...it might just be permissions on that folder! In my msi i was setting permissions on that folder, and I think I didn't give delete rights so when I uninstalled I didn't have access to delete it :-/

+1  A: 

Use handle.exe from the SysInternals collection to find out what has the remaining handle to the file.

It could also be your MSI, so check you are doing things in the right order by doing; msiexec /u mymsi.msi /lv* mylog.txt

Ryan ONeill
yes, handle.exe does the same thing as process explorer, and in this case shows that the handle is held by explorer.exe. I'm not sure if this indicates the file locking for sqlite went wrong, or the msi went wrong.
Rory
It sounds to me like a hidden cmd prompt is open in that dir or you have a folder view still open. I imagine you've checked for those, but I can't see it being anything else.
Ryan ONeill
nope, it must be something else. Even restarting my machine didn't work, until i restarted into safe mode.
Rory
The thing you are uninstalling, is it an Explorer extension? Because they don't go away until you kill Explorer and IE. Probably not, but that's the last thing I can think of.
Ryan ONeill