Skip to content
⌘ NSIS Forum Archive

Check for loaded DLL or running EXE?

8 posts

fredtheman#

Check for loaded DLL or running EXE?

Hi,

One of the installers I built installs/updates DLL's and EXE's, so I need to first check whether any of the files I might update is currently running.

Does anyone have some NSIS code to check for this?

Thank you
Fred.
iceman_k#
See the attached zip file for the FindProc plugin.
Usage is described in FindProc.txt

I haven't tried it with DLLs, but that might work as well. If not, modify the source code so that it does.
iceman_k#
Oops, the plugin.
iceman_k#
Slightly modified version of the plugin. Fixed returned values to align with the original author's source code.
Functionally identical to the previous version, only the return values are different.
fredtheman#
Thx to both of you. I'll give this plug-in a try. In the mean time, this code seems to work too:


SetOverwrite try
SetOutPath $SYSDIR
ClearErrors
File "mswinsck.ocx"
IfErrors 0 end
MessageBox MB_OK "Error"
end:
Fred.
iceman_k#
This would work only if you actually needed to overwrite the file.
In my case, there were modules I needed to install which could not be done if the main application was running. Using my plugin, I could detect if the main app was running and prompt the user to close it before proceeding. I did not want to overwrite the main app - just check if it was running.