【发布时间】:2019-06-06 09:52:20
【问题描述】:
我正在使用“electron-updater”来检查自动更新 Electron 应用程序。
调用“checkForUpdatesAndNotify()”函数。
在控制台中,我收到“跳过 checkForUpdatesAndNotify,因为应用程序未打包”。
- mac0S 莫哈韦,
- “电子更新器”:“^4.0.6”,
- “电子”:“^3.0.13”,
-
“电子制造商”:“20.28.1”
const {autoUpdater} = require("electron-updater"); autoUpdater.checkForUpdatesAndNotify(); autoUpdater.on('checking-for-update', () => { console.log('Checking for update...'); }); autoUpdater.on('update-available', (info) => { console.log('Update available.'); }); autoUpdater.on('update-not-available', (info) => { console.log('Update not available.'); }); autoUpdater.on('error', (err) => { console.log('Error in auto-updater. ' + err); }); autoUpdater.on('download-progress', (progressObj) => { let log_message = "Download speed: " + progressObj.bytesPerSecond; log_message = log_message + ' - Downloaded ' + progressObj.percent + '%'; log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')'; console.log(log_message); }); autoUpdater.on('update-downloaded', (info) => { console.log('Update downloaded'); });
【问题讨论】:
-
您在哪个环境中面临这个问题,开发还是生产?
标签: electron auto-update electron-builder