auto-update Implemented. win only for now

This commit is contained in:
Quacksire 2022-01-30 21:45:44 -08:00
parent 70f6288546
commit b9d638ee67
4 changed files with 26 additions and 3 deletions

View file

@ -123,6 +123,7 @@
"term.tracks": "tracks", // Assume x amount of tracks. e.g. 50 tracks "term.tracks": "tracks", // Assume x amount of tracks. e.g. 50 tracks
"term.videos": "Videos", "term.videos": "Videos",
"term.menu": "Menu", "term.menu": "Menu",
"term.check": "Check",
// Home // Home
"home.title": "Home", "home.title": "Home",

View file

@ -13,7 +13,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 * as jsonc from "jsonc"; import * as jsonc from "jsonc";
import { NsisUpdater, AppImageUpdater } from "electron-updater";
export class Win { export class Win {
private win: any | undefined = null; private win: any | undefined = null;
private app: any | undefined = null; private app: any | undefined = null;
@ -522,6 +522,15 @@ export class Win {
}) })
}); });
electron.ipcMain.on('check-for-update', async (_event, url) => {
const options = {
provider: 'generic',
url: 'https://43-429851205-gh.circle-artifacts.com/0/%257E/Cider/dist/artifacts' //Base URL
}
const autoUpdater = new NsisUpdater(options) //Windows Only (for now) -q
autoUpdater.checkForUpdatesAndNotify()
})
/* ********************************************************************************************* /* *********************************************************************************************
* Window Events * Window Events
* **********************************************************************************************/ * **********************************************************************************************/

View file

@ -3535,9 +3535,11 @@ const app = new Vue({
closeWindow(){ closeWindow(){
// window.close doesnt call the win "close" event for some reason // window.close doesnt call the win "close" event for some reason
ipcRenderer.send('win-close'); ipcRenderer.send('win-close');
},
checkForUpdate(){
ipcRenderer.send('check-for-update')
} }
} }
}) })
Vue.component('animated-number', { Vue.component('animated-number', {

View file

@ -614,6 +614,17 @@
</select> </select>
</div> </div>
</div> </div>
<div class="md-option-line">
<div class="md-option-segment">
Update Cider
</div>
<div class="md-option-segment md-option-segment_auto">
<button class="md-btn" id="lfmConnect" ref="lfmConnect"
onclick="app.checkForUpdate()">
{{$root.getLz('term.check')}}
</button>
</div>
</div>
</div> </div>
<div style="opacity: 0.5; pointer-events: none"> <div style="opacity: 0.5; pointer-events: none">
<div class="md-option-header"> <div class="md-option-header">