Add more logging in update scenarios

This commit is contained in:
Scott Nonnenberg 2023-01-23 08:56:39 -08:00 committed by GitHub
parent 7c1f186c05
commit 4fc7c69a73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -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,
});

View file

@ -24,6 +24,7 @@ export class MacOSUpdater extends Updater {
protected async installUpdate(updateFilePath: string): Promise<void> {
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();
});

View file

@ -47,8 +47,8 @@ export class WindowsUpdater extends Updater {
protected async installUpdate(updateFilePath: string): Promise<void> {
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();
});