update for new exe format

This commit is contained in:
wh1te909 2022-06-26 09:02:48 -07:00
parent 1ac1ca57e2
commit aed33b9a95
4 changed files with 17 additions and 2 deletions

View File

@ -384,6 +384,7 @@ func (a *Agent) CleanupAgentUpdates() {
return return
} }
// winagent-v* is deprecated
files, err := filepath.Glob("winagent-v*.exe") files, err := filepath.Glob("winagent-v*.exe")
if err == nil { if err == nil {
for _, f := range files { 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")) cderr = os.Chdir(os.Getenv("TMP"))
if cderr != nil { if cderr != nil {
a.Logger.Errorln(cderr) a.Logger.Errorln(cderr)

View File

@ -635,7 +635,7 @@ func (a *Agent) AgentUninstall(code string) {
func (a *Agent) addDefenderExlusions() { func (a *Agent) addDefenderExlusions() {
code := ` code := `
Add-MpPreference -ExclusionPath 'C:\Program Files\TacticalAgent\*' 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:\Windows\Temp\trmm\*'
Add-MpPreference -ExclusionPath 'C:\Program Files\Mesh Agent\*' Add-MpPreference -ExclusionPath 'C:\Program Files\Mesh Agent\*'
` `

View File

@ -64,9 +64,16 @@ func (a *Agent) KillHungUpdates() {
if err != nil { if err != nil {
continue continue
} }
// winagent-v* is deprecated
if strings.Contains(p.Exe, "winagent-v") { if strings.Contains(p.Exe, "winagent-v") {
a.Logger.Debugln("killing process", p.Exe) a.Logger.Debugln("killing process", p.Exe)
KillProc(int32(p.PID)) KillProc(int32(p.PID))
} }
if strings.Contains(p.Exe, "tacticalagent-v") {
a.Logger.Debugln("killing process", p.Exe)
KillProc(int32(p.PID))
}
} }
} }

View File

@ -197,6 +197,6 @@ func installUsage() {
} }
func updateUsage() { 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) fmt.Println(u)
} }