mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-24 07:54:43 +00:00
Fix auto-updater on mac not working
This commit is contained in:
@@ -102,22 +102,25 @@ module.exports = (socket, app) => {
|
||||
});
|
||||
socket.on('autoUpdaterQuitAndInstall', async (isSilent, isForceRunAfter) => {
|
||||
app.removeAllListeners("window-all-closed");
|
||||
setImmediate(() => {
|
||||
const windows = electron_1.BrowserWindow.getAllWindows();
|
||||
if (windows.length) {
|
||||
windows.forEach(w => {
|
||||
try {
|
||||
w.removeAllListeners('close');
|
||||
w.hide();
|
||||
w.destroy();
|
||||
}
|
||||
catch {
|
||||
//ignore, probably already destroyed
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const windows = electron_1.BrowserWindow.getAllWindows();
|
||||
if (windows.length) {
|
||||
windows.forEach(w => {
|
||||
try {
|
||||
w.removeAllListeners('close');
|
||||
w.removeAllListeners('closed');
|
||||
w.destroy();
|
||||
}
|
||||
catch {
|
||||
//ignore, probably already destroyed
|
||||
}
|
||||
});
|
||||
}
|
||||
//The call to quitAndInstall needs to happen after the windows
|
||||
//get a chance to close and release resources, so it must be done on a timeout
|
||||
setTimeout(() => {
|
||||
electron_updater_1.autoUpdater.quitAndInstall(isSilent, isForceRunAfter);
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
socket.on('autoUpdaterDownloadUpdate', async (guid) => {
|
||||
const downloadedPath = await electron_updater_1.autoUpdater.downloadUpdate();
|
||||
|
||||
@@ -130,22 +130,25 @@ export = (socket: Socket, app: Electron.App) => {
|
||||
|
||||
socket.on('autoUpdaterQuitAndInstall', async (isSilent, isForceRunAfter) => {
|
||||
app.removeAllListeners("window-all-closed");
|
||||
setImmediate(() => {
|
||||
const windows = BrowserWindow.getAllWindows();
|
||||
if (windows.length) {
|
||||
windows.forEach(w => {
|
||||
try {
|
||||
w.removeAllListeners('close');
|
||||
w.hide();
|
||||
w.destroy();
|
||||
}
|
||||
catch {
|
||||
//ignore, probably already destroyed
|
||||
}
|
||||
});
|
||||
}
|
||||
const windows = BrowserWindow.getAllWindows();
|
||||
if (windows.length) {
|
||||
windows.forEach(w => {
|
||||
try {
|
||||
w.removeAllListeners('close');
|
||||
w.removeAllListeners('closed');
|
||||
w.destroy();
|
||||
}
|
||||
catch {
|
||||
//ignore, probably already destroyed
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//The call to quitAndInstall needs to happen after the windows
|
||||
//get a chance to close and release resources, so it must be done on a timeout
|
||||
setTimeout(() => {
|
||||
autoUpdater.quitAndInstall(isSilent, isForceRunAfter);
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
|
||||
socket.on('autoUpdaterDownloadUpdate', async (guid) => {
|
||||
|
||||
Reference in New Issue
Block a user