fredtheman
2nd June 2004 02:25 UTC
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.
deguix
2nd June 2004 02:41 UTC
FileOpen will do the trick, as it gives error if a file is running (is this right?).
iceman_k
2nd June 2004 18:04 UTC
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
2nd June 2004 18:05 UTC
Oops, the plugin.
iceman_k
3rd June 2004 00:30 UTC
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.
kenooze
3rd June 2004 02:14 UTC
thanks , I will try it !
fredtheman
3rd June 2004 14:39 UTC
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
3rd June 2004 15:41 UTC
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.