From c6b8a55201eec1a017505de60d1119be59cbe7d3 Mon Sep 17 00:00:00 2001 From: Jean-Michel Mercier <93936772+jeanmichel-nwsb@users.noreply.github.com> Date: Sat, 17 Dec 2022 23:46:53 +0100 Subject: [PATCH] installer: detect gpg-agent also when the processes name ends with .exe This fixes https://github.com/git-for-windows/git/issues/4172 Signed-off-by: Jean-Michel Mercier Signed-off-by: Johannes Schindelin --- installer/modules.inc.iss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installer/modules.inc.iss b/installer/modules.inc.iss index ed8e2d6e69..7f9072682e 100644 --- a/installer/modules.inc.iss +++ b/installer/modules.inc.iss @@ -510,6 +510,7 @@ var AppList:array of RM_PROCESS_INFO; ReasonList:IdList; Success:DWORD; + ProcessName:String; begin SetArrayLength(Processes,0); Result:=0; @@ -537,7 +538,8 @@ begin Processes[Have].ID:=AppList[i].Process.dwProcessId; Processes[Have].Name:=ArrayToString(AppList[i].strAppName); Processes[Have].Restartable:=AppList[i].bRestartable; - if ('ssh-add'=Processes[Have].Name) or ('ssh-agent'=Processes[Have].Name) or ('ssh-pageant'=Processes[Have].Name) or ('gpg-agent'=Processes[Have].Name) or ('scdaemon'=Processes[Have].Name) then + ProcessName:=ChangeFileExt(Processes[Have].Name, ''); + if ('ssh-add'=ProcessName) or ('ssh-agent'=ProcessName) or ('ssh-pageant'=ProcessName) or ('gpg-agent'=ProcessName) or ('scdaemon'=ProcessName) then Processes[Have].ToTerminate:=True; end; Result:=Handle;