mirror of
https://github.com/reactos/ahk_tests.git
synced 2024-11-27 05:20:25 +00:00
[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:
parent
dc485d2f91
commit
6cb5c56a13
@ -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%
|
||||
|
Loading…
Reference in New Issue
Block a user