Processes plug-in

From NSIS Wiki

Revision as of 17:09, 4 October 2017 by Mruffat (Talk | contribs) (Added Unicode version (source code))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Author: hardwired (talk, contrib)


Plugin + C++ Source Code:

Zip.gif Processes-Unicode (Modified by Mathieu Ruffat)

  - The code has been ported to compile using Unicode, so it can be used in Unicode installers 
  - Tested on NSIS 3.02.1. Quick and dirty porting but it works.
  - Based on (Processes-x64fix_v2 link is dead)
  - Should also compile/work in ANSI but not tested

Zip.gif Processes-x64fix_v2 (Modified by Stefan Gatu)

  - Fixed killing processes starting with same name
  - Now, the process name can end or not with .exe (45 KB) - fixed for Vista x64 (39 KB)
Zip.gif (39 KB) (Mirror #1)


Nullsoft Installer (NSIS) plug-in for managing?! processes.
© 2004-2005 Hardwired. No rights reserved.
There is no restriction for using this software... guarantee either!
Andrei Ciubotaru [Hardwired]
President of Inocentric SRL ([hxxp:// hxxp://])
[hardwired AT hardwired AT]
Project Manager ICode&Ideas SRL ([hxxp:// hxxp://])
[hardwired AT hardwired AT]


The Need For Plug-in - I needed it for one of my installers.

Briefly: Use it when you need to find/kill a process when installing/uninstalling some application. Also, use it when you need to test the presence of a device driver.


Supported platforms are: WinNT,Win2K,WinXP and Win2003 Server.

DLL Functions

Processes::FindProcess "process_name"

Searches the currently running processes for the given process name.

return on $R0:

1 - the process was found
0 - the process was not found
Processes::KillProcess "process_name"

Searches the currently running processes for the given process name. If the process is found then the it gets killed.

return on $R0:

1 - the process was found and killed
0 - the process was not found or the process cannot be killed (insufficient rights)
Processes::FindDevice "device_base_name"

Searches the installed devices drivers for the given device base name(important: I said BASE NAME not FILENAME).

return on $R0:

1 - the device driver was found
0 - the device driver was not found


First of all, it does not matter where you use it. Of course, the routines must be called inside of a Section/Function scope.

Processes::FindProcess "process_name" ;without ".exe"
StrCmp $R0 "1" make_my_day noooooo
Processes::KillProcess "process_name" ;without ".exe"
StrCmp $R0 "1" dead_meat why_wont_you_die
Processes::FindDevice "device_base_name"
StrCmp $R0 "1" blabla more_blabla


Sunil Kamath for inspiring me. I wanted to use his FindProcDLL plug-in but my requirements made it imposible.

Nullsoft for creating this very powerful installer. One big, free and full-featured (hmmm... and guiless for the moment) mean install machine!:)

One more thing...

If you use the plugin or its source-code, I would be appreciated if my name is mentioned.

Personal tools