update for new exe format
This commit is contained in:
parent
1ac1ca57e2
commit
aed33b9a95
@ -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)
|
||||
|
@ -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\*'
|
||||
`
|
||||
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
main.go
2
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user