Switch to installer to enable auto-updates

This commit is contained in:
Geomitron
2020-05-19 21:28:27 -04:00
parent ac22fb286d
commit 5cd488e5ef
8 changed files with 116 additions and 24 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# Private Keys
.env
# compiled output
/dist

View File

@@ -6,19 +6,20 @@
"files": [
"dist/**/*"
],
"publish": {
"provider": "github",
"private": true,
"releaseType": "release"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": true,
"shortcutName": "Bridge"
},
"win": {
"icon": "dist/assets/images/system/icons/win/icon.ico",
"compression": "store",
"target": [
"portable"
]
},
"mac": {
"icon": "dist/assets/images/system/icons/mac/icon.icns",
"compression": "maximum",
"target": [
"dmg"
]
"compression": "store"
},
"linux": {
"compression": "maximum",

83
package-lock.json generated
View File

@@ -2222,6 +2222,14 @@
"@types/node": "*"
}
},
"@types/semver": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.2.0.tgz",
"integrity": "sha512-TbB0A8ACUWZt3Y6bQPstW9QNbhNeebdgLX4T/ZfkrswAfUzRiXrgd9seol+X379Wa589Pu4UEx9Uok0D4RjRCQ==",
"requires": {
"@types/node": "*"
}
},
"@types/source-list-map": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz",
@@ -3138,6 +3146,11 @@
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg=="
},
"atob": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
@@ -6037,6 +6050,61 @@
"lodash.debounce": "^4.0.8"
}
},
"electron-updater": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.3.1.tgz",
"integrity": "sha512-UDC5AHCgeiHJYDYWZG/rsl1vdAFKqI/Lm7whN57LKAk8EfhTewhcEHzheRcncLgikMcQL8gFo1KeX51tf5a5Wg==",
"requires": {
"@types/semver": "^7.1.0",
"builder-util-runtime": "8.7.0",
"fs-extra": "^9.0.0",
"js-yaml": "^3.13.1",
"lazy-val": "^1.0.4",
"lodash.isequal": "^4.5.0",
"semver": "^7.1.3"
},
"dependencies": {
"builder-util-runtime": {
"version": "8.7.0",
"resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.7.0.tgz",
"integrity": "sha512-G1AqqVM2vYTrSFR982c1NNzwXKrGLQjVjaZaWQdn4O6Z3YKjdMDofw88aD9jpyK9ZXkrCxR0tI3Qe9wNbyTlXg==",
"requires": {
"debug": "^4.1.1",
"sax": "^1.2.4"
}
},
"fs-extra": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz",
"integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==",
"requires": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^1.0.0"
}
},
"jsonfile": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz",
"integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==",
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^1.0.0"
}
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
},
"universalify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
"integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug=="
}
}
},
"electron-window-state": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/electron-window-state/-/electron-window-state-5.0.3.tgz",
@@ -6485,8 +6553,7 @@
"esprima": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
},
"esquery": {
"version": "1.0.1",
@@ -10396,7 +10463,6 @@
"version": "3.13.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"dev": true,
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
@@ -10545,8 +10611,7 @@
"lazy-val": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.4.tgz",
"integrity": "sha512-u93kb2fPbIrfzBuLjZE+w+fJbUUMhNDXxNmMfaqNgpfQf1CO5ZSe2LfsnBqVAk7i/2NF48OSoRj+Xe2VT+lE8Q==",
"dev": true
"integrity": "sha512-u93kb2fPbIrfzBuLjZE+w+fJbUUMhNDXxNmMfaqNgpfQf1CO5ZSe2LfsnBqVAk7i/2NF48OSoRj+Xe2VT+lE8Q=="
},
"lazystream": {
"version": "1.0.0",
@@ -10883,6 +10948,11 @@
"resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz",
"integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U="
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"lodash.isobject": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz",
@@ -15297,8 +15367,7 @@
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"schema-utils": {
"version": "2.6.6",

View File

@@ -1,7 +1,7 @@
{
"name": "bridge",
"version": "0.0.0",
"description": "A handy CloneHero library management tool with built in chart searching and downloading.",
"description": "A handy Clone Hero library management tool with built in chart searching and downloading.",
"homepage": "https://github.com/Geomitron/Bridge",
"license": "GPL-3.0",
"author": {
@@ -20,9 +20,9 @@
"lint": "ng lint",
"clean": "rimraf dist release",
"build:windows": "ng build -c production && tsc -p tsconfig.electron.json && electron-builder build --windows",
"build:mac": "ng build -c production && tsc -p tsconfig.electron.json && electron-builder build --mac",
"build:linux": "ng build -c production && tsc -p tsconfig.electron.json && electron-builder build --linux",
"serve:angular": "ng serve"
"serve:angular": "ng serve",
"release": "ng build -c production && tsc -p tsconfig.electron.json && electron-builder build"
},
"dependencies": {
"7zip-bin": "^5.0.3",
@@ -36,7 +36,9 @@
"@angular/router": "~9.1.4",
"cli-color": "^2.0.0",
"comparators": "^3.0.2",
"dotenv": "^8.2.0",
"electron-unhandled": "^3.0.2",
"electron-updater": "^4.3.1",
"electron-window-state": "^5.0.3",
"fomantic-ui": "^2.8.3",
"jquery": "^3.4.1",

View File

@@ -32,7 +32,8 @@
<div *ngIf="settingsService.rateLimitDelay < 30" class="ui warning message">
<i class="exclamation circle icon"></i>
<b>Warning:</b> downloading files from Google with a delay less than about 30 seconds will eventually cause Google to
refuse download requests from this program for a few hours. If you can find a way around this limitation, contact Geo#8488 on discord.
refuse download requests from this program for a few hours. This can be avoided by authenticating with your Google account.
(this will be possible in a future update to Bridge)
</div>
<h3 class="ui header">Theme</h3>

View File

@@ -1,5 +1,22 @@
import { Component, OnInit, ChangeDetectorRef } from '@angular/core'
import { ElectronService } from '../../core/services/electron.service'
// import { autoUpdater, UpdateInfo } from 'electron-updater'
// autoUpdater.autoDownload = false
// autoUpdater.on('error', (err) => {})
// autoUpdater.on('checking-for-update', () => {})
// autoUpdater.on('update-available', (info: UpdateInfo) => {})
// autoUpdater.on('update-not-available', () => {})
// autoUpdater.on('download-progress', (progress) => {
// console.log(progress.bytesPerSecond, progress.percent, progress.transferred, progress.total)
// })
// autoUpdater.on('update-downloaded', (info: UpdateInfo) => {})
// autoUpdater.currentVersion // TODO: display this in the corner or on the about page?
// autoUpdater.logger = null
// autoUpdater.checkForUpdates()
// autoUpdater.downloadUpdate()
// autoUpdater.quitAndInstall(false) // By default; autoUpdater installs a downloaded update on the next program restart
// TODO: check for updates on initialization; show a button indicating a new version can be downloaded
@Component({
selector: 'app-toolbar',

View File

@@ -10,7 +10,7 @@ class DownloadHandler implements IPCEmitHandler<'download'> {
currentDownload: ChartDownload = undefined
retryWaiting: ChartDownload[] = []
handler(data: Download) { // TODO: make sure UI can't add the same versionID more than once
handler(data: Download) {
switch (data.action) {
case 'add': this.addDownload(data); break
case 'retry': this.retryDownload(data); break

View File

@@ -2,6 +2,7 @@ import { app, BrowserWindow, ipcMain } from 'electron'
import * as windowStateKeeper from 'electron-window-state'
import * as path from 'path'
import * as url from 'url'
require('dotenv').config()
require('electron-unhandled')({ showDialog: true })
// IPC Handlers