Skip to content

Commit 3d448d4

Browse files
committed
Added new auto-updater
1 parent d2efd42 commit 3d448d4

File tree

6 files changed

+48
-73
lines changed

6 files changed

+48
-73
lines changed

electron/dist/electron/main.js

Lines changed: 1 addition & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron/dist/electron/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron/main.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const fs = require('fs');
1212
const os = require('os');
1313
const log = require('electron-log');
1414
const exec = require('child_process').exec;
15-
const {autoUpdater} = require('electron-updater');
1615
const ipc = require('electron').ipcMain;
1716

1817
// Fix for warning at startup
@@ -113,32 +112,6 @@ const generateMainWindow = () => {
113112
});
114113
};
115114

116-
autoUpdater.on('checking-for-update', () => {
117-
log.info('Checking for update...');
118-
});
119-
autoUpdater.on('update-available', (info) => {
120-
log.info('Update available.');
121-
});
122-
autoUpdater.on('update-not-available', (info) => {
123-
log.info('Update not available.');
124-
});
125-
autoUpdater.on('error', (err) => {
126-
log.info('Error in auto-updater. ' + err);
127-
});
128-
autoUpdater.on('download-progress', (progressObj) => {
129-
let logMessage = 'Download speed: ' + progressObj.bytesPerSecond;
130-
logMessage = logMessage + ' - Downloaded ' + progressObj.percent + '%';
131-
logMessage = logMessage + ' (' + progressObj.transferred + '/' + progressObj.total + ')';
132-
log.info(logMessage);
133-
});
134-
autoUpdater.on('update-downloaded', (ev, info) => {
135-
// Wait 5 seconds, then quit and install
136-
// In your application, you don't need to wait 5 seconds.
137-
// You could call autoUpdater.quitAndInstall(); immediately
138-
log.info('Update downloaded');
139-
autoUpdater.quitAndInstall();
140-
});
141-
142115
app.on('activate', () => {
143116
if (win === null || win === undefined) {
144117
createWindow();
@@ -152,8 +125,8 @@ const generateMainWindow = () => {
152125
});
153126

154127
app.on('ready', () => {
155-
autoUpdater.checkForUpdatesAndNotify();
156128
createWindow();
129+
require('update-electron-app')();
157130
});
158131

159132
const gotTheLock = app.requestSingleInstanceLock();

0 commit comments

Comments
 (0)