Browse Source

Removed autoUpdate functionallity

Now, the user will be notify from Firebase and download it manually.
pull/116/head
Ramiro Saenz 9 years ago
parent
commit
ca1e5bb0b4
  1. 36
      electron/autoupdater.js
  2. 4
      electron/main.js

36
electron/autoupdater.js

@ -1,36 +0,0 @@
'use strict';
const electron = require('electron');
const fs = require('fs');
const path = require('path');
const app = electron.app;
const dialog = electron.dialog;
const isDev = !fs.existsSync(path.resolve(path.dirname(process.execPath), '..', 'Update.exe'));
const autoUpdater = electron.autoUpdater;
const feedUrl = `https://getrambox.herokuapp.com/update/${process.platform}/${app.getVersion()}`;
exports.check = win => {
if ( isDev ) return;
/*
autoUpdater.on('update-available', function() {
dialog.showMessageBox({
message: 'New version'
,detail: 'There is a new version available.'
,buttons: ['Ok']
});
});
*/
autoUpdater.on('update-downloaded', function(e, releaseNotes, releaseName, releaseDate, updateURL) {
var index = dialog.showMessageBox({
message: 'A new update is ready to install'
,detail: 'Version ' + releaseName + ' is downloaded and will be automatically installed on Quit. Do you want to restart now?'
,buttons: ['Yes', 'No']
});
if (index === 0) autoUpdater.quitAndInstall();
});
autoUpdater.setFeedURL(feedUrl);
autoUpdater.checkForUpdates();
};

4
electron/main.js

@ -11,8 +11,6 @@ const shell = require('electron').shell;
const appMenu = require('./menu');
// Require for tray file
const tray = require('./tray');
// Require for autpUpdate file
const autoupdater = require('./autoupdater');
// Window State Plugin
const windowStateKeeper = require('electron-window-state');
@ -130,8 +128,6 @@ function createWindow () {
tray.create(mainWindow);
autoupdater.check(mainWindow);
mainWindow.on('page-title-updated', (e, title) => updateBadge(title));
// Open links in default browser

Loading…
Cancel
Save