我正在尝试在我的Electron Mac应用程序中设置自动更新。我使用以下代码:
const autoUpdater = electron.autoUpdater;
autoUpdater.setFeedURL('https://server_url?v=' + appVersion);
autoUpdater.checkForUpdates();
autoUpdater.on('update-downloaded', function(){
autoUpdater.quitAndInstall();
});
但我认为这个语句 autoUpdater.quitAndInstall()
没有起作用。该应用程序没有被退出和重新启动。但是,如果我手动退出应用程序并重新打开,它就会打开更新后的应用程序。
我有一个窗口在应用程序中是不可关闭的。这会引起问题吗?