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