자동업데이트 보완코드 삽입. exception 처리분.

This commit is contained in:
leejinho 2020-04-03 10:32:06 +09:00
parent 4d816c6e54
commit e3b26549cc
2 changed files with 14 additions and 4 deletions

View File

@ -84,9 +84,17 @@ export class ElectronUpdateWindowService {
}
setDownloadValue(value: number, total: number) {
if (!this.browserWindow || this.browserWindow.isDestroyed()) {
return;
}
this.browserWindow.webContents.send(Channel.downloadProcess, value, total);
}
setDownloadComplete() {
if (!this.browserWindow || this.browserWindow.isDestroyed()) {
return;
}
this.browserWindow.webContents.send(Channel.downloadComplete);
}
close() {

View File

@ -959,10 +959,12 @@ autoUpdater.on('update-downloaded', info => {
const browserWindows = BrowserWindow.getAllWindows();
// https://github.com/electron-userland/electron-builder/issues/1604#issuecomment-372091881
if (!!browserWindows && browserWindows.length > 0) {
browserWindows.forEach(browserWindow => {
browserWindow.removeAllListeners(ElectronBrowserWindowChannel.Close);
browserWindow.removeAllListeners(ElectronBrowserWindowChannel.Closed);
});
}
setTimeout(() => {
updateWindowService.close();