This repository has been archived by the owner on Mar 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.go
71 lines (60 loc) · 1.58 KB
/
install.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package main
import "log"
import "time"
// "sync"
// Install :
func Install() {
Install1()
}
// Install1 : Install ubuntu LxRootfs
func Install1() {
progCurr.SetValue(0)
progTotal.SetValue(20)
log.Printf("Installing Basic Lx RootFS\n")
go InstallLx()
}
// Install2 : Download AOSC Tarball
func Install2() {
if DetectInstalledRootfs() == false {
WarnMsg("Oops", "ERROR: Install MS Basic RootFS Failed! Exiting ...")
log.Fatalf("Exit due to Basic RootFS Installation Error")
} else {
log.Printf("Basic Lx RootFS Successfully Installed")
progCurr.SetValue(100)
progTotal.SetValue(30)
}
log.Printf("Downloading AOSC OS Base Tarball ...")
//var wg sync.WaitGroup
//wg.Add(1)
go Download()
/*
log.Printf("Waiting for Download ...")
<-dldone
log.Printf("Downloading Finished ...")
*/
}
// Install3 : Extract tarball to /root
func Install3() {
log.Printf("This should start install3() ...")
//time.Sleep(5 * time.Second)
go ExtractBaseTarball()
/**/
}
// Install4 : Finish Installation
func Install4() {
DownloadIconLnk()
UpdateInstallProgress(100)
time.Sleep(200 * time.Millisecond)
InfoMsg("AOSC OS successfully installed!", "Your AOSC OS 4.0 on WSL is ready to roll.\n"+
"Now open cmd and type bash to have a try.")
}
// UpdateDownloadProgress : Update two progress bar for Download
func UpdateDownloadProgress(progress int) {
progCurr.SetValue(progress)
progTotal.SetValue(20 + progress*5/10)
}
// UpdateInstallProgress : Update two progress bar for Install
func UpdateInstallProgress(progress int) {
progCurr.SetValue(progress)
progTotal.SetValue(70 + progress*3/10)
}