Fix IsAnotherProcessRunning (#4858)

Compare the exact process name rather than searching for a substring of the full path
This commit is contained in:
Zoltan Papp
2025-12-01 14:16:03 +01:00
committed by GitHub
parent cb83b7c0d3
commit e47d815dd2

View File

@@ -28,7 +28,8 @@ func IsAnotherProcessRunning() (int32, bool, error) {
continue
}
if strings.Contains(strings.ToLower(runningProcessPath), processName) && isProcessOwnedByCurrentUser(p) {
runningProcessName := strings.ToLower(filepath.Base(runningProcessPath))
if runningProcessName == processName && isProcessOwnedByCurrentUser(p) {
return p.Pid, true, nil
}
}