@todesktop/runtime
Advanced tools
Comparing version 0.1.0-rc.5 to 0.1.0-rc.6
@@ -20,2 +20,3 @@ "use strict"; | ||
const electron = require("electron"); | ||
const electron_log_1 = require("electron-log"); | ||
const eventemitter2_1 = require("eventemitter2"); | ||
@@ -253,5 +254,6 @@ const fs = require("fs"); | ||
fs.existsSync(path.join(electron.app.getAppPath(), "../Update.exe"))) { | ||
this._log("Setting up SquirrelWindowsUpdaterAgent"); | ||
__classPrivateFieldSet(this, _updaterAgent, new updaterAgents_1.SquirrelWindowsUpdaterAgent({ | ||
log: (...args) => { | ||
this._log("UpdaterAgent:", ...args); | ||
this._log("SquirrelWindowsUpdaterAgent:", ...args); | ||
}, | ||
@@ -261,5 +263,6 @@ })); | ||
} | ||
this._log("Setting up UpdaterAgent"); | ||
__classPrivateFieldSet(this, _updaterAgent, new updaterAgents_1.UpdaterAgent({ | ||
log: (...args) => { | ||
this._log("SquirrelWindowsUpdaterAgent:", ...args); | ||
this._log("UpdaterAgent:", ...args); | ||
}, | ||
@@ -282,2 +285,4 @@ })); | ||
args.map((arg) => JSON.stringify(arg)).join(" ")); | ||
electron_log_1.default.info(`AutoUpdater (${electron.app.name})${timeSinceCreatedAt}: ` + | ||
args.map((arg) => JSON.stringify(arg)).join(" ")); | ||
} | ||
@@ -284,0 +289,0 @@ _subscribeToElectronEvents() { |
@@ -37,6 +37,4 @@ "use strict"; | ||
try { | ||
// TODO: disable auto-download | ||
electronUpdater.autoUpdater.autoDownload = false; | ||
const updateCheckResult = await electronUpdater.autoUpdater.checkForUpdates(); | ||
console.log("UpdaterAgent: ", { updateCheckResult }); | ||
// No update available? | ||
@@ -57,4 +55,2 @@ if (!updateCheckResult || !updateCheckResult.updateInfo) { | ||
} | ||
console.log("UpdaterAgent: calling downloadUpdate"); | ||
// TODO: manually download the update | ||
await electronUpdater.autoUpdater.downloadUpdate(updateCheckResult.cancellationToken); | ||
@@ -98,2 +94,17 @@ return { | ||
}); | ||
[ | ||
"before-quit-for-update", | ||
"checking-for-update", | ||
"error", | ||
"update-available", | ||
"update-downloaded", | ||
"update-not-available", | ||
].forEach((eventName) => { | ||
// eslint-disable-next-line | ||
// @ts-ignore | ||
electron.autoUpdater.on(eventName, (...args) => __classPrivateFieldGet(this, _log_1).call(this, `autoUpdater event: ${eventName}`, ...args)); | ||
}); | ||
__classPrivateFieldGet(this, _log_1).call(this, "setFeedURL:", { | ||
url: `https://dl.todesktop.com/${config.id}/squirrel?${params}`, | ||
}); | ||
electron.autoUpdater.setFeedURL({ | ||
@@ -100,0 +111,0 @@ url: `https://dl.todesktop.com/${config.id}/squirrel?${params}`, |
{ | ||
"private": false, | ||
"name": "@todesktop/runtime", | ||
"version": "0.1.0-rc.5", | ||
"version": "0.1.0-rc.6", | ||
"license": "MIT", | ||
@@ -27,2 +27,3 @@ "author": "Adam Lynch <contact@adamlynch.com> (http://adamlynch.com/)", | ||
"dependencies": { | ||
"electron-log": "^4.1.2", | ||
"electron-updater": "^4.2.2", | ||
@@ -29,0 +30,0 @@ "eventemitter2": "^6.3.1", |
37674
667
5
+ Addedelectron-log@^4.1.2
+ Addedelectron-log@4.4.8(transitive)