From 031572edc919b0d874bdbdcd05138ffde8703521 Mon Sep 17 00:00:00 2001 From: Thierry Dalon Date: Mon, 4 Dec 2023 08:53:37 +0100 Subject: [PATCH] Update Teams.ahk --- Lib/Teams.ahk | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Lib/Teams.ahk b/Lib/Teams.ahk index 05fa6c9..d64e0bc 100644 --- a/Lib/Teams.ahk +++ b/Lib/Teams.ahk @@ -773,29 +773,37 @@ Teams_IsNew(){ ; @fun_teams_isnew@ If !(IsNew = "") return IsNew fExe = C:\Users\%A_UserName%\AppData\Local\Microsoft\WindowsApps\ms-teams.exe - If !(FileExist(fExe)) ; New Teams not installed - return IsNew := False + If !(FileExist(fExe)) { ; New Teams not installed + IsNew := False + return IsNew + } ; Check if a Teams process is running Process, Exist, Teams.exe If (!ErrorLevel= 0) { ;Classic Teams - return IsNew:=False + IsNew := False + return IsNew } Process, Exist, ms-teams.exe If (!ErrorLevel= 0) { ;Classic Teams - return IsNew:=True + IsNew:=True + return IsNew } ; Possibility to overwrite in ini file if Teams is not started If FileExist("PowerTools.ini") { IniRead, IniIsNew, PowerTools.ini,Teams,TeamsIsNew - If !(IniIsNew="ERROR") - return IsNew := IniIsNew - } - return IsNew:=True + If !(IniIsNew="ERROR") { + IsNew := IniIsNew + return IsNew + } + + } + IsNew:=True + return IsNew } ;eofun ; ---------------------------------------------------------------------- @@ -815,12 +823,11 @@ Teams_RunExe(){ If Teams_IsNew() { ; New Teams in WindowsApp C:\Users\%A_UserName%\AppData\Local\Microsoft\WindowsApps fExe := "ms-teams.exe" - ;MsgBox % fExe - Run %fExe% + Run, %fExe% } Else { ; Classic Team Client ;fExe = C:\Users\%A_UserName%\AppData\Local\Microsoft\Teams\current\Teams.exe ;fExe = C:\Users\%A_UserName%\AppData\Local\Microsoft\Teams\Update.exe --processStart "Teams.exe" - Run "C:\Users\%A_UserName%\AppData\Local\Microsoft\Teams\Update.exe" --processStart "Teams.exe" + Run, "C:\Users\%A_UserName%\AppData\Local\Microsoft\Teams\Update.exe" --processStart "Teams.exe" } } ;eofun