Skip to content

Commit

Permalink
fix: Auto update (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox authored Oct 15, 2024
1 parent 7b98a87 commit 16aae17
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ app
*/
function updateAppAndQuit() {
if (import.meta.env.PROD) {
updater.autoUpdater.autoInstallOnAppQuit = true;
updater.autoUpdater.autoRunAppAfterInstall = false;
updater.autoUpdater.on('checking-for-update', () => {
log.info('[Main Window][AutoUpdater] Checking for updates');
Expand All @@ -82,11 +83,8 @@ function updateAppAndQuit() {
});
updater.autoUpdater.on('update-downloaded', _info => {
log.info('[Main Window][AutoUpdater] Update downloaded');
if (getOSName() === PLATFORM.WINDOWS) {
updater.autoUpdater.quitAndInstall(true, false);
} else {
app.quit();
}
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 16aae17

Please sign in to comment.