CharlesB2
7th March 2007 13:43 UTC
Find wether a DLL is in use
Hello,
I would like to find out if a specific DLL is in use by a running process, in order to prompt the user to close it.
Is there a plugin or a macro in NSIS that does it?
I looked in the wiki but no success...
Thanks a lot
Charles
goldy1064
7th March 2007 17:20 UTC
A quick way to do this would just be to backup the file, try to delete it, restore it. If delete fails, the file is in use.
onad
8th March 2007 13:15 UTC
You want to:
1) close the process using the DLL?
Then one could use an NSIS plugin. e.g.
KillProcDLL::KillProc "myapp.exe"
2) or do you want to close the in use in memory DLL?
This is not advised, but somehow doalble, don't know from top of my head, but google is your friend.
CharlesB2
8th March 2007 14:52 UTC
Originally posted by onad
You want to:
1) close the process using the DLL?
Then one could use an NSIS plugin. e.g.
KillProcDLL::KillProc "myapp.exe"
2) or do you want to close the in use in memory DLL?
This is not advised, but somehow doalble, don't know from top of my head, but google is your friend.
I hate these things!! What I want to do is to prompt the user to close the application, and retry. So I have to check if the DLL is loaded, and find which process has loaded it.
If I have time I would write a plugin, using the function EnumProcessModules of the Win32 API, it does the job...
Charles