mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-16 03:32:10 -06:00
Auto-update server URL update
This commit is contained in:
parent
03b137489d
commit
421d0fa2f4
@ -9,7 +9,7 @@ import { whitelistHandler } from '../common/whitelist-handler';
|
|||||||
import { config } from './config-handler';
|
import { config } from './config-handler';
|
||||||
import { windowHandler } from './window-handler';
|
import { windowHandler } from './window-handler';
|
||||||
|
|
||||||
const DEFAULT_AUTO_UPDATE_CHANNEL = 'client-bff/static/sda-update';
|
const DEFAULT_AUTO_UPDATE_CHANNEL = 'sda-update';
|
||||||
|
|
||||||
export class AutoUpdate {
|
export class AutoUpdate {
|
||||||
public isUpdateAvailable: boolean = false;
|
public isUpdateAvailable: boolean = false;
|
||||||
@ -17,12 +17,7 @@ export class AutoUpdate {
|
|||||||
public autoUpdater: MacUpdater | NsisUpdater | undefined = undefined;
|
public autoUpdater: MacUpdater | NsisUpdater | undefined = undefined;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const { autoUpdateChannel } = config.getConfigFields(['autoUpdateChannel']);
|
const opts = this.getGenericServerOptions();
|
||||||
const opts: GenericServerOptions = {
|
|
||||||
provider: 'generic',
|
|
||||||
url: this.getUpdateUrl(),
|
|
||||||
channel: autoUpdateChannel || null,
|
|
||||||
};
|
|
||||||
if (isMac) {
|
if (isMac) {
|
||||||
this.autoUpdater = new MacUpdater(opts);
|
this.autoUpdater = new MacUpdater(opts);
|
||||||
} else if (isWindowsOS) {
|
} else if (isWindowsOS) {
|
||||||
@ -117,6 +112,8 @@ export class AutoUpdate {
|
|||||||
public checkUpdates = async (): Promise<void> => {
|
public checkUpdates = async (): Promise<void> => {
|
||||||
logger.info('auto-update-handler: Checking for updates');
|
logger.info('auto-update-handler: Checking for updates');
|
||||||
if (this.autoUpdater) {
|
if (this.autoUpdater) {
|
||||||
|
const opts: GenericServerOptions = this.getGenericServerOptions();
|
||||||
|
this.autoUpdater.setFeedURL(opts);
|
||||||
const updateCheckResult = await this.autoUpdater.checkForUpdates();
|
const updateCheckResult = await this.autoUpdater.checkForUpdates();
|
||||||
logger.info('auto-update-handler: ', updateCheckResult);
|
logger.info('auto-update-handler: ', updateCheckResult);
|
||||||
}
|
}
|
||||||
@ -162,6 +159,16 @@ export class AutoUpdate {
|
|||||||
|
|
||||||
return updateUrl;
|
return updateUrl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private getGenericServerOptions = (): GenericServerOptions => {
|
||||||
|
const { autoUpdateChannel } = config.getConfigFields(['autoUpdateChannel']);
|
||||||
|
const opts: GenericServerOptions = {
|
||||||
|
provider: 'generic',
|
||||||
|
url: this.getUpdateUrl(),
|
||||||
|
channel: autoUpdateChannel || null,
|
||||||
|
};
|
||||||
|
return opts;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const autoUpdate = new AutoUpdate();
|
const autoUpdate = new AutoUpdate();
|
||||||
|
Loading…
Reference in New Issue
Block a user