-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from feross/autoupdater
OS X: Add auto-updater, sign app, build .DMG and .ZIP assets
- Loading branch information
Showing
13 changed files
with
184 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,2 @@ | ||
console.time('init') | ||
require('./main') | ||
|
||
// report crashes | ||
// require('crash-reporter').start({ | ||
// productName: 'WebTorrent', | ||
// companyName: 'WebTorrent', | ||
// submitURL: 'https://webtorrent.io/crash-report', | ||
// autoSubmit: true | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
init | ||
} | ||
|
||
var electron = require('electron') | ||
|
||
var config = require('../config') | ||
var log = require('./log') | ||
|
||
var autoUpdater = electron.autoUpdater | ||
|
||
function init () { | ||
autoUpdater.on('error', function (err) { | ||
log.error('App update error: ' + err.message || err) | ||
}) | ||
|
||
autoUpdater.setFeedURL(config.AUTO_UPDATE_URL) | ||
|
||
/* | ||
* We always check for updates on app startup. To keep app startup fast, we delay this | ||
* first check so it happens when there is less going on. | ||
*/ | ||
setTimeout(() => autoUpdater.checkForUpdates(), config.AUTO_UPDATE_CHECK_STARTUP_DELAY) | ||
|
||
autoUpdater.on('checking-for-update', () => log('Checking for app update')) | ||
autoUpdater.on('update-available', () => log('App update available')) | ||
autoUpdater.on('update-not-available', () => log('App update not available')) | ||
autoUpdater.on('update-downloaded', function (e, releaseNotes, releaseName, releaseDate, updateURL) { | ||
log('App update downloaded: ', releaseName, updateURL) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = log | ||
module.exports.error = error | ||
|
||
/** | ||
* In the main electron process, we do not use console.log() statements because they do | ||
* not show up in a convenient location when running the packaged (i.e. production) | ||
* version of the app. Instead use this module, which sends the logs to the main window | ||
* where they can be viewed in Developer Tools. | ||
*/ | ||
|
||
var electron = require('electron') | ||
|
||
var windows = require('./windows') | ||
|
||
var app = electron.app | ||
|
||
function log (...args) { | ||
if (app.ipcReady) { | ||
windows.main.send('log', ...args) | ||
} else { | ||
app.on('ipcReady', () => windows.main.send('log', ...args)) | ||
} | ||
} | ||
|
||
function error (...args) { | ||
if (app.ipcReady) { | ||
windows.main.send('error', ...args) | ||
} else { | ||
app.on('ipcReady', () => windows.main.send('error', ...args)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.