From d9d43ff1d443afe6b2d05f2174ed9544d55bd440 Mon Sep 17 00:00:00 2001 From: superlopez-real Date: Thu, 30 Jun 2022 19:54:13 +0100 Subject: [PATCH] fixed auto updater, it works now --- main.js | 13 +++++++++++-- package.json | 2 +- updater.css | 16 ++++++++++++++++ updater.html | 20 ++++++++++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 updater.css create mode 100644 updater.html diff --git a/main.js b/main.js index 4a9ec08..675d916 100644 --- a/main.js +++ b/main.js @@ -23,8 +23,6 @@ var shell = ? "powershell.exe" : shellSettings; /* "/opt/homebrew/bin/fish"*/ -autoUpdater.checkForUpdatesAndNotify(); - let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ @@ -44,6 +42,17 @@ function createWindow() { mainWindow = null; }); + autoUpdater.checkForUpdatesAndNotify(); + autoUpdater.on("update-available", function () { + mainWindow.loadURL(`file://${__dirname}/updater.html`); + }); + autoUpdater.on("update-downloaded", (updateInfo) => { + setTimeout(() => { + autoUpdater.quitAndInstall(); + app.exit(); + }, 10000); + }); + //ipcing var ptyProcess = pty.spawn(shell, [], { diff --git a/package.json b/package.json index f3514db..cc787de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kaiium", - "version": "1.0.1", + "version": "1.0.3", "description": "Terminal", "main": "main.js", "repository": { diff --git a/updater.css b/updater.css new file mode 100644 index 0000000..7780d68 --- /dev/null +++ b/updater.css @@ -0,0 +1,16 @@ +body, +html { + color: white; + background-color: #1a1a1a; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, + Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; +} + +.UpdatingStatus { + justify-content: center; + align-items: center; +} diff --git a/updater.html b/updater.html new file mode 100644 index 0000000..5b7a456 --- /dev/null +++ b/updater.html @@ -0,0 +1,20 @@ + + + + + + + Updating Kaiium + + + +
+

Updating...

+ +

"It's over anakin! I have the high ground!"

+
+ +