자동업데이트 보완코드 삽입. exception 처리분.
This commit is contained in:
parent
4d816c6e54
commit
e3b26549cc
|
@ -84,9 +84,17 @@ export class ElectronUpdateWindowService {
|
||||||
}
|
}
|
||||||
|
|
||||||
setDownloadValue(value: number, total: number) {
|
setDownloadValue(value: number, total: number) {
|
||||||
|
if (!this.browserWindow || this.browserWindow.isDestroyed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.browserWindow.webContents.send(Channel.downloadProcess, value, total);
|
this.browserWindow.webContents.send(Channel.downloadProcess, value, total);
|
||||||
}
|
}
|
||||||
setDownloadComplete() {
|
setDownloadComplete() {
|
||||||
|
if (!this.browserWindow || this.browserWindow.isDestroyed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.browserWindow.webContents.send(Channel.downloadComplete);
|
this.browserWindow.webContents.send(Channel.downloadComplete);
|
||||||
}
|
}
|
||||||
close() {
|
close() {
|
||||||
|
|
|
@ -959,10 +959,12 @@ autoUpdater.on('update-downloaded', info => {
|
||||||
const browserWindows = BrowserWindow.getAllWindows();
|
const browserWindows = BrowserWindow.getAllWindows();
|
||||||
|
|
||||||
// https://github.com/electron-userland/electron-builder/issues/1604#issuecomment-372091881
|
// https://github.com/electron-userland/electron-builder/issues/1604#issuecomment-372091881
|
||||||
browserWindows.forEach(browserWindow => {
|
if (!!browserWindows && browserWindows.length > 0) {
|
||||||
browserWindow.removeAllListeners(ElectronBrowserWindowChannel.Close);
|
browserWindows.forEach(browserWindow => {
|
||||||
browserWindow.removeAllListeners(ElectronBrowserWindowChannel.Closed);
|
browserWindow.removeAllListeners(ElectronBrowserWindowChannel.Close);
|
||||||
});
|
browserWindow.removeAllListeners(ElectronBrowserWindowChannel.Closed);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
updateWindowService.close();
|
updateWindowService.close();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user