Do not verify code signature on windows and only check and prompt for updates on windows
Closes #15
This commit is contained in:
parent
b8afb7a77d
commit
a5394f3acd
@ -78,7 +78,7 @@
|
|||||||
"target": "nsis",
|
"target": "nsis",
|
||||||
"icon": "resources/logo.png",
|
"icon": "resources/logo.png",
|
||||||
"publisherName": "Alice Gaudon",
|
"publisherName": "Alice Gaudon",
|
||||||
"verifyUpdateCodeSignature": "true",
|
"verifyUpdateCodeSignature": "false",
|
||||||
"publish": [
|
"publish": [
|
||||||
{
|
{
|
||||||
"provider": "github",
|
"provider": "github",
|
||||||
|
@ -3,6 +3,7 @@ import Meta from "./Meta";
|
|||||||
import Config from "./Config";
|
import Config from "./Config";
|
||||||
import Updater from "./Updater";
|
import Updater from "./Updater";
|
||||||
import MainWindow from "./windows/MainWindow";
|
import MainWindow from "./windows/MainWindow";
|
||||||
|
import * as os from "os";
|
||||||
|
|
||||||
export default class Application {
|
export default class Application {
|
||||||
private readonly devMode: boolean;
|
private readonly devMode: boolean;
|
||||||
@ -14,7 +15,7 @@ export default class Application {
|
|||||||
constructor(devMode: boolean) {
|
constructor(devMode: boolean) {
|
||||||
this.devMode = devMode;
|
this.devMode = devMode;
|
||||||
this.config = new Config();
|
this.config = new Config();
|
||||||
this.updater = new Updater(this.config);
|
this.updater = new Updater(this.config, this);
|
||||||
this.mainWindow = new MainWindow(this);
|
this.mainWindow = new MainWindow(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,9 +27,11 @@ export default class Application {
|
|||||||
this.setupElectronTweaks();
|
this.setupElectronTweaks();
|
||||||
|
|
||||||
// Check for updates
|
// Check for updates
|
||||||
this.updater.checkAndPromptForUpdates(this.mainWindow.getWindow()).then(() => {
|
if (os.platform() === 'win32') {
|
||||||
console.log('Update check successful.');
|
this.updater.checkAndPromptForUpdates(this.mainWindow.getWindow()).then(() => {
|
||||||
}).catch(console.error);
|
console.log('Update check successful.');
|
||||||
|
}).catch(console.error);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('App started');
|
console.log('App started');
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,16 @@ import {autoUpdater, UpdateInfo} from "electron-updater";
|
|||||||
import {dialog, shell} from "electron";
|
import {dialog, shell} from "electron";
|
||||||
import Config from "./Config";
|
import Config from "./Config";
|
||||||
import BrowserWindow = Electron.BrowserWindow;
|
import BrowserWindow = Electron.BrowserWindow;
|
||||||
|
import Application from "./Application";
|
||||||
|
|
||||||
export default class Updater {
|
export default class Updater {
|
||||||
private readonly config: Config;
|
private readonly config: Config;
|
||||||
|
private readonly application: Application;
|
||||||
private updateInfo?: UpdateInfo;
|
private updateInfo?: UpdateInfo;
|
||||||
|
|
||||||
public constructor(config: Config) {
|
public constructor(config: Config, application: Application) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
this.application = application;
|
||||||
|
|
||||||
// Configure auto updater
|
// Configure auto updater
|
||||||
autoUpdater.autoDownload = false;
|
autoUpdater.autoDownload = false;
|
||||||
@ -42,10 +45,10 @@ export default class Updater {
|
|||||||
|
|
||||||
if (updateInfo && updateInfo.version !== this.config.updateCheckSkip) {
|
if (updateInfo && updateInfo.version !== this.config.updateCheckSkip) {
|
||||||
const input = await dialog.showMessageBox(mainWindow, {
|
const input = await dialog.showMessageBox(mainWindow, {
|
||||||
message: `Version ${updateInfo.version} of tabs is available. Do you wish to download this update?`,
|
message: `Version ${updateInfo.version} of tabs is available. Do you wish to install this update?`,
|
||||||
buttons: [
|
buttons: [
|
||||||
'Cancel',
|
'Cancel',
|
||||||
'Download',
|
'Install',
|
||||||
],
|
],
|
||||||
checkboxChecked: false,
|
checkboxChecked: false,
|
||||||
checkboxLabel: `Don't remind me for this version`,
|
checkboxLabel: `Don't remind me for this version`,
|
||||||
@ -61,7 +64,9 @@ export default class Updater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (input.response === 1) {
|
if (input.response === 1) {
|
||||||
await shell.openExternal(`https://github.com/ArisuOngaku/tabs/releases/download/v${updateInfo.version}/${updateInfo.path}`);
|
await this.application.stop();
|
||||||
|
await autoUpdater.downloadUpdate();
|
||||||
|
autoUpdater.quitAndInstall();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user