From 634ac03e9c5d685ec00ea6766a8749d3714e27d3 Mon Sep 17 00:00:00 2001 From: Davis-Software Date: Sat, 8 Oct 2022 15:39:23 +0200 Subject: [PATCH] enabled auto-update --- back/config.js | 3 ++- back/update-service.js | 1 + index.js | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/back/config.js b/back/config.js index 678abc3..65f567f 100644 --- a/back/config.js +++ b/back/config.js @@ -9,4 +9,5 @@ exports.appDataDir = app.getPath("userData") exports.tempDir = app.getPath("temp") exports.var = {} -exports.devMode = true +exports.devMode = false +exports.autoUpdate = true diff --git a/back/update-service.js b/back/update-service.js index 8a7abc8..51480f6 100644 --- a/back/update-service.js +++ b/back/update-service.js @@ -27,6 +27,7 @@ function update_downloaded(){ } } function update_error(error){ + console.error(error) dialog.showErrorBox("Update error", error) } diff --git a/index.js b/index.js index 4f4357a..6aea4c9 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ const {invoke, registerIpcListener, registerIpcListenerSync} = require("./back/i require("./back/mc-connector") require("./back/utils") +const {autoUpdater} = require("electron-updater"); let win @@ -33,6 +34,10 @@ function MainWindow () { win.identifier = "main-window" require("./back/update-service") + if(!config.devMode && config.autoUpdate) { + autoUpdater.checkForUpdates().then() + } + win.forceClose = () => { win.allowClose = true win.close()