This commit is contained in:
josc146
2023-05-18 19:25:13 +08:00
parent 00257f2e68
commit 75075d6483
11 changed files with 154 additions and 9 deletions

View File

@@ -3,8 +3,11 @@ package backend_golang
import (
"context"
"net/http"
"os"
"os/exec"
"github.com/minio/selfupdate"
"github.com/wailsapp/wails/v2/pkg/runtime"
)
// App struct
@@ -36,5 +39,11 @@ func (a *App) UpdateApp(url string) (broken bool, err error) {
}
return false, err
}
name, err := os.Executable()
if err != nil {
return false, err
}
exec.Command(name, os.Args[1:]...).Start()
runtime.Quit(a.ctx)
return false, nil
}