Commit 9b3f8f5d authored by wudizhanche1000's avatar wudizhanche1000

Merge index.js

parent 95f65352
...@@ -10,7 +10,7 @@ function handleElevate() { ...@@ -10,7 +10,7 @@ function handleElevate() {
if (process.argv[1] == '-e') { if (process.argv[1] == '-e') {
if (process.platform == 'darwin') { if (process.platform == 'darwin') {
app.dock.hide(); require('electron').app.dock.hide();
} }
let elevate = JSON.parse(new Buffer(process.argv[2], 'base64').toString()); let elevate = JSON.parse(new Buffer(process.argv[2], 'base64').toString());
require('net').connect(elevate['ipc'], function () { require('net').connect(elevate['ipc'], function () {
...@@ -74,18 +74,23 @@ if (process.env['NODE_ENV'] == 'production' && process.platform == 'darwin') { ...@@ -74,18 +74,23 @@ if (process.env['NODE_ENV'] == 'production' && process.platform == 'darwin') {
// }, 6000) // }, 6000)
// } // }
autoUpdater.on('error', (event) => { autoUpdater.on('error', (event) => {
global.update_status = 'error';
console.log('autoUpdater', 'error', event); console.log('autoUpdater', 'error', event);
}); });
autoUpdater.on('checking-for-update', () => { autoUpdater.on('checking-for-update', () => {
global.update_status = 'checking-for-update';
console.log('autoUpdater', 'checking-for-update'); console.log('autoUpdater', 'checking-for-update');
}); });
autoUpdater.on('update-available', () => { autoUpdater.on('update-available', () => {
global.update_status = 'update-available';
console.log('autoUpdater', 'update-available'); console.log('autoUpdater', 'update-available');
}); });
autoUpdater.on('update-not-available', () => { autoUpdater.on('update-not-available', () => {
global.update_status = 'update-not-available';
console.log('autoUpdater', 'update-not-available'); console.log('autoUpdater', 'update-not-available');
}); });
autoUpdater.on('update-downloaded', (event) => { autoUpdater.on('update-downloaded', (event) => {
global.update_status = 'update-downloaded';
console.log('autoUpdater', 'update-downloaded', event); console.log('autoUpdater', 'update-downloaded', event);
updateWindow = new BrowserWindow({ updateWindow = new BrowserWindow({
width: 640, width: 640,
...@@ -180,7 +185,7 @@ function createTray() { ...@@ -180,7 +185,7 @@ function createTray() {
app.on('ready', () => { app.on('ready', () => {
createWindow(); createWindow();
if (process.env['NODE_ENV'] == 'production') { if (process.env['NODE_ENV'] == 'production') {
setTimeout(autoUpdater.checkForUpdates.bind(autoUpdater), 2000); autoUpdater.checkForUpdates()
} }
if (process.platform == 'win32') { if (process.platform == 'win32') {
createTray() createTray()
......
Markdown is supported
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