자동업데이트 보완코드 삽입. exception 처리분.
This commit is contained in:
parent
4d816c6e54
commit
e3b26549cc
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user