- NSIS Discussion
- Determining if a process is running
Archive: Determining if a process is running
zwuba
22nd August 2003 11:43 UTC
Determining if a process is running
Hi there again!
I just tried to find out if some process are running but the only way I find was FindWindow.
That's pretty nice for 90% of the processes I've to check but at least 6 processes doesn't have any hidden window so I need a possibility to determine if a process is running ... maybe via its exe-name ... that would be great :rolleyes:
Does anyone of you got any idea how to do that?
PS: I do not want to kill the processes I just only need to know if they are running
ramon18
25th August 2003 17:24 UTC
The only way is creating a new plugin for this task, I can do that later when I got free time
cyas
zwuba
26th August 2003 06:14 UTC
I wrote a small C++ (and another C# too) app which takes the process name as command line parameter and do the check for me.
Now it works - thx
Sunjammer
26th August 2003 10:26 UTC
Would you care to share your app with others? I can host it on the Archive downloads page if you'd like.
zwuba
26th August 2003 12:34 UTC
Of course ... I'll attach the source to this post :rolleyes:
Maybe I get enough time to convert it to a NSIS plugin ... :weird:
The Archive contains another two archives with the c++ and the c# source.
Tell me if you got any other questions :D
stonkers
24th September 2003 17:00 UTC
Has this been converted to a plugin? I have a need to check processes and pause if they're running. Thanks - Eric
Afrow UK
24th September 2003 19:57 UTC
That exe can be ran with Exec/nsExec to use it (I assume)
It is possible to write exe's that act like plugins, but it is harder to get the return value (unless you use nsExec::ExecToStack).
-Stu
stonkers
24th September 2003 22:49 UTC
If run this way, wouldn't the exe file have to live on the machine you deploy on? I'm trying to avoid having more pre-requisites on our servers...
zwuba
25th September 2003 06:35 UTC
hi there!
yea you are right - I run this exe with nsExec and put the exe to my installer package - works fine
kichik
26th September 2003 12:27 UTC
stonkers, just copy it to $PLUGINSDIR using the File command. That's what NSIS does when you use a plug-in. The plug-in don't exist on the user's machine until the installer copies them to $PLUGINSDIR.
ursus76
30th January 2004 19:36 UTC
just copy it to $PLUGINSDIR using the File command. That's what NSIS does when you use a plug-in. The plug-in don't exist on the user's machine until the installer copies them to $PLUGINSDIR.
Sorry, don't really understand! I copy the file to pluginsdir (SetOutPath "$PLUGINSDIR"; File "CheckProcess.exe")
And this command only works on installer but not uninstaller
(nsExec::ExecToStack "CheckProcess application" $PLUGINSDIR)
Anything missed?
Thank you!
Joost Verburg
30th January 2004 19:41 UTC
Add InitPluginsDir before using the plus-ins folder.
kichik
30th January 2004 19:41 UTC
Yes, the plug-ins directory is not the same for the installer and the uninstaller. If you want to use it in the uninstaller, you'd have to copy it to the uninstaller plug-in's directory. Simply copy it somewhere in the uninstaller's code, un.onInit for example (don't forget to call InitPluginsDir before you use $PLUGINSDIR).