Old 2nd June 2004, 02:25   #1
fredtheman
Junior Member
 
Join Date: Apr 2004
Posts: 34
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.
fredtheman is offline   Reply With Quote
Old 2nd June 2004, 02:41   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
FileOpen will do the trick, as it gives error if a file is running (is this right?).

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 2nd June 2004, 18:04   #3
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
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.

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 2nd June 2004, 18:05   #4
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
Oops, the plugin.
Attached Files
File Type: zip findproc.zip (24.8 KB, 1682 views)

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 3rd June 2004, 00:30   #5
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
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.
Attached Files
File Type: zip findproc.zip (24.7 KB, 1315 views)

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 3rd June 2004, 02:14   #6
kenooze
Junior Member
 
Join Date: May 2004
Posts: 3
thanks , I will try it !
kenooze is offline   Reply With Quote
Old 3rd June 2004, 14:39   #7
fredtheman
Junior Member
 
Join Date: Apr 2004
Posts: 34
Thx to both of you. I'll give this plug-in a try. In the mean time, this code seems to work too:

code:

SetOverwrite try
SetOutPath $SYSDIR
ClearErrors
File "mswinsck.ocx"
IfErrors 0 end
MessageBox MB_OK "Error"
end:



Fred.
fredtheman is offline   Reply With Quote
Old 3rd June 2004, 15:41   #8
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
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.

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump