[AHK_Helper_Functions]

Terminate all '*Setup*' and '*Install*' processes in TerminateTmpProcesses(). Helps to close Foxit Reader 2.1.2023 setup.

svn path=/trunk/ahk_tests/; revision=1965
This commit is contained in:
Edijs Kolesnikovičs 2013-02-10 14:02:28 +00:00
parent dc485d2f91
commit 6cb5c56a13

View File

@ -489,7 +489,7 @@ WindowCleanup(ProcessName)
}
; Terminates all *.tmp processes
; Terminates all '*.tmp', '*Setup*' and '*Install*' processes
TerminateTmpProcesses()
{
; http://www.autohotkey.com/docs/commands/Process.htm
@ -553,9 +553,41 @@ TerminateTmpProcesses()
{
; Check if we have '.tmp' in process name
sztmp = .tmp
szSetup = Setup
szInstall = Install
IfInString, n, %sztmp%
{
Process, Exist, %n% ; Will kill some setups
Process, Exist, %n% ; Will kill all '*.tmp' processes
if ErrorLevel != 0
{
Process, close, %n%
Process, WaitClose, %n%, 5
if ErrorLevel
{
bError := true
iUnterminated++
OutputDebug, Helper Functions: Unable to terminate '%n%' process.`n
}
}
}
else IfInString, n, %szSetup%
{
Process, Exist, %n% ; Will kill all '*Setup*' processes
if ErrorLevel != 0
{
Process, close, %n%
Process, WaitClose, %n%, 5
if ErrorLevel
{
bError := true
iUnterminated++
OutputDebug, Helper Functions: Unable to terminate '%n%' process.`n
}
}
}
else IfInString, n, %szInstall%
{
Process, Exist, %n% ; Will kill all '*Install*' processes
if ErrorLevel != 0
{
Process, close, %n%