updated spm package
This commit is contained in:
parent
3f67a0a6de
commit
7373e47c1d
11 changed files with 594 additions and 475 deletions
16
main.go
16
main.go
|
@ -26,7 +26,7 @@ var (
|
|||
isBackgroundMode bool
|
||||
)
|
||||
|
||||
// StateFile holds the update state from INI
|
||||
// StateFile holds the update state from our INI
|
||||
type StateFile struct {
|
||||
IsUpdating bool
|
||||
Progress int32
|
||||
|
@ -199,8 +199,8 @@ func runBackgroundUpdater() {
|
|||
// Write the state to the update_state.ini file
|
||||
WriteState(isUpdating, int32(progress), task)
|
||||
|
||||
// Sleep for 1 second before updating the progress again
|
||||
time.Sleep(1 * time.Second)
|
||||
// Sleep for 1 hour before updating the progress again
|
||||
time.Sleep(1 * time.Hour)
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -249,15 +249,9 @@ func main() {
|
|||
isBackgroundMode = true
|
||||
runBackgroundUpdater()
|
||||
return
|
||||
}
|
||||
|
||||
log.Println("Launcher started (foreground mode).")
|
||||
sf := ReadState()
|
||||
if sf.IsUpdating == true {
|
||||
log.Println("Stage=Installing => show update window.")
|
||||
ShowUpdateWindow()
|
||||
} else {
|
||||
LaunchBrowser()
|
||||
log.Println("Launcher started (foreground mode).")
|
||||
ShowUpdateWindow()
|
||||
}
|
||||
fmt.Println("Exiting launcher.")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue