我正在使用“ electron-updater”来检查自动更新Electron应用程序。
调用“ checkForUpdatesAndNotify()”函数。
在控制台中,我收到“因为应用程序未打包,所以跳过checkForUpdatesAndNotify”。
“电子生成器”:“ 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 + '%'; …Run Code Online (Sandbox Code Playgroud)