[AHK_Helper_Functions]

Terminate '*msiexec*' processes in TerminateTmpProcesses() and add FIXME in WindowCleanup() to remove some stuff when CORE-6939 is fixed.

svn path=/trunk/ahk_tests/; revision=1967
This commit is contained in:
Edijs Kolesnikovičs 2013-02-10 14:37:13 +00:00
parent a3c1e58f82
commit 1b6792c516

View File

@ -430,6 +430,8 @@ WindowCleanup(ProcessName)
OutputDebug, Helper Functions: Succesfully terminated '%name_no_ext%.tmp' process.`n
}
; FIXME: remove 'Setup.exe', 'Install.exe' and 'msiexec.exe' termination when CORE-6939 is fixed,
; because TerminateTmpProcesses() will do such things for us
Process, Exist, Setup.exe
if ErrorLevel != 0
{
@ -439,6 +441,19 @@ WindowCleanup(ProcessName)
OutputDebug, Helper Functions: Unable to terminate 'Setup.exe' process.`n
}
Process, Exist, install.exe
if ErrorLevel != 0
{
Process, close, install.exe
Process, WaitClose, install.exe, 5
if ErrorLevel
{
Process, WaitClose, install.exe, 5
if ErrorLevel
OutputDebug, Helper Functions: Unable to terminate 'install.exe' process.`n
}
}
Process, Exist, msiexec.exe
if ErrorLevel != 0
{
@ -454,20 +469,6 @@ WindowCleanup(ProcessName)
}
}
Process, Exist, install.exe
if ErrorLevel != 0
{
Process, close, install.exe
Process, WaitClose, install.exe, 5
if ErrorLevel
{
Process, WaitClose, install.exe, 5
if ErrorLevel
OutputDebug, Helper Functions: Unable to terminate 'install.exe' process.`n
}
}
WinGetActiveTitle, ErrorWinTitle
if not ErrorLevel
{
@ -559,6 +560,7 @@ TerminateTmpProcesses()
sztmp = .tmp
szSetup = Setup
szInstall = Install
szMsiExec = msiexec
IfInString, n, %sztmp%
{
Process, Exist, %n% ; Will kill all '*.tmp' processes
@ -610,6 +612,23 @@ TerminateTmpProcesses()
OutputDebug, Helper Functions: Successfully terminated '%n%' process.`n
}
}
else IfInString, n, %szMsiExec%
{
Process, Exist, %n% ; Will kill all '*msiexec*' 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
OutputDebug, Helper Functions: Successfully terminated '%n%' process.`n
}
}
}
}
DllCall("FreeLibrary", "UInt", hModule) ; unload the library to free memory