diff --git a/agent/agent.go b/agent/agent.go index f299863..5fb4dd8 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -384,6 +384,7 @@ func (a *Agent) CleanupAgentUpdates() { return } + // winagent-v* is deprecated files, err := filepath.Glob("winagent-v*.exe") if err == nil { for _, f := range files { @@ -391,6 +392,13 @@ func (a *Agent) CleanupAgentUpdates() { } } + agents, err := filepath.Glob("tacticalagent-v*.exe") + if err == nil { + for _, f := range agents { + os.Remove(f) + } + } + cderr = os.Chdir(os.Getenv("TMP")) if cderr != nil { a.Logger.Errorln(cderr) diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 0912cd2..541184b 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -635,7 +635,7 @@ func (a *Agent) AgentUninstall(code string) { func (a *Agent) addDefenderExlusions() { code := ` Add-MpPreference -ExclusionPath 'C:\Program Files\TacticalAgent\*' -Add-MpPreference -ExclusionPath 'C:\Windows\Temp\winagent-v*.exe' +Add-MpPreference -ExclusionPath 'C:\Windows\Temp\tacticalagent-v*.exe' Add-MpPreference -ExclusionPath 'C:\Windows\Temp\trmm\*' Add-MpPreference -ExclusionPath 'C:\Program Files\Mesh Agent\*' ` diff --git a/agent/process.go b/agent/process.go index bd3e4ee..ae7c392 100644 --- a/agent/process.go +++ b/agent/process.go @@ -64,9 +64,16 @@ func (a *Agent) KillHungUpdates() { if err != nil { continue } + + // winagent-v* is deprecated if strings.Contains(p.Exe, "winagent-v") { a.Logger.Debugln("killing process", p.Exe) KillProc(int32(p.PID)) } + + if strings.Contains(p.Exe, "tacticalagent-v") { + a.Logger.Debugln("killing process", p.Exe) + KillProc(int32(p.PID)) + } } } diff --git a/main.go b/main.go index 5b3b35c..7bbface 100644 --- a/main.go +++ b/main.go @@ -197,6 +197,6 @@ func installUsage() { } func updateUsage() { - u := `Usage: tacticalrmm.exe -m update -updateurl https://example.com/winagent-vX.X.X.exe -inno winagent-vX.X.X.exe -updatever 1.1.1` + u := `Usage: tacticalrmm.exe -m update -updateurl https://example.com/tacticalagent-vX.X.X.exe -inno tacticalagent-vX.X.X.exe -updatever 1.1.1` fmt.Println(u) }