sunsheng 1 year ago
parent
commit
2f9ef5b595
2 changed files with 18 additions and 18 deletions
  1. 18 18
      src/main.go
  2. BIN
      src/updater.exe

+ 18 - 18
src/main.go

@@ -159,23 +159,23 @@ func main() {
 		os.Exit(0)
 	}()
 
-	// go func() {
-	// 	if len(GAppOption.Url) < 1 {
-	// 		return
-	// 	}
-
-	// 	upgradeLancherExe(GAppOption.Url, func(i int, s string) {
-	// 		fmt.Println("xxx=>", i, s)
-
-	// 		if i == -1 {
-	// 			installError = s
-	// 			w.Invalidate()
-	// 			return
-	// 		}
-	// 		installSucc = true
-	// 		w.Invalidate()
-	// 	})
-	// }()
+	go func() {
+		if len(GAppOption.Url) < 1 {
+			return
+		}
+
+		upgradeLancherExe(GAppOption.Url, func(i int, s string) {
+			fmt.Println("xxx=>", i, s)
+
+			if i == -1 {
+				installError = s
+				w.Invalidate()
+				return
+			}
+			installSucc = true
+			w.Invalidate()
+		})
+	}()
 
 	app.Main()
 }
@@ -193,7 +193,7 @@ func draw(w *app.Window) error {
 
 			case system.FrameEvent:
 				gtx := layout.NewContext(&ops, e)
-				title := material.Body1(th, "下载中...")
+				title := material.Body1(th, "更新中...")
 				maroon := color.NRGBA{R: 0, G: 0, B: 0, A: 255}
 				title.Color = maroon
 				title.Alignment = text.Middle

BIN
src/updater.exe