Compare commits
9 Commits
3bc537df95
...
d09892595c
| Author | SHA1 | Date | |
|---|---|---|---|
| d09892595c | |||
| 8d14133793 | |||
| 5cf9764c4d | |||
| fbbb8614c0 | |||
| 336eba8999 | |||
| dd8d9b0ce2 | |||
| c326e228a1 | |||
| bf2f01d2f3 | |||
| 8e836e6fda |
@ -200,21 +200,20 @@ func (inst *Installer) StartInstall(config InstallConfig) error {
|
||||
|
||||
func (inst *Installer) runInstall(config InstallConfig) {
|
||||
steps := []struct {
|
||||
name string
|
||||
percent float64
|
||||
critical bool // if true, abort installation on failure
|
||||
fn func(config InstallConfig) error
|
||||
name string
|
||||
percent float64
|
||||
fn func(config InstallConfig) error
|
||||
}{
|
||||
{"Creating installation directory", 5, true, inst.stepCreateDir},
|
||||
{"Extracting server binary", 10, true, inst.stepExtractBinary},
|
||||
{"Extracting models and firmware", 30, true, inst.stepExtractData},
|
||||
{"Extracting scripts", 48, true, inst.stepExtractScripts},
|
||||
{"Configuring system", 55, false, inst.stepConfigureSystem},
|
||||
{"Setting up USB driver", 62, false, inst.stepSetupLibusb},
|
||||
{"Setting up Python environment", 72, false, inst.stepSetupPython},
|
||||
{"Writing configuration", 85, true, inst.stepWriteConfig},
|
||||
{"Verifying installation", 90, false, inst.stepVerify},
|
||||
{"Setting up auto-start launcher", 95, false, inst.stepAutoRestart},
|
||||
{"Creating installation directory", 5, inst.stepCreateDir},
|
||||
{"Extracting server binary", 10, inst.stepExtractBinary},
|
||||
{"Extracting models and firmware", 30, inst.stepExtractData},
|
||||
{"Extracting scripts", 48, inst.stepExtractScripts},
|
||||
{"Configuring system", 55, inst.stepConfigureSystem},
|
||||
{"Setting up USB driver", 62, inst.stepSetupLibusb},
|
||||
{"Setting up Python environment", 72, inst.stepSetupPython},
|
||||
{"Writing configuration", 85, inst.stepWriteConfig},
|
||||
{"Verifying installation", 90, inst.stepVerify},
|
||||
{"Setting up auto-start launcher", 95, inst.stepAutoRestart},
|
||||
}
|
||||
|
||||
for _, step := range steps {
|
||||
@ -225,21 +224,13 @@ func (inst *Installer) runInstall(config InstallConfig) {
|
||||
})
|
||||
|
||||
if err := step.fn(config); err != nil {
|
||||
if step.critical {
|
||||
inst.emitProgress(ProgressEvent{
|
||||
Step: step.name,
|
||||
Message: fmt.Sprintf("Error: %s — %s", step.name, err),
|
||||
Percent: step.percent,
|
||||
IsError: true,
|
||||
})
|
||||
return // abort installation
|
||||
}
|
||||
inst.emitProgress(ProgressEvent{
|
||||
Step: step.name,
|
||||
Message: fmt.Sprintf("Warning: %s — %s (skipped)", step.name, err),
|
||||
Message: fmt.Sprintf("Warning: %s — %s", step.name, err),
|
||||
Percent: step.percent,
|
||||
IsError: true,
|
||||
})
|
||||
// Non-critical steps continue; critical ones are handled inside
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user