Verified Commit 4f51f5a3 authored by azubieta's avatar azubieta
Browse files

use electron updater

parent 05b12019
......@@ -5,6 +5,11 @@ const {app, BrowserWindow, ipcMain} = require('electron');
const ElectronStore = require('electron-store');
const request = require('request');
const {autoUpdater} = require("electron-updater")
autoUpdater.logger = require("electron-log")
autoUpdater.logger.transports.file.level = "info"
// Set configs dir
app.setPath("userData", app.getPath("appData") + "/OCS-Store")
......@@ -93,14 +98,6 @@ function createWindow() {
mainWindow.loadURL(indexFileUrl);
mainWindow.maximize();
console.log('should check for updates')
require('update-electron-app')({
repo: 'dfn2/pling-store',
host: 'http://www.opencode.net',
updateInterval: '1 hour',
logger: require('electron-log')
})
mainWindow.on('close', () => {
const appConfigStore = new ElectronStore({name: appConfigStoreStorage});
......@@ -170,6 +167,7 @@ function removePreviewpic(itemKey) {
app.on('ready', async () => {
if (await startOcsManager()) {
createWindow();
autoUpdater.checkForUpdatesAndNotify()
} else {
app.quit();
}
......
......@@ -18,6 +18,7 @@
"dependencies": {
"electron-store": "2.*.*",
"electron-updater": "^4.1.2",
"electron-log": "^3.0.7",
"esm": "3.*.*",
"lit-html": "1.*.*",
"request": "2.*.*",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment