KillProc plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (added category)
m (Removed and fixed broken links)
 
(8 intermediate revisions by 6 users not shown)
Line 2: Line 2:


This plugin is intended for searching and killing processes.
This plugin is intended for searching and killing processes.
Usefull if you want to kill all running instances of a certain application.
Useful if you want to kill all running instances of a certain application.




Line 38: Line 38:
     KillProc::KillProcesses
     KillProc::KillProcesses
     StrCmp $1 "-1" wooops
     StrCmp $1 "-1" wooops
     DetailPrint "-> Killed $0 processes, faild to kill $1 processes"
     DetailPrint "-> Killed $0 processes, failed to kill $1 processes"
    
    
     Goto completed
     Goto completed
Line 53: Line 53:
=== Download ===
=== Download ===


* Current Release: 2006-12-16
* Current Release: 2011-04-09
* Download: [http://mulder.dummwiedeutsch.de/pub/downloads/testing/NSIS-KillProc-Plugin.2006-12-16.zip NSIS-KillProc-Plugin.2006-12-16.zip]
* Download: [http://sourceforge.net/projects/muldersoft/files/KillProc-Plugin%20%28NSIS%29/NSIS-KillProc-Plugin.2011-04-09.zip/download NSIS-KillProc-Plugin.2011-04-09.zip]


----------------
From Nicholas Wang (njwdm@163.com)
* Current Release for unicode edition: 2009-11-13
* Download: [https://sourceforge.net/projects/findkillprocuni/files/ For-NSIS-Unicode]


=== Credits ===
=== Credits ===


* Written by MuldeR
* Written by MuldeR
* Homepage: [http://mulder.at.gg/ www.mulder.at.gg]
* Homepage: [http://muldersoft.com/ muldersoft.com]


[[Category:Plugins]]
[[Category:Plugins]]

Latest revision as of 06:25, 15 June 2017

KillProc Plugin for NSIS (2006-12-16)

This plugin is intended for searching and killing processes. Useful if you want to kill all running instances of a certain application.


Functions

  • KillProc::FindProcesses - Enumerate all running instances of the specified process
  • KillProc::KillProcesses - Kills all running instances of the specified process


Parameters

  • $0: Specifies the name of the process to be killed (e.g. "foo.exe")


Return Values

  • $0: The number of processes found/killed
  • $1: The number of processes that could not be killed (-1 indicates serious problems)


Example

 Section
   StrCpy $0 "foo.exe"
   DetailPrint "Searching for processes called '$0'"
   KillProc::FindProcesses
   StrCmp $1 "-1" wooops
   DetailPrint "-> Found $0 processes"
 
   StrCmp $0 "0" completed
   Sleep 1500
 
   StrCpy $0 "foo.exe"
   DetailPrint "Killing all processes called '$0'"
   KillProc::KillProcesses
   StrCmp $1 "-1" wooops
   DetailPrint "-> Killed $0 processes, failed to kill $1 processes"
 
   Goto completed
 
   wooops:
   DetailPrint "-> Error: Something went wrong :-("
   Abort

   completed:
   DetailPrint "Everything went okay :-D"
 SectionEnd


Download


From Nicholas Wang (njwdm@163.com)

Credits