Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 6

Files in use on uninstall

When I uninstall my product the 'Files in use' dialog appears, listing the applications that are affecting the files.

I have read up on 'OnRMFilesInUse' and the help talks about the files that are locked.
I don't want the list of applications using the files, I want the names of the files affected.
That is, the names of my dlls etc. from the installation that can not be removed because they are in use.

Q. How does one get hold of the names of the files that are in use?

Q. Can I query the windows installer ?

Q. Is there a current list of these in the Installer DB ?

Q. Is there a property containing the list of these files ?

I've searched the community items and so far, found precisely zero help on this. Surely there is a simple answer to this one ?
Labels (1)
0 Kudos
(4) Replies
Level 6

The scenario is as:

The install places a dll in the SQL server binn folder and uses a script (run later in the install) to register the dll with SQL server, where it provides XP's.

However, during the uninstall we run another script to unload the dll from sql server then the file is free to be deleted.

The problem:
Seems that the un-install finds the file locked by SQL server when it starts, and thus displays the 'File locked' dialog with SQL server in the list.
So I need to stop that file causing the dialog display as it is removed without error even if you do not stop SQL server.
This is the theory. Would be very helpful if I could get that list of locked files (see last thread).
If that is not possible:

Q. Can I flag this file to be excluded from the un-installs checking for locked files ? N.B. file must still be removed by un-install.

Still would like to get that list of locking files though, as it might point to another culprit.

Any help is greatly appreciated.
0 Kudos
Level 5

HI jonathanqis,

To list out the guys who are using your dll use following command: tasklist /m your_dll_name .

for example :

C:\>tasklist /m USER32.DLL

Image Name PID Modules
========================= ======== ==========
csrss.exe 616 USER32.dll
wininit.exe 704 USER32.dll
csrss.exe 712 USER32.dll
winlogon.exe 768 USER32.dll
services.exe 792 USER32.dll
lsass.exe 816 USER32.dll
lsm.exe 824 USER32.dll
svchost.exe 924 USER32.dll
ibmpmsvc.exe 984 USER32.dll
nvvsvc.exe 280 USER32.dll

write a custom action and display the list of processes, so that user can decide to kill them . hope this will help you.

0 Kudos
Level 6

No not helpful at all.

If you read the item you'd see I'm after the name of the file that is locked. NOT the process or file that is using it.

I'm interested in the file in my install that is being prevented from being uninstalled (and hence the task is flagged to require stopping).
0 Kudos
Level 6

For the record. For any one interested.

I managed to get around this issue by marking the components containing these files to be 'permanent'. Thus they are not checked for being locked on uninstalling the product.
Then manually adding them to the RemoveFile table, so the install does remove them.
The aforementioned SQL scripts run as before and all seems to be fine.

Not the best solution I feel but workable.
0 Kudos