From 0490f662d73f5399661f3f0aee86bc236394aac9 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Mon, 30 Oct 2023 20:48:10 +0100 Subject: [PATCH 01/21] base for checking latest version --- helpers/updateServiceHelper.go | 38 ++++++++++++++++++++++++++++++++++ main.go | 5 ++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 helpers/updateServiceHelper.go diff --git a/helpers/updateServiceHelper.go b/helpers/updateServiceHelper.go new file mode 100644 index 0000000..4ded399 --- /dev/null +++ b/helpers/updateServiceHelper.go @@ -0,0 +1,38 @@ +package helpers + +import ( + "encoding/json" + "fmt" + "io" + "net/http" +) + +type Release struct { + Url string `json:"url"` + TagName string `json:"tag_name"` + Assets []struct { + Name string `json:"name"` + DownloadUrl string `json:"browser_download_url"` + } `json:"assets"` +} + +var release Release + +func CheckForUpdates() { + res, err := http.Get("https://api.github.com/repos/JensvandeWiel/ArkAscendedServerManager/releases/latest") + if err != nil { + println("Error: Could not fetch update info") + println(err.Error()) + } else { + resBody, err := io.ReadAll(res.Body) + if err != nil { + fmt.Printf("server: could not read request body: %s\n", err) + } + + json.Unmarshal(resBody, &release) + fmt.Printf("Latest release: %s\n", release.TagName) + } +} + +func Update() { +} diff --git a/main.go b/main.go index 188c225..bc1c658 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,8 @@ package main import ( "context" "embed" + "os" + "github.com/JensvandeWiel/ArkAscendedServerManager/config" "github.com/JensvandeWiel/ArkAscendedServerManager/helpers" "github.com/JensvandeWiel/ArkAscendedServerManager/installer" @@ -12,7 +14,6 @@ import ( wailsLogger "github.com/wailsapp/wails/v2/pkg/logger" "github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options/assetserver" - "os" ) //go:embed all:frontend/dist @@ -32,6 +33,8 @@ func main() { l := logger.New(file) + helpers.CheckForUpdates() + // Create an instance of the app structure app := NewApp() c := config.NewConfigController() From 5113a0d138effb16540170773578d0116f85005c Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:04:28 +0100 Subject: [PATCH 02/21] added build/bin to ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9e0df19..a89bf59 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ coverage bower_components .lock-wscript build/Release +build/bin wailsjs/ package.json.md5 node_modules/ From a7c37d875955a291f99574e3029d571f8ddf51cb Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:12:19 +0100 Subject: [PATCH 03/21] added packages --- go.mod | 3 +++ go.sum | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/go.mod b/go.mod index bb30606..10a83e9 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,15 @@ go 1.18 require ( github.com/adrg/xdg v0.4.0 + github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf github.com/jensvandewiel/gosteamcmd v0.1.2 github.com/sethvargo/go-password v0.2.0 + github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf github.com/wailsapp/wails/v2 v2.6.0 ) require ( + github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf // indirect github.com/UserExistsError/conpty v0.1.1 // indirect github.com/bep/debounce v1.2.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect diff --git a/go.sum b/go.sum index 97b00bd..fc7dd48 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf h1:FPsprx82rdrX2jiKyS17BH6IrTmUBYqZa/CXT4uvb+I= +github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf/go.mod h1:peYoMncQljjNS6tZwI9WVyQB3qZS6u79/N3mBOcnd3I= github.com/UserExistsError/conpty v0.1.1 h1:cHDsU/XeoeDAQmVvCTV53SrXLG39YJ4++Pp3iAi1gXE= github.com/UserExistsError/conpty v0.1.1/go.mod h1:PDglKIkX3O/2xVk0MV9a6bCWxRmPVfxqZoTG/5sSd9I= github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= @@ -11,6 +13,8 @@ github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8= +github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg= github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck= github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e/go.mod h1:alcuEEnZsY1WQsagKhZDsoPCRoOijYqhZvPwLG0kzVs= github.com/jensvandewiel/gosteamcmd v0.1.2 h1:NHichoj0v3GvSVN2Fn36dSOLosHAytpaKnLnDHTMQPI= @@ -50,6 +54,8 @@ github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM= github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI= github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE= +github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf h1:pCxn3BCfu8n8VUhYl4zS1BftoZoYY0J4qVF3dqAQ4aU= +github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf/go.mod h1:/qNPSY91qTz/8TgHEMioAUc6q7+3SOybeKczHMXFcXw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= From 853433cd59ba692a3cb6b5a0f684695caf66282d Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:21:54 +0100 Subject: [PATCH 04/21] update pipeline to update wails.json --- .github/workflows/main.yml | 5 +++++ .github/workflows/nightly.yaml | 5 +++++ .github/workflows/pull_request.yml | 2 ++ build/updateConfig.js | 15 +++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 build/updateConfig.js diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0428b79..2d25d2e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,11 @@ jobs: - name: Set direct proxy run: go env -w GOPROXY=direct - run: go install github.com/wailsapp/wails/cmd/wails@latest + - name: Get Tag Name + id: extract_tag_name + run: echo "Tag name is ${GITHUB_REF/refs\/tags\//}" + - name: Update wails.json + run: node build/updateConfig.js ${{ steps.extract_tag_name.outputs.stdout }} false - uses: dAppServer/wails-build-action@v2.2 with: build-name: ${{ matrix.build.name }} diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 55a864d..c4e6f30 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -22,6 +22,11 @@ jobs: - name: Set direct proxy run: go env -w GOPROXY=direct - run: go install github.com/wailsapp/wails/cmd/wails@latest + - name: Get Tag Name + id: extract_tag_name + run: echo "Tag name is ${GITHUB_REF/refs\/tags\//}" + - name: Update wails.json + run: node build/updateConfig.js ${{ github.run_number }} true - uses: dAppServer/wails-build-action@v2.2 with: build-name: ${{ matrix.build.name }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b9f6d9e..a9dc61d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -23,6 +23,8 @@ jobs: - name: Set direct proxy run: go env -w GOPROXY=direct - run: go install github.com/wailsapp/wails/cmd/wails@latest + - name: Update wails.json + run: node build/updateConfig.js 99999999 false - uses: dAppServer/wails-build-action@v2.2 with: build-name: ${{ matrix.build.name }} diff --git a/build/updateConfig.js b/build/updateConfig.js new file mode 100644 index 0000000..9e1ea06 --- /dev/null +++ b/build/updateConfig.js @@ -0,0 +1,15 @@ +const fs = require('fs'); +const fileName = './wails.json'; +const file = require(fileName); + +console.log("changing version to " + process.argv[2] + ", isNightly to " + process.argv[3] + " and environment to prod") + +file.version = process.argv[2]; +file.isNightly = process.argv[3] === 'true'; +file.environment = "prod" + +fs.writeFile(fileName, JSON.stringify(file), function writeJSON(err) { + if (err) return console.log(err); + console.log(JSON.stringify(file)); + console.log('Wrote to ' + fileName + "!"); +}); \ No newline at end of file From e9834aec50d8d562425a5e2cc17de5840304c825 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:23:03 +0100 Subject: [PATCH 05/21] autoupdater logic --- helpers/updateServiceHelper.go | 120 +++++++++++++++++++++++++++++---- main.go | 5 +- wails.json | 2 + 3 files changed, 113 insertions(+), 14 deletions(-) diff --git a/helpers/updateServiceHelper.go b/helpers/updateServiceHelper.go index 4ded399..1ebf3da 100644 --- a/helpers/updateServiceHelper.go +++ b/helpers/updateServiceHelper.go @@ -5,34 +5,128 @@ import ( "fmt" "io" "net/http" + "os" + "slices" + "strings" + + "github.com/inconshreveable/go-update" + "github.com/sqweek/dialog" ) +type Asset struct { + Name string `json:"name"` + DownloadUrl string `json:"browser_download_url"` +} + type Release struct { - Url string `json:"url"` - TagName string `json:"tag_name"` - Assets []struct { - Name string `json:"name"` - DownloadUrl string `json:"browser_download_url"` - } `json:"assets"` + Url string `json:"url"` + TagName string `json:"tag_name"` + Name string `json:"name"` + Assets []Asset `json:"assets"` +} + +type Env struct { + Version string `json:"version"` + Environment string `json:"environment"` + IsNightly bool `json:"isNightly"` + Info struct { + ProductName string `json:"productName"` + } `json:"info"` } +var cf Env var release Release -func CheckForUpdates() { - res, err := http.Get("https://api.github.com/repos/JensvandeWiel/ArkAscendedServerManager/releases/latest") +func CheckForUpdates(WailsConfigFile []byte) { + err := json.Unmarshal(WailsConfigFile, &cf) + if err != nil { + fmt.Printf("Error: Could not parse wails.json: %s\n", err) + println("Skipping update check") + return + } + + if cf.Environment == "dev" { + println("Skipping update check") + return + } + + println("Checking for updates...") + + var res *http.Response + if cf.IsNightly { + res, err = http.Get("https://api.github.com/repos/ItsMePepijn/ArkAscendedServerManager/releases/tags/nightly") + } else { + res, err = http.Get("https://api.github.com/repos/ItsMePepijn/ArkAscendedServerManager/releases/latest") + } + if err != nil { - println("Error: Could not fetch update info") - println(err.Error()) + fmt.Printf("Error: Could not get latest release info: %s\n", err) + println("Skipping update check") + return } else { resBody, err := io.ReadAll(res.Body) if err != nil { fmt.Printf("server: could not read request body: %s\n", err) + println("Skipping update check") + return } - json.Unmarshal(resBody, &release) - fmt.Printf("Latest release: %s\n", release.TagName) + err = json.Unmarshal(resBody, &release) + if err != nil { + fmt.Printf("Error: Could not parse release info: %s\n", err) + println("Skipping update check") + return + } + + if cf.IsNightly { + nameArr := strings.Split(release.Name, " ") + release.TagName = nameArr[len(nameArr)-1] + } + + if release.TagName <= cf.Version { + fmt.Printf("Already on atest release: %s\n", release.Name) + return + } + + if len(release.Assets) == 0 { + println("No release files exist for " + release.Name) + return + } + + fileName := cf.Info.ProductName + ".exe" + asset := release.Assets[slices.IndexFunc(release.Assets, func(c Asset) bool { return c.Name == fileName })] + if asset == (Asset{}) { + println("Could not find download url for " + release.Name) + return + } + + fmt.Printf("Found newer release: %s\n", release.Name) + installNewRelease := dialog.Message("%s", "Do you want to install it?\n"+release.Name).Title("New update available!").YesNo() + + if installNewRelease { + DownladAndInstallUpdate(asset.DownloadUrl) + } } } -func Update() { +func DownladAndInstallUpdate(source string) { + println("Installing new release...") + res, err := http.Get(source) + + if err != nil { + fmt.Printf("Error: Could not download release: %s\n", err) + return + } + + defer res.Body.Close() + err = update.Apply(res.Body, update.Options{}) + + if err != nil { + fmt.Printf("Error: Could not install release: %s\n", err) + return + } + + println("Successfully installed new release!") + dialog.Message("%s", "Successfully installed new release!").Title("Update installed!").Info() + os.Exit(0) } diff --git a/main.go b/main.go index bc1c658..58170d2 100644 --- a/main.go +++ b/main.go @@ -19,6 +19,9 @@ import ( //go:embed all:frontend/dist var assets embed.FS +//go:embed wails.json +var WailsConfigFile []byte + const ( logFilePath = "main.log" ) @@ -33,7 +36,7 @@ func main() { l := logger.New(file) - helpers.CheckForUpdates() + helpers.CheckForUpdates(WailsConfigFile) // Create an instance of the app structure app := NewApp() diff --git a/wails.json b/wails.json index a1bac71..8876573 100644 --- a/wails.json +++ b/wails.json @@ -2,6 +2,8 @@ "$schema": "https://wails.io/schemas/config.v2.json", "name": "Ark-Ascended-Server-Manager", "version": "0.0.0", + "environment": "dev", + "isNightly": false, "outputfilename": "ArkAscendedServerManager", "frontend:install": "npm install", "frontend:build": "npm run build", From bf014be03018728e34c2cf6cf6ad8e7baa0096ed Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:29:50 +0100 Subject: [PATCH 06/21] fix path --- build/updateConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/updateConfig.js b/build/updateConfig.js index 9e1ea06..6887857 100644 --- a/build/updateConfig.js +++ b/build/updateConfig.js @@ -1,5 +1,5 @@ const fs = require('fs'); -const fileName = './wails.json'; +const fileName = '../wails.json'; const file = require(fileName); console.log("changing version to " + process.argv[2] + ", isNightly to " + process.argv[3] + " and environment to prod") From a87892f410c5a27018162e5238d2af1795879e15 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:35:33 +0100 Subject: [PATCH 07/21] removed unneeded step --- .github/workflows/nightly.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index c4e6f30..56b731c 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -22,9 +22,6 @@ jobs: - name: Set direct proxy run: go env -w GOPROXY=direct - run: go install github.com/wailsapp/wails/cmd/wails@latest - - name: Get Tag Name - id: extract_tag_name - run: echo "Tag name is ${GITHUB_REF/refs\/tags\//}" - name: Update wails.json run: node build/updateConfig.js ${{ github.run_number }} true - uses: dAppServer/wails-build-action@v2.2 From 6d7c67af44cdc41ae5a978c552e65f32f932e996 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:57:49 +0100 Subject: [PATCH 08/21] fix changing the version correctly --- build/updateConfig.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/updateConfig.js b/build/updateConfig.js index 6887857..ec21c9a 100644 --- a/build/updateConfig.js +++ b/build/updateConfig.js @@ -5,6 +5,7 @@ const file = require(fileName); console.log("changing version to " + process.argv[2] + ", isNightly to " + process.argv[3] + " and environment to prod") file.version = process.argv[2]; +file.info.version = process.argv[2]; file.isNightly = process.argv[3] === 'true'; file.environment = "prod" From 0dbcf7f8b4da7428b71ac72d9f05917df318e206 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:06:57 +0100 Subject: [PATCH 09/21] i hope this works --- .github/workflows/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d25d2e..4d88cb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,11 +22,8 @@ jobs: - name: Set direct proxy run: go env -w GOPROXY=direct - run: go install github.com/wailsapp/wails/cmd/wails@latest - - name: Get Tag Name - id: extract_tag_name - run: echo "Tag name is ${GITHUB_REF/refs\/tags\//}" - name: Update wails.json - run: node build/updateConfig.js ${{ steps.extract_tag_name.outputs.stdout }} false + run: node build/updateConfig.js ${{ github.ref_name }} false - uses: dAppServer/wails-build-action@v2.2 with: build-name: ${{ matrix.build.name }} From 3eef48ee712575070a58548b68633155d035b905 Mon Sep 17 00:00:00 2001 From: pepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 12:05:24 +0100 Subject: [PATCH 10/21] fixed version number --- build/updateConfig.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/updateConfig.js b/build/updateConfig.js index ec21c9a..422f8a4 100644 --- a/build/updateConfig.js +++ b/build/updateConfig.js @@ -4,7 +4,7 @@ const file = require(fileName); console.log("changing version to " + process.argv[2] + ", isNightly to " + process.argv[3] + " and environment to prod") -file.version = process.argv[2]; +file.version = process.argv[2].replace("v", ""); file.info.version = process.argv[2]; file.isNightly = process.argv[3] === 'true'; file.environment = "prod" @@ -13,4 +13,4 @@ fs.writeFile(fileName, JSON.stringify(file), function writeJSON(err) { if (err) return console.log(err); console.log(JSON.stringify(file)); console.log('Wrote to ' + fileName + "!"); -}); \ No newline at end of file +}); From c97494632ab6b2eb0c05f1d38f4618c558c457c2 Mon Sep 17 00:00:00 2001 From: pepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:14:33 +0100 Subject: [PATCH 11/21] added more logging --- helpers/updateServiceHelper.go | 1 + 1 file changed, 1 insertion(+) diff --git a/helpers/updateServiceHelper.go b/helpers/updateServiceHelper.go index 1ebf3da..8d9d7a6 100644 --- a/helpers/updateServiceHelper.go +++ b/helpers/updateServiceHelper.go @@ -46,6 +46,7 @@ func CheckForUpdates(WailsConfigFile []byte) { } if cf.Environment == "dev" { + println("Environment is in dev mode") println("Skipping update check") return } From 33a4d1699445ac57d0a6e984558585ae62e3eb48 Mon Sep 17 00:00:00 2001 From: pepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:17:55 +0100 Subject: [PATCH 12/21] fixed bug --- build/updateConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/updateConfig.js b/build/updateConfig.js index 422f8a4..6eaeb97 100644 --- a/build/updateConfig.js +++ b/build/updateConfig.js @@ -5,7 +5,7 @@ const file = require(fileName); console.log("changing version to " + process.argv[2] + ", isNightly to " + process.argv[3] + " and environment to prod") file.version = process.argv[2].replace("v", ""); -file.info.version = process.argv[2]; +file.info.version = file.version; file.isNightly = process.argv[3] === 'true'; file.environment = "prod" From 421b866538b03e679139a073f3d5a4780c64e041 Mon Sep 17 00:00:00 2001 From: pepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:47:26 +0100 Subject: [PATCH 13/21] Formatting --- helpers/updateServiceHelper.go | 86 +++++++++++++++++----------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/helpers/updateServiceHelper.go b/helpers/updateServiceHelper.go index 8d9d7a6..b20743f 100644 --- a/helpers/updateServiceHelper.go +++ b/helpers/updateServiceHelper.go @@ -64,49 +64,49 @@ func CheckForUpdates(WailsConfigFile []byte) { fmt.Printf("Error: Could not get latest release info: %s\n", err) println("Skipping update check") return - } else { - resBody, err := io.ReadAll(res.Body) - if err != nil { - fmt.Printf("server: could not read request body: %s\n", err) - println("Skipping update check") - return - } - - err = json.Unmarshal(resBody, &release) - if err != nil { - fmt.Printf("Error: Could not parse release info: %s\n", err) - println("Skipping update check") - return - } - - if cf.IsNightly { - nameArr := strings.Split(release.Name, " ") - release.TagName = nameArr[len(nameArr)-1] - } - - if release.TagName <= cf.Version { - fmt.Printf("Already on atest release: %s\n", release.Name) - return - } - - if len(release.Assets) == 0 { - println("No release files exist for " + release.Name) - return - } - - fileName := cf.Info.ProductName + ".exe" - asset := release.Assets[slices.IndexFunc(release.Assets, func(c Asset) bool { return c.Name == fileName })] - if asset == (Asset{}) { - println("Could not find download url for " + release.Name) - return - } - - fmt.Printf("Found newer release: %s\n", release.Name) - installNewRelease := dialog.Message("%s", "Do you want to install it?\n"+release.Name).Title("New update available!").YesNo() - - if installNewRelease { - DownladAndInstallUpdate(asset.DownloadUrl) - } + } + + resBody, err := io.ReadAll(res.Body) + if err != nil { + fmt.Printf("server: could not read request body: %s\n", err) + println("Skipping update check") + return + } + + err = json.Unmarshal(resBody, &release) + if err != nil { + fmt.Printf("Error: Could not parse release info: %s\n", err) + println("Skipping update check") + return + } + + if cf.IsNightly { + nameArr := strings.Split(release.Name, " ") + release.TagName = nameArr[len(nameArr)-1] + } + + if release.TagName <= cf.Version { + fmt.Printf("Already on atest release: %s\n", release.Name) + return + } + + if len(release.Assets) == 0 { + println("No release files exist for " + release.Name) + return + } + + fileName := cf.Info.ProductName + ".exe" + asset := release.Assets[slices.IndexFunc(release.Assets, func(c Asset) bool { return c.Name == fileName })] + if asset == (Asset{}) { + println("Could not find download url for " + release.Name) + return + } + + fmt.Printf("Found newer release: %s\n", release.Name) + installNewRelease := dialog.Message("%s", "Do you want to install it?\n"+release.Name).Title("New update available!").YesNo() + + if installNewRelease { + DownladAndInstallUpdate(asset.DownloadUrl) } } From 0cf4863cb531c65732d80583a99c02bceceae9a2 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 17:38:53 +0100 Subject: [PATCH 14/21] hopefully fixed pipeline for the last time --- build/updateConfig.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build/updateConfig.js b/build/updateConfig.js index 6eaeb97..44c5316 100644 --- a/build/updateConfig.js +++ b/build/updateConfig.js @@ -1,16 +1,20 @@ const fs = require('fs'); -const fileName = '../wails.json'; -const file = require(fileName); +const fileName = 'wails.json'; +const file = require("../" + fileName); console.log("changing version to " + process.argv[2] + ", isNightly to " + process.argv[3] + " and environment to prod") -file.version = process.argv[2].replace("v", ""); -file.info.version = file.version; +const versionNum = `${process.argv[2]}`.replace("v", "") +file.version = versionNum; +file.info.productVersion = versionNum; file.isNightly = process.argv[3] === 'true'; file.environment = "prod" + +if(process.argv[2] === undefined || process.argv[2] === "" || process.argv[3] === undefined || process.argv[3] === "") { + throw new Error("version and isNightly must be set") +} fs.writeFile(fileName, JSON.stringify(file), function writeJSON(err) { if (err) return console.log(err); - console.log(JSON.stringify(file)); - console.log('Wrote to ' + fileName + "!"); + console.log(JSON.stringify(file, null, 2)); }); From a68a0f4f58d9e9dfbd940a16418d2a53d9f2597b Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:44:01 +0100 Subject: [PATCH 15/21] fixed version checking --- go.mod | 1 + go.sum | 2 ++ helpers/updateServiceHelper.go | 18 ++++++++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 10a83e9..d42e272 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.18 require ( github.com/adrg/xdg v0.4.0 + github.com/hashicorp/go-version v1.6.0 github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf github.com/jensvandewiel/gosteamcmd v0.1.2 github.com/sethvargo/go-password v0.2.0 diff --git a/go.sum b/go.sum index fc7dd48..ec4b974 100644 --- a/go.sum +++ b/go.sum @@ -13,6 +13,8 @@ github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf h1:WfD7VjIE6z8dIvMsI4/s+1qr5EL+zoIGev1BQj1eoJ8= github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg= github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck= diff --git a/helpers/updateServiceHelper.go b/helpers/updateServiceHelper.go index b20743f..fef35d1 100644 --- a/helpers/updateServiceHelper.go +++ b/helpers/updateServiceHelper.go @@ -9,6 +9,7 @@ import ( "slices" "strings" + "github.com/hashicorp/go-version" "github.com/inconshreveable/go-update" "github.com/sqweek/dialog" ) @@ -65,7 +66,7 @@ func CheckForUpdates(WailsConfigFile []byte) { println("Skipping update check") return } - + resBody, err := io.ReadAll(res.Body) if err != nil { fmt.Printf("server: could not read request body: %s\n", err) @@ -85,7 +86,20 @@ func CheckForUpdates(WailsConfigFile []byte) { release.TagName = nameArr[len(nameArr)-1] } - if release.TagName <= cf.Version { + installedVersion, err := version.NewVersion(cf.Version) + if err != nil { + fmt.Printf("Error: Could not parse installed version: %s\n", err) + println("Skipping update check") + return + } + latestVersion, err := version.NewVersion(release.TagName) + if err != nil { + fmt.Printf("Error: Could not parse latest version: %s\n", err) + println("Skipping update check") + return + } + + if installedVersion.GreaterThanOrEqual(latestVersion) { fmt.Printf("Already on atest release: %s\n", release.Name) return } From a1b697a597e57a6431664d81b4aa3be583236831 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 19:03:45 +0100 Subject: [PATCH 16/21] fixed pr pipeline --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a9dc61d..02be74e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -24,7 +24,7 @@ jobs: run: go env -w GOPROXY=direct - run: go install github.com/wailsapp/wails/cmd/wails@latest - name: Update wails.json - run: node build/updateConfig.js 99999999 false + run: node build/updateConfig.js 999.999.999 false - uses: dAppServer/wails-build-action@v2.2 with: build-name: ${{ matrix.build.name }} From 76ffffb5259abdae02cda4ec4cd46637f2602960 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Wed, 1 Nov 2023 19:13:58 +0100 Subject: [PATCH 17/21] hopefully fix autoupdater when running in program files --- helpers/updateServiceHelper.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/helpers/updateServiceHelper.go b/helpers/updateServiceHelper.go index fef35d1..f8fdc07 100644 --- a/helpers/updateServiceHelper.go +++ b/helpers/updateServiceHelper.go @@ -8,10 +8,12 @@ import ( "os" "slices" "strings" + "syscall" "github.com/hashicorp/go-version" "github.com/inconshreveable/go-update" "github.com/sqweek/dialog" + "golang.org/x/sys/windows" ) type Asset struct { @@ -125,6 +127,11 @@ func CheckForUpdates(WailsConfigFile []byte) { } func DownladAndInstallUpdate(source string) { + if !IsAdmin() { + RunMeElevated() + return + } + println("Installing new release...") res, err := http.Get(source) @@ -145,3 +152,29 @@ func DownladAndInstallUpdate(source string) { dialog.Message("%s", "Successfully installed new release!").Title("Update installed!").Info() os.Exit(0) } + +func RunMeElevated() { + verb := "runas" + exe, _ := os.Executable() + cwd, _ := os.Getwd() + args := strings.Join(os.Args[1:], " ") + + verbPtr, _ := syscall.UTF16PtrFromString(verb) + exePtr, _ := syscall.UTF16PtrFromString(exe) + cwdPtr, _ := syscall.UTF16PtrFromString(cwd) + argPtr, _ := syscall.UTF16PtrFromString(args) + + var showCmd int32 = 1 //SW_NORMAL + + err := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, showCmd) + if err != nil { + fmt.Println(err) + } + os.Exit(0) +} + +func IsAdmin() bool { + elevated := windows.GetCurrentProcessToken().IsElevated() + fmt.Printf("admin %v\n", elevated) + return elevated +} From 8c421c8c4378b53cc81cfde6196a925df2cad5f8 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:28:30 +0100 Subject: [PATCH 18/21] added installer to gitignore --- build/windows/installer/project.nsi | 108 -------------- build/windows/installer/wails_tools.nsh | 179 ------------------------ 2 files changed, 287 deletions(-) delete mode 100644 build/windows/installer/project.nsi delete mode 100644 build/windows/installer/wails_tools.nsh diff --git a/build/windows/installer/project.nsi b/build/windows/installer/project.nsi deleted file mode 100644 index 13cc4f0..0000000 --- a/build/windows/installer/project.nsi +++ /dev/null @@ -1,108 +0,0 @@ -Unicode true - -#### -## Please note: Template replacements don't work in this file. They are provided with default defines like -## mentioned underneath. -## If the keyword is not defined, "wails_tools.nsh" will populate them with the values from ProjectInfo. -## If they are defined here, "wails_tools.nsh" will not touch them. This allows to use this project.nsi manually -## from outside of Wails for debugging and development of the installer. -## -## For development first make a wails nsis build to populate the "wails_tools.nsh": -## > wails build --target windows/amd64 --nsis -## Then you can call makensis on this file with specifying the path to your binary: -## For a AMD64 only installer: -## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app.exe -## For a ARM64 only installer: -## > makensis -DARG_WAILS_ARM64_BINARY=..\..\bin\app.exe -## For a installer with both architectures: -## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app-amd64.exe -DARG_WAILS_ARM64_BINARY=..\..\bin\app-arm64.exe -#### -## The following information is taken from the ProjectInfo file, but they can be overwritten here. -#### -## !define INFO_PROJECTNAME "MyProject" # Default "{{.Name}}" -## !define INFO_COMPANYNAME "MyCompany" # Default "{{.Info.CompanyName}}" -## !define INFO_PRODUCTNAME "MyProduct" # Default "{{.Info.ProductName}}" -## !define INFO_PRODUCTVERSION "1.0.0" # Default "{{.Info.ProductVersion}}" -## !define INFO_COPYRIGHT "Copyright" # Default "{{.Info.Copyright}}" -### -## !define PRODUCT_EXECUTABLE "Application.exe" # Default "${INFO_PROJECTNAME}.exe" -## !define UNINST_KEY_NAME "UninstKeyInRegistry" # Default "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}" -#### -## !define REQUEST_EXECUTION_LEVEL "admin" # Default "admin" see also https://nsis.sourceforge.io/Docs/Chapter4.html -#### -## Include the wails tools -#### -!include "wails_tools.nsh" - -# The version information for this two must consist of 4 parts -VIProductVersion "${INFO_PRODUCTVERSION}.0" -VIFileVersion "${INFO_PRODUCTVERSION}.0" - -VIAddVersionKey "CompanyName" "${INFO_COMPANYNAME}" -VIAddVersionKey "FileDescription" "${INFO_PRODUCTNAME} Installer" -VIAddVersionKey "ProductVersion" "${INFO_PRODUCTVERSION}" -VIAddVersionKey "FileVersion" "${INFO_PRODUCTVERSION}" -VIAddVersionKey "LegalCopyright" "${INFO_COPYRIGHT}" -VIAddVersionKey "ProductName" "${INFO_PRODUCTNAME}" - -# Enable HiDPI support. https://nsis.sourceforge.io/Reference/ManifestDPIAware -ManifestDPIAware true - -!include "MUI.nsh" - -!define MUI_ICON "..\icon.ico" -!define MUI_UNICON "..\icon.ico" -# !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\leftimage.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314 -!define MUI_FINISHPAGE_NOAUTOCLOSE # Wait on the INSTFILES page so the user can take a look into the details of the installation steps -!define MUI_ABORTWARNING # This will warn the user if they exit from the installer. - -!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page. -# !insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer -!insertmacro MUI_PAGE_DIRECTORY # In which folder install page. -!insertmacro MUI_PAGE_INSTFILES # Installing page. -!insertmacro MUI_PAGE_FINISH # Finished installation page. - -!insertmacro MUI_UNPAGE_INSTFILES # Uinstalling page - -!insertmacro MUI_LANGUAGE "English" # Set the Language of the installer - -## The following two statements can be used to sign the installer and the uninstaller. The path to the binaries are provided in %1 -#!uninstfinalize 'signtool --file "%1"' -#!finalize 'signtool --file "%1"' - -Name "${INFO_PRODUCTNAME}" -OutFile "..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file. -InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder). -ShowInstDetails show # This will always show the installation details. - -Function .onInit - !insertmacro wails.checkArchitecture -FunctionEnd - -Section - !insertmacro wails.setShellContext - - !insertmacro wails.webview2runtime - - SetOutPath $INSTDIR - - !insertmacro wails.files - - CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" - CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" - - !insertmacro wails.writeUninstaller -SectionEnd - -Section "uninstall" - !insertmacro wails.setShellContext - - RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath - - RMDir /r $INSTDIR - - Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" - Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk" - - !insertmacro wails.deleteUninstaller -SectionEnd diff --git a/build/windows/installer/wails_tools.nsh b/build/windows/installer/wails_tools.nsh deleted file mode 100644 index 096e78a..0000000 --- a/build/windows/installer/wails_tools.nsh +++ /dev/null @@ -1,179 +0,0 @@ -# DO NOT EDIT - Generated automatically by `wails build` - -!include "x64.nsh" -!include "WinVer.nsh" -!include "FileFunc.nsh" - -!ifndef INFO_PROJECTNAME - !define INFO_PROJECTNAME "Ark Ascended Server Manager" -!endif -!ifndef INFO_COMPANYNAME - !define INFO_COMPANYNAME "Jens van de Wiel" -!endif -!ifndef INFO_PRODUCTNAME - !define INFO_PRODUCTNAME "Ark Ascended Server Manager" -!endif -!ifndef INFO_PRODUCTVERSION - !define INFO_PRODUCTVERSION "0.0.0" -!endif -!ifndef INFO_COPYRIGHT - !define INFO_COPYRIGHT "MIT License | Copyright (c) 2023 Jens van de Wiel | Further Information: https://github.com/JensvandeWiel/ArkAscendedServerManager/blob/main/LICENSE" -!endif -!ifndef PRODUCT_EXECUTABLE - !define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe" -!endif -!ifndef UNINST_KEY_NAME - !define UNINST_KEY_NAME "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}" -!endif -!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${UNINST_KEY_NAME}" - -!ifndef REQUEST_EXECUTION_LEVEL - !define REQUEST_EXECUTION_LEVEL "admin" -!endif - -RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}" - -!ifdef ARG_WAILS_AMD64_BINARY - !define SUPPORTS_AMD64 -!endif - -!ifdef ARG_WAILS_ARM64_BINARY - !define SUPPORTS_ARM64 -!endif - -!ifdef SUPPORTS_AMD64 - !ifdef SUPPORTS_ARM64 - !define ARCH "amd64_arm64" - !else - !define ARCH "amd64" - !endif -!else - !ifdef SUPPORTS_ARM64 - !define ARCH "arm64" - !else - !error "Wails: Undefined ARCH, please provide at least one of ARG_WAILS_AMD64_BINARY or ARG_WAILS_ARM64_BINARY" - !endif -!endif - -!macro wails.checkArchitecture - !ifndef WAILS_WIN10_REQUIRED - !define WAILS_WIN10_REQUIRED "This product is only supported on Windows 10 (Server 2016) and later." - !endif - - !ifndef WAILS_ARCHITECTURE_NOT_SUPPORTED - !define WAILS_ARCHITECTURE_NOT_SUPPORTED "This product can't be installed on the current Windows architecture. Supports: ${ARCH}" - !endif - - ${If} ${AtLeastWin10} - !ifdef SUPPORTS_AMD64 - ${if} ${IsNativeAMD64} - Goto ok - ${EndIf} - !endif - - !ifdef SUPPORTS_ARM64 - ${if} ${IsNativeARM64} - Goto ok - ${EndIf} - !endif - - IfSilent silentArch notSilentArch - silentArch: - SetErrorLevel 65 - Abort - notSilentArch: - MessageBox MB_OK "${WAILS_ARCHITECTURE_NOT_SUPPORTED}" - Quit - ${else} - IfSilent silentWin notSilentWin - silentWin: - SetErrorLevel 64 - Abort - notSilentWin: - MessageBox MB_OK "${WAILS_WIN10_REQUIRED}" - Quit - ${EndIf} - - ok: -!macroend - -!macro wails.files - !ifdef SUPPORTS_AMD64 - ${if} ${IsNativeAMD64} - File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_AMD64_BINARY}" - ${EndIf} - !endif - - !ifdef SUPPORTS_ARM64 - ${if} ${IsNativeARM64} - File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_ARM64_BINARY}" - ${EndIf} - !endif -!macroend - -!macro wails.writeUninstaller - WriteUninstaller "$INSTDIR\uninstall.exe" - - SetRegView 64 - WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${INFO_COMPANYNAME}" - WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${INFO_PRODUCTNAME}" - WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${INFO_PRODUCTVERSION}" - WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}" - WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" - WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" - - ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 - IntFmt $0 "0x%08X" $0 - WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" "$0" -!macroend - -!macro wails.deleteUninstaller - Delete "$INSTDIR\uninstall.exe" - - SetRegView 64 - DeleteRegKey HKLM "${UNINST_KEY}" -!macroend - -!macro wails.setShellContext - ${If} ${REQUEST_EXECUTION_LEVEL} == "admin" - SetShellVarContext all - ${else} - SetShellVarContext current - ${EndIf} -!macroend - -# Install webview2 by launching the bootstrapper -# See https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment -!macro wails.webview2runtime - !ifndef WAILS_INSTALL_WEBVIEW_DETAILPRINT - !define WAILS_INSTALL_WEBVIEW_DETAILPRINT "Installing: WebView2 Runtime" - !endif - - SetRegView 64 - # If the admin key exists and is not empty then webview2 is already installed - ReadRegStr $0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" - ${If} $0 != "" - Goto ok - ${EndIf} - - ${If} ${REQUEST_EXECUTION_LEVEL} == "user" - # If the installer is run in user level, check the user specific key exists and is not empty then webview2 is already installed - ReadRegStr $0 HKCU "Software\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" - ${If} $0 != "" - Goto ok - ${EndIf} - ${EndIf} - - SetDetailsPrint both - DetailPrint "${WAILS_INSTALL_WEBVIEW_DETAILPRINT}" - SetDetailsPrint listonly - - InitPluginsDir - CreateDirectory "$pluginsdir\webview2bootstrapper" - SetOutPath "$pluginsdir\webview2bootstrapper" - File "tmp\MicrosoftEdgeWebview2Setup.exe" - ExecWait '"$pluginsdir\webview2bootstrapper\MicrosoftEdgeWebview2Setup.exe" /silent /install' - - SetDetailsPrint both - ok: -!macroend \ No newline at end of file From b4965f4077920a8dd0b82d547677f0e93088f2d9 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:28:36 +0100 Subject: [PATCH 19/21] oops --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a89bf59..e710466 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ bower_components .lock-wscript build/Release build/bin +build/installer wailsjs/ package.json.md5 node_modules/ From 5ec39bd498c9c938abb1170785dfbcecbce161a0 Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:29:32 +0100 Subject: [PATCH 20/21] what happened here --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d42e272..1819b42 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/sethvargo/go-password v0.2.0 github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf github.com/wailsapp/wails/v2 v2.6.0 + golang.org/x/sys v0.13.0 ) require ( @@ -38,7 +39,6 @@ require ( golang.org/x/crypto v0.14.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect ) From ff8a486f6f2caf22cf1a3c1ac69221858f4dc12e Mon Sep 17 00:00:00 2001 From: ItsMePepijn <68758035+ItsMePepijn@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:30:01 +0100 Subject: [PATCH 21/21] fixed nightly pipeline --- .github/workflows/nightly.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 56b731c..29ec65d 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -22,8 +22,11 @@ jobs: - name: Set direct proxy run: go env -w GOPROXY=direct - run: go install github.com/wailsapp/wails/cmd/wails@latest + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y.%m.%d')" - name: Update wails.json - run: node build/updateConfig.js ${{ github.run_number }} true + run: node build/updateConfig.js ${{ steps.date.outputs.date }}.${{ github.run_number }} true - uses: dAppServer/wails-build-action@v2.2 with: build-name: ${{ matrix.build.name }}