Skip to content

Commit

Permalink
Pass through vendor json in the updater
Browse files Browse the repository at this point in the history
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and indutny-signal committed Dec 12, 2023
1 parent e835870 commit 581464c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions ts/updater/common.ts
Expand Up @@ -48,6 +48,12 @@ import {

const INTERVAL = 30 * durations.MINUTE;

type JSONVendorSchema = {
requireManualUpdate?: boolean;
minOSVersion?: string;
requireUserConfirmation?: boolean;
};

type JSONUpdateSchema = {
version: string;
files: Array<{
Expand All @@ -59,10 +65,7 @@ type JSONUpdateSchema = {
path: string;
sha512: string;
releaseDate: string;
vendor?: {
requireManualUpdate?: boolean;
minOSVersion?: string;
};
vendor?: JSONVendorSchema;
};

export type UpdateInformationType = {
Expand All @@ -71,6 +74,7 @@ export type UpdateInformationType = {
version: string;
sha512: string;
differentialData: DifferentialDownloadDataType | undefined;
vendor?: JSONVendorSchema;
};

enum DownloadMode {
Expand Down Expand Up @@ -279,7 +283,10 @@ export abstract class Updater {
);
}

await this.installUpdate(updateFilePath, this.canRunSilently());
await this.installUpdate(
updateFilePath,
!updateInfo.vendor?.requireUserConfirmation && this.canRunSilently()
);

const mainWindow = this.getMainWindow();
if (mainWindow) {
Expand Down Expand Up @@ -499,6 +506,7 @@ export abstract class Updater {
version,
sha512,
differentialData,
vendor,
};
}

Expand Down

0 comments on commit 581464c

Please sign in to comment.