Install downloaded updates while in tray
This commit is contained in:
parent
c4521a063c
commit
12a2ec8dd4
6 changed files with 87 additions and 24 deletions
|
@ -2,26 +2,20 @@
|
|||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import config from 'config';
|
||||
import type { BrowserWindow } from 'electron';
|
||||
|
||||
import type { Updater } from './common';
|
||||
import type { Updater, UpdaterOptionsType } from './common';
|
||||
import { MacOSUpdater } from './macos';
|
||||
import { WindowsUpdater } from './windows';
|
||||
import { isLinuxVersionSupported } from './linux';
|
||||
import type { LoggerType } from '../types/Logging';
|
||||
import { DialogType } from '../types/Dialogs';
|
||||
import type { SettingsChannel } from '../main/settingsChannel';
|
||||
|
||||
let initialized = false;
|
||||
|
||||
let updater: Updater | undefined;
|
||||
|
||||
export async function start(
|
||||
settingsChannel: SettingsChannel,
|
||||
logger: LoggerType,
|
||||
getMainWindow: () => BrowserWindow | undefined
|
||||
): Promise<void> {
|
||||
export async function start(options: UpdaterOptionsType): Promise<void> {
|
||||
const { platform } = process;
|
||||
const { logger, getMainWindow } = options;
|
||||
|
||||
if (initialized) {
|
||||
throw new Error('updater/start: Updates have already been initialized!');
|
||||
|
@ -50,9 +44,9 @@ export async function start(
|
|||
}
|
||||
|
||||
if (platform === 'win32') {
|
||||
updater = new WindowsUpdater(logger, settingsChannel, getMainWindow);
|
||||
updater = new WindowsUpdater(options);
|
||||
} else if (platform === 'darwin') {
|
||||
updater = new MacOSUpdater(logger, settingsChannel, getMainWindow);
|
||||
updater = new MacOSUpdater(options);
|
||||
} else {
|
||||
throw new Error('updater/start: Unsupported platform');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue