[auto update] Added AppImage support
This commit is contained in:
parent
54f13f7da5
commit
08856f0ad2
1 changed files with 16 additions and 16 deletions
|
@ -12,7 +12,7 @@ import * as mm from 'music-metadata';
|
||||||
import fetch from 'electron-fetch'
|
import fetch from 'electron-fetch'
|
||||||
import {wsapi} from "./wsapi";
|
import {wsapi} from "./wsapi";
|
||||||
import {jsonc} from "jsonc";
|
import {jsonc} from "jsonc";
|
||||||
import {NsisUpdater} from "electron-updater";
|
import {NsisUpdater, AppImageUpdater} from "electron-updater";
|
||||||
import {utils} from './utils'
|
import {utils} from './utils'
|
||||||
|
|
||||||
export class BrowserWindow {
|
export class BrowserWindow {
|
||||||
|
@ -41,13 +41,11 @@ export class BrowserWindow {
|
||||||
minHeight: 390,
|
minHeight: 390,
|
||||||
frame: false,
|
frame: false,
|
||||||
title: "Cider",
|
title: "Cider",
|
||||||
vibrancy: "fullscreen-ui",
|
vibrancy: "dark",
|
||||||
transparent: process.platform === "darwin",
|
transparent: process.platform === "darwin",
|
||||||
hasShadow: false,
|
hasShadow: false,
|
||||||
show: false,
|
show: false,
|
||||||
backgroundColor: "#1E1E1E",
|
backgroundColor: "#1E1E1E",
|
||||||
titleBarStyle: 'customButtonsOnHover',
|
|
||||||
trafficLightPosition: { x: 960, y: 20 },
|
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
sandbox: true,
|
sandbox: true,
|
||||||
|
@ -385,13 +383,11 @@ export class BrowserWindow {
|
||||||
return await yt.search(u);
|
return await yt.search(u);
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on("close", (_event, platformCheck) => {
|
ipcMain.on("close", () => {
|
||||||
if (platformCheck && process.platform === "darwin") return
|
|
||||||
BrowserWindow.win.close();
|
BrowserWindow.win.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on("maximize", (_event, platformCheck) => {
|
ipcMain.on("maximize", () => {
|
||||||
if (platformCheck && process.platform === "darwin") return
|
|
||||||
// listen for maximize event
|
// listen for maximize event
|
||||||
if (BrowserWindow.win.isMaximized()) {
|
if (BrowserWindow.win.isMaximized()) {
|
||||||
BrowserWindow.win.unmaximize();
|
BrowserWindow.win.unmaximize();
|
||||||
|
@ -404,8 +400,7 @@ export class BrowserWindow {
|
||||||
BrowserWindow.win.unmaximize();
|
BrowserWindow.win.unmaximize();
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on("minimize", (_event, platformCheck) => {
|
ipcMain.on("minimize", () => {
|
||||||
if (platformCheck && process.platform === "darwin") return
|
|
||||||
// listen for minimize event
|
// listen for minimize event
|
||||||
BrowserWindow.win.minimize();
|
BrowserWindow.win.minimize();
|
||||||
});
|
});
|
||||||
|
@ -441,10 +436,10 @@ export class BrowserWindow {
|
||||||
|
|
||||||
ipcMain.on('play', (_event, type, id) => {
|
ipcMain.on('play', (_event, type, id) => {
|
||||||
BrowserWindow.win.webContents.executeJavaScript(`
|
BrowserWindow.win.webContents.executeJavaScript(`
|
||||||
MusicKit.getInstance().setQueue({ ${type}: '${id}'}).then(function(queue) {
|
MusicKit.getInstance().setQueue({ ${type}: '${id}'}).then(function(queue) {
|
||||||
MusicKit.getInstance().play();
|
MusicKit.getInstance().play();
|
||||||
});
|
});
|
||||||
`)
|
`)
|
||||||
})
|
})
|
||||||
|
|
||||||
//QR Code
|
//QR Code
|
||||||
|
@ -473,8 +468,13 @@ export class BrowserWindow {
|
||||||
provider: 'generic',
|
provider: 'generic',
|
||||||
url: 'https://43-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts' //Base URL
|
url: 'https://43-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts' //Base URL
|
||||||
}
|
}
|
||||||
const autoUpdater = new NsisUpdater(options) //Windows Only (for now) -q
|
/*
|
||||||
await autoUpdater.checkForUpdatesAndNotify()
|
* Have to handle the auto updaters seperatly until we can support macOS. electron-builder limitation -q
|
||||||
|
*/
|
||||||
|
const win_autoUpdater = new NsisUpdater(options) //Windows
|
||||||
|
const linux_autoUpdater = new AppImageUpdater(options) //Linux
|
||||||
|
await win_autoUpdater.checkForUpdatesAndNotify()
|
||||||
|
await linux_autoUpdater.checkForUpdatesAndNotify()
|
||||||
})
|
})
|
||||||
|
|
||||||
/* *********************************************************************************************
|
/* *********************************************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue