|
![]() |
#1 |
Junior Member
Join Date: Apr 2010
Posts: 39
|
![]()
KillProc plug-in is not working in x64 bit machines
I have written following code: StrCpy $0 "Draw.exe" KillProc::FindProcesses ${If} $0 > 0 StrCpy $0 "Draw.exe" KillProc::KillProcesses ${Endif} this code is working fine on 32 bit machine, anyone can please suggest what to do for for killing process in x64 bit machine. |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Is the process a 32-bit process or a 64-bit one? What is $1 set to after calling KillProcesses?
Stu |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Apr 2010
Posts: 39
|
it is 64 bit process
process name is same but it is not able to find that process using KillProc::FindProcesses |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
What is the value of $1 after the KillProcesses call?
Does the plug-in kill 32-bit processes OK? Stu |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Apr 2010
Posts: 39
|
the value of $1 after the KillProcesses call is 0
this plug in kill 32-bit machines processes sucessfully. |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
This is a problem with the EnumProcessModules API and 32-bit processes. It cannot enumerate modules of a 64-bit process when the caller is a 32-bit process, therefore it fails to find your process name. If you must kill your application (i.e. you cannot safely close it with WM_CLOSE for example) then you will need to write a 64-bit executable to do it that you execute with NSIS. Don't bother trying any other plug-ins either because the EnumProcessModules limitation is not plug-in specific.
Stu |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Oct 2010
Location: Paris, France
Posts: 9
|
I confirm the need for a 64 bit process killing ability. Anything planned about that?
|
![]() |
![]() |
![]() |
#8 |
Senior Member
Join Date: Mar 2006
Location: Dallas
Posts: 462
|
Have you tried to use WMI? You should be able to query the processes (by name) and when you have the one you want to kill, call the Terminate method on the WMI process object.
|
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Oct 2010
Location: Paris, France
Posts: 9
|
Yes WMI seems to be the recommended approach to implement it, but I was more expecting a support from NSIS (or a NSIS plugin).
That said, I also found the EnumProcessModulesEx is your friend for listing both 32 and 64 bits processes, but with static linking issues however (not located in the same library since Win7). |
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
As I've already said, EnumProcessModulesEx is no good when the calling process is 32-bit. It will return the same results as EnumProcessModules (MSDN states this too). The only way is to use WMI (or write a 64-bit app to do it).
Stu |
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Jul 2011
Posts: 1
|
I had the same problem and updated the code to use WMI as was suggested.
http://chironexsoftware.com/blog/?p=34 |
![]() |
![]() |
![]() |
#12 | |
Major Dude
Join Date: May 2003
Posts: 681
|
the documentation of this plugin is really poor
Quote:
tried it with "killproc", "killprocwmi" with same filename... http://nsis.sourceforge.net/KillProc_plug-in anyone with a working example? (and file places to put in except \plugins) |
|
![]() |
![]() |
![]() |
#13 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
|
![]() |
![]() |
![]() |
#14 | |
Junior Member
Join Date: Feb 2018
Posts: 1
|
Quote:
I googled it, but I'm not lucky. |
|
![]() |
![]() |
![]() |
#15 |
Major Dude
Join Date: May 2003
Posts: 681
|
ofc - thats why i wonder it does not work.
the major problem is that i can not compile the file! |
![]() |
![]() |
![]() |
#16 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
What do you mean it does not work? What do you mean you cannot compile the file? Please elaborate.
Stu |
![]() |
![]() |
![]() |
#17 |
Major Dude
Join Date: May 2003
Posts: 681
|
compiling
KillProc::FindProcesses not compiling KillProcWMI::FindProcesses > Invalid command: KillProcWMI::FindProcesses if i rename KillProcWMI.dll to KillProc.dll and use the regular Killproc syntax > Invalid command: KillProc::FindProcesses bleh so what is the correct syntax? both dll are in \plugins |
![]() |
![]() |
![]() |
#18 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
There is only one function KillProcWMI::KillProc (if in doubt look at the source code, or look at the output from makensis which lists all plug-in functions).
Stu |
![]() |
![]() |
![]() |
#19 |
Major Dude
Join Date: May 2003
Posts: 681
|
omg how stupid ist that?
ofc i can force terminating a thread but more polite is the option for user to end it manually so i try to find the process at first but there is no plugin for x64 which can do that. |
![]() |
![]() |
![]() |
#20 |
Major Dude
Join Date: May 2003
Posts: 681
|
sorry, wont work here
StrCpy $0 "filename.exe" KillProcWMI::KillProc any new hints for 64bit? |
![]() |
![]() |
![]() |
#21 |
Junior Member
Join Date: Feb 2012
Posts: 3
|
I was successful using:
KillProcWMI::KillProc "ProcessName.exe" In that way I guess it works more like the older KillProc Plug-in rather than the new one. However, I was able to terminate a 64-bit process on Windows Server 2008 R2 using it. |
![]() |
![]() |
![]() |
#22 |
Major Dude
Join Date: May 2003
Posts: 681
|
i will try next days, actually i still need WMIC to determine task and to kill it.
|
![]() |
![]() |
![]() |
#23 |
Senior Member
Join Date: Nov 2012
Posts: 161
|
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|