diff --git a/electron-builder.yml b/electron-builder.yml index 979bd71..60d990e 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -48,6 +48,6 @@ nsis: oneClick: false perMachine: true allowElevation: true - runAfterFinish: false + runAfterFinish: true differentialPackage: false artifactName: Switchify-PC-Setup-${version}-${arch}.${ext} diff --git a/src/main/updates/update-ipc.test.ts b/src/main/updates/update-ipc.test.ts index 524d789..6d8c91c 100644 --- a/src/main/updates/update-ipc.test.ts +++ b/src/main/updates/update-ipc.test.ts @@ -69,11 +69,12 @@ describe('registerUpdateIpc', () => { }); describe('update install confirmation options', () => { - it('warns about the installer and possible temporary access loss', () => { + it('warns about installer, restart, and possible temporary access loss', () => { expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.type).toBe('warning'); expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.message).toContain('Install the downloaded Switchify PC update'); expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.detail).toContain('temporarily lose access'); expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.detail).toContain('installer runs'); + expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.detail).toContain('starts again'); expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.buttons).toEqual(['Install update', 'Cancel']); expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.defaultId).toBe(1); expect(UPDATE_INSTALL_CONFIRMATION_OPTIONS.cancelId).toBe(1); diff --git a/src/main/updates/update-ipc.ts b/src/main/updates/update-ipc.ts index 8cbb2ed..3257daf 100644 --- a/src/main/updates/update-ipc.ts +++ b/src/main/updates/update-ipc.ts @@ -12,7 +12,7 @@ export const UPDATE_INSTALL_CONFIRMATION_OPTIONS: MessageBoxOptions = { title: 'Install update?', message: 'Install the downloaded Switchify PC update?', detail: - 'Switchify PC will close while the update installer runs. If you rely on Switchify to control this computer, you may temporarily lose access. Make sure you have another way to regain access before continuing.', + 'Switchify PC will close while the update installer runs. If you rely on Switchify to control this computer, you may temporarily lose access until the app starts again. Make sure you have another way to regain access before continuing.', buttons: ['Install update', 'Cancel'], defaultId: 1, cancelId: 1, diff --git a/src/main/updates/update-service.test.ts b/src/main/updates/update-service.test.ts index 60d9ea1..0322554 100644 --- a/src/main/updates/update-service.test.ts +++ b/src/main/updates/update-service.test.ts @@ -138,7 +138,7 @@ describe('UpdateService', () => { expect(updater.quitAndInstall).not.toHaveBeenCalled(); }); - it('installs downloaded updates through the interactive installer path', async () => { + it('installs downloaded updates through the interactive installer and relaunch path', async () => { const updater = new FakeUpdater(); updater.checkForUpdates.mockImplementation(async () => { updater.emit('update-available', updateInfo({ version: '0.1.1' })); @@ -153,7 +153,7 @@ describe('UpdateService', () => { await service.downloadUpdate(); expect(service.installDownloadedUpdate()).toEqual({ ok: true }); - expect(updater.quitAndInstall).toHaveBeenCalledWith(false, false); + expect(updater.quitAndInstall).toHaveBeenCalledWith(false, true); }); it('maps updater errors during checks to check_failed', async () => { diff --git a/src/main/updates/update-service.ts b/src/main/updates/update-service.ts index 92f283a..4cffece 100644 --- a/src/main/updates/update-service.ts +++ b/src/main/updates/update-service.ts @@ -29,7 +29,7 @@ export type UpdateServiceOptions = { type UpdateOperation = 'idle' | 'checking' | 'downloading'; const INSTALL_UPDATE_SILENTLY = false; -const FORCE_RUN_AFTER_INSTALL = false; +const FORCE_RUN_AFTER_INSTALL = true; export class UpdateService { private readonly isPackaged: boolean;