diff --git a/autoupdate.js b/autoupdate.js new file mode 100644 index 0000000..e5ccd72 --- /dev/null +++ b/autoupdate.js @@ -0,0 +1,28 @@ +const log = require('electron-log'); +const electron = require('electron') +const autoUpdater = electron.autoUpdater + +log.info('auto update loaded'); + + +autoUpdater.on('error', (ev, err) => { + log.info(err); +}) + +autoUpdater.once('checking-for-update', (ev, err) => { + log.info('Checking for updates'); +}) + +autoUpdater.once('update-available', (ev, err) => { + log.info('Update available. Downloading'); +}) + +autoUpdater.once('update-not-available', (ev, err) => { + log.info('Update not available'); +}) + +autoUpdater.once('update-downloaded', (ev, err) => { + log.info('Update downloaded'); +}) + +autoUpdater.checkForUpdates() \ No newline at end of file diff --git a/main.js b/main.js index f9a2b1f..c0bec58 100644 --- a/main.js +++ b/main.js @@ -9,8 +9,8 @@ else iconpath = path.join(__dirname, 'assets', 'servicepos.png') if (require('electron-squirrel-startup')) return app.quit(); -require('update-electron-app')() -require('./autolauncher.js'); +require('./autoupdate') +require('./autolauncher'); let tray = null function createWindow() { diff --git a/package.json b/package.json index f0c1268..e243ae1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "printdesk", - "version": "1.0.0", + "version": "1.0.1", "productName": "Printdesk", "description": "A electron app for connecting printers to ServicePOS", "main": "main.js", diff --git a/util.js b/util.js index 688028c..35fb272 100644 --- a/util.js +++ b/util.js @@ -3,6 +3,6 @@ const process = require('process'); module.exports = { isDev : function() { - return true && process.mainModule.filename.indexOf('app.asar') === -1; + return true || process.mainModule.filename.indexOf('app.asar') === -1; } } \ No newline at end of file