Files
AetherForge/agent/deploy/windows.go
drjones 6241dfd556 Make built exe a one-run Windows installer pointing at LAN dashboard.
Install copies miner to AppData, registers autostart, relaunches silently, and builder defaults server URL to local IP.
2026-05-26 22:52:47 -07:00

33 lines
605 B
Go

package deploy
import (
"fmt"
"os"
"os/exec"
"path/filepath"
)
func SetProcessPriority(priority string) error {
class := "BelowNormal"
switch priority {
case "idle":
class = "Idle"
case "below_normal":
class = "BelowNormal"
case "normal":
class = "Normal"
case "above_normal":
class = "AboveNormal"
case "high":
class = "High"
}
pid := os.Getpid()
cmd := exec.Command("powershell", "-NoProfile", "-Command",
fmt.Sprintf("(Get-Process -Id %d).PriorityClass = '%s'", pid, class))
return cmd.Run()
}
func CurrentExecutable() (string, error) {
return filepath.Abs(os.Args[0])
}