Skip to content

Commit

Permalink
enabled auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Davis-Software committed Oct 8, 2022
1 parent 5076a32 commit 634ac03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion back/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions back/update-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function update_downloaded(){
}
}
function update_error(error){
console.error(error)
dialog.showErrorBox("Update error", error)
}

Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 634ac03

Please sign in to comment.