NsProcess plugin: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (→Links) |
Instructor (talk | contribs) No edit summary |
||
| Line 3: | Line 3: | ||
== Links == | == Links == | ||
Download v1. | Download v1.7: | ||
*<attach>nsProcess.zip</attach> | *<attach>nsProcess.zip</attach> | ||
Discussion:<br> | Discussion:<br> | ||
| Line 16: | Line 12: | ||
'''Features:''' | '''Features:''' | ||
*Find a process by name | *Find a process by name | ||
*Kill all processes with specified name | *Kill all processes with specified name | ||
*Close all processes with specified name (first tries to close | *Close all processes with specified name (first tries to close window and terminates if still alive) | ||
*The process name is case-insensitive | *The process name is case-insensitive | ||
*Win95/98/ME/NT/2000/XP/ | *Win95/98/ME/NT/2000/XP/7/10 support | ||
*Support Ansi/Unicode/x64 installers | |||
*Finds processes of other user(s) when running 'as Administrator' or when having switched to another user | *Finds processes of other user(s) when running 'as Administrator' or when having switched to another user | ||
== Example Usage == | == Example Usage == | ||
| Line 66: | Line 61: | ||
Ravi Kochhar (source function FIND_PROC_BY_NAME based upon his [http://www.physiology.wisc.edu/ravi/Software/ code])<br> | Ravi Kochhar (source function FIND_PROC_BY_NAME based upon his [http://www.physiology.wisc.edu/ravi/Software/ code])<br> | ||
iceman_k ([[Find Process By Name]]) and DITMan ([[KillProcDLL Manual]]) for direct me | iceman_k ([[Find Process By Name]]) and DITMan ([[KillProcDLL Manual]]) for direct me | ||
Thanks brainsucker for CloseProcess code | |||
[[Category:Plugins]] | [[Category:Plugins]] | ||
Revision as of 20:35, 29 October 2026
| Author: Instructor (talk, contrib) |
Links
Download v1.7:
nsProcess.zip (70 KB)
Discussion:
Forum thread
Description
Features:
- Find a process by name
- Kill all processes with specified name
- Close all processes with specified name (first tries to close window and terminates if still alive)
- The process name is case-insensitive
- Win95/98/ME/NT/2000/XP/7/10 support
- Support Ansi/Unicode/x64 installers
- Finds processes of other user(s) when running 'as Administrator' or when having switched to another user
Example Usage
!include "LogicLib.nsh" Section "" StrCpy $1 "YOURAPP.exe" nsProcess::_FindProcess "$1" Pop $R0 ${If} $R0 = 0 nsProcess::_KillProcess "$1" Pop $R0 Sleep 500 ${EndIf} SectionEnd
Commonly _FindProcess returns:
- 0 if found
- 603 if no process matched
// Return codes are as follows: // 0 = Success // 601 = No permission to terminate process // 602 = Not all processes terminated successfully // 603 = Process was not currently running // 604 = Unable to identify system type // 605 = Unsupported OS // 606 = Unable to load NTDLL.DLL // 607 = Unable to get procedure address from NTDLL.DLL // 608 = NtQuerySystemInformation failed // 609 = Unable to load KERNEL32.DLL // 610 = Unable to get procedure address from KERNEL32.DLL // 611 = CreateToolhelp32Snapshot failed
Thanks
Ravi Kochhar (source function FIND_PROC_BY_NAME based upon his code)
iceman_k (Find Process By Name) and DITMan (KillProcDLL Manual) for direct me
Thanks brainsucker for CloseProcess code