Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ nsis:
oneClick: false
perMachine: true
allowElevation: true
runAfterFinish: false
runAfterFinish: true
differentialPackage: false
artifactName: Switchify-PC-Setup-${version}-${arch}.${ext}
3 changes: 2 additions & 1 deletion src/main/updates/update-ipc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/updates/update-ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/main/updates/update-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }));
Expand All @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion src/main/updates/update-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down