Skip to content

Commit

Permalink
fix: Auto Updater in MacOs to avoid relaunch the app (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox authored Aug 2, 2024
1 parent c8a2c40 commit 4143386
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import updater from 'electron-updater';
import log from 'electron-log/main';
import { restoreOrCreateWindow } from '/@/mainWindow';
import './security-restrictions';
import { getOSName, PLATFORM } from './helpers';

// Initialize logger
log.transports.file.setAppName('DecentralandLauncher');
Expand Down Expand Up @@ -65,9 +66,13 @@ function updateAppAndQuit() {
log.info('[Main Window][AutoUpdater] Update not available');
app.quit();
});
updater.autoUpdater.once('download-progress', _info => {
log.info('[Main Window][AutoUpdater] Downloading update');
});
updater.autoUpdater.on('update-downloaded', _info => {
log.info('[Main Window][AutoUpdater] Update downloaded');
updater.autoUpdater.quitAndInstall(true, false);
const silent = getOSName() === PLATFORM.WINDOWS;
updater.autoUpdater.quitAndInstall(silent, false);
});
updater.autoUpdater.on('error', err => {
log.error('[Main Window][AutoUpdater] Error in auto-updater', err);
Expand Down

0 comments on commit 4143386

Please sign in to comment.