From 4fc7c69a73783fc2af76a0a32883a585ac1bc208 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Mon, 23 Jan 2023 08:56:39 -0800 Subject: [PATCH] Add more logging in update scenarios --- ts/updater/common.ts | 1 + ts/updater/macos.ts | 4 ++-- ts/updater/windows.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ts/updater/common.ts b/ts/updater/common.ts index 9a72f6f3f..2a9ba562c 100644 --- a/ts/updater/common.ts +++ b/ts/updater/common.ts @@ -265,6 +265,7 @@ export abstract class Updater { const mainWindow = this.getMainWindow(); if (mainWindow) { + logger.info('downloadAndInstall: showing update dialog...'); mainWindow.webContents.send('show-update-dialog', DialogType.Update, { version: this.version, }); diff --git a/ts/updater/macos.ts b/ts/updater/macos.ts index adb0e591a..754e2c452 100644 --- a/ts/updater/macos.ts +++ b/ts/updater/macos.ts @@ -24,6 +24,7 @@ export class MacOSUpdater extends Updater { protected async installUpdate(updateFilePath: string): Promise { const { logger } = this; + logger.info('downloadAndInstall: handing download to electron...'); try { await this.handToAutoUpdate(updateFilePath); } catch (error) { @@ -41,10 +42,9 @@ export class MacOSUpdater extends Updater { // At this point, closing the app will cause the update to be installed automatically // because Squirrel has cached the update file and will do the right thing. - logger.info('downloadAndInstall: showing update dialog...'); this.setUpdateListener(async () => { - logger.info('performUpdate: calling quitAndInstall...'); + logger.info('downloadAndInstall: restarting...'); markShouldQuit(); autoUpdater.quitAndInstall(); }); diff --git a/ts/updater/windows.ts b/ts/updater/windows.ts index f36e379a9..b3488433f 100644 --- a/ts/updater/windows.ts +++ b/ts/updater/windows.ts @@ -47,8 +47,8 @@ export class WindowsUpdater extends Updater { protected async installUpdate(updateFilePath: string): Promise { const { logger } = this; - logger.info('downloadAndInstall: showing dialog...'); this.setUpdateListener(async () => { + logger.info('downloadAndInstall: installing...'); try { await this.install(updateFilePath); this.installing = true; @@ -58,6 +58,7 @@ export class WindowsUpdater extends Updater { throw error; } + logger.info('downloadAndInstall: restarting...'); markShouldQuit(); app.quit(); });