build: platform specific builds (#480)
* build: upgrade electron-builder and updater * build: pack or publish managed by ENV * fix typo * ci: appveyor y64 build * style: fix indent in release.js * build: upgrade package version * build: upgrade node-hid => 0.5.7 * build: upgrade node-hid => 0.5.7 * build: setup new release script * build: setup new release script
This commit is contained in:
committed by
László Monda
parent
bcf9607ae3
commit
053352467d
192
packages/uhk-agent/package-lock.json
generated
192
packages/uhk-agent/package-lock.json
generated
@@ -149,14 +149,6 @@
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
|
||||
"integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA=="
|
||||
},
|
||||
"bluebird-lst": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.4.tgz",
|
||||
"integrity": "sha512-474to7YS06k8NWob/sas0hlr/NYPAoM5JQJ6HRmIpKBOndinO+VuS0Fad29NUsP0mc7xMwfcUuA91Cx2MFr6iA==",
|
||||
"requires": {
|
||||
"bluebird": "3.5.1"
|
||||
}
|
||||
},
|
||||
"boom": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
|
||||
@@ -174,26 +166,6 @@
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"builder-util-runtime": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-1.0.7.tgz",
|
||||
"integrity": "sha512-xU3CYkMz2RnMTu9/KFIc3WrI5G2ysOguUoOk9LgOltfAFvlcFd03SL5bPEEycOykmCwYtTf3zt2keC+eoSQBSQ==",
|
||||
"requires": {
|
||||
"bluebird-lst": "1.0.4",
|
||||
"debug": "3.1.0",
|
||||
"fs-extra-p": "4.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"builtin-modules": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
|
||||
@@ -427,12 +399,20 @@
|
||||
}
|
||||
},
|
||||
"electron": {
|
||||
"version": "1.7.8",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-1.7.8.tgz",
|
||||
"integrity": "sha1-J7eRpolRcafVKZG5lELNvRCjU50=",
|
||||
"version": "1.7.9",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-1.7.9.tgz",
|
||||
"integrity": "sha1-rdVOn4+D7QL2UZ7BATX2mLGTNs8=",
|
||||
"requires": {
|
||||
"@types/node": "7.0.46",
|
||||
"electron-download": "3.3.0",
|
||||
"extract-zip": "1.6.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "7.0.46",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.46.tgz",
|
||||
"integrity": "sha512-u+JAi1KtmaUoU/EHJkxoiuvzyo91FCE41Z9TZWWcOUU3P8oUdlDLdrGzCGWySPgbRMD17B0B+1aaJLYI9egQ6A=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"electron-download": {
|
||||
@@ -517,26 +497,92 @@
|
||||
}
|
||||
},
|
||||
"electron-updater": {
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-2.10.1.tgz",
|
||||
"integrity": "sha512-4KmnpyfJwu/SDXUlSvznXZBJcbPAg+cicOEbzta1YyXBaj7M+ZWih2n1QAT9CmLXU2k3k1nOYM2hOyegVoAI4A==",
|
||||
"version": "2.15.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-2.15.0.tgz",
|
||||
"integrity": "sha512-xHGUPJav7EOKrEs/Tdlv6HFhtzkDfemLKew+S4iIjXyGPuV8hg7bFnbrHdOXid1iQF6ZE2QiNa1iT1Or2gnZsQ==",
|
||||
"requires": {
|
||||
"bluebird-lst": "1.0.4",
|
||||
"builder-util-runtime": "1.0.7",
|
||||
"bluebird-lst": "1.0.5",
|
||||
"builder-util-runtime": "2.4.0",
|
||||
"electron-is-dev": "0.3.0",
|
||||
"fs-extra-p": "4.4.3",
|
||||
"fs-extra-p": "4.4.4",
|
||||
"js-yaml": "3.10.0",
|
||||
"lazy-val": "1.0.2",
|
||||
"lodash.isequal": "4.5.0",
|
||||
"semver": "5.4.1",
|
||||
"source-map-support": "0.4.18",
|
||||
"xelement": "1.0.16"
|
||||
"source-map-support": "0.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"bluebird-lst": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.5.tgz",
|
||||
"integrity": "sha512-Ey0bDNys5qpYPhZ/oQ9vOEvD0TYQDTILMXWP2iGfvMg7rSDde+oV4aQQgqRH+CvBFNz2BSDQnPGMUl6LKBUUQA==",
|
||||
"requires": {
|
||||
"bluebird": "3.5.1"
|
||||
}
|
||||
},
|
||||
"builder-util-runtime": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-2.4.0.tgz",
|
||||
"integrity": "sha512-35PskRowZnDnqJ6zbGSZ+ijndHPan2l56tF9n+FHMNmZnSQ69aw5eXWQDxyMlKKVwt/lF6dFGWhyRtsBmtDL7g==",
|
||||
"requires": {
|
||||
"bluebird-lst": "1.0.5",
|
||||
"debug": "3.1.0",
|
||||
"fs-extra-p": "4.4.4",
|
||||
"sax": "1.2.4"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"electron-is-dev": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-0.3.0.tgz",
|
||||
"integrity": "sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4="
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz",
|
||||
"integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=",
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11",
|
||||
"jsonfile": "4.0.0",
|
||||
"universalify": "0.1.1"
|
||||
}
|
||||
},
|
||||
"fs-extra-p": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-4.4.4.tgz",
|
||||
"integrity": "sha512-zHsMNJWhXD184QfHKEIFSQSgAFNV7v9J+Nt2XpaLZp2nTz6WxZNV+R4G2uYeGeLTMaKvUZiqGKrH/4iFCupcUA==",
|
||||
"requires": {
|
||||
"bluebird-lst": "1.0.5",
|
||||
"fs-extra": "4.0.2"
|
||||
}
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.0.tgz",
|
||||
"integrity": "sha512-vUoN3I7fHQe0R/SJLKRdKYuEdRGogsviXFkHHo17AWaTGv17VLnxw+CFXvqy+y4ORZ3doWLQcxRYfwKrsd/H7Q==",
|
||||
"requires": {
|
||||
"source-map": "0.6.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -657,35 +703,6 @@
|
||||
"rimraf": "2.6.2"
|
||||
}
|
||||
},
|
||||
"fs-extra-p": {
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-4.4.3.tgz",
|
||||
"integrity": "sha512-psGAU9xdCs2xTPHxPCWN6XIE7THN3ajbWb9GE4dctHqM+Kwcvvr0JFZAgy5U31ARui1yBNZfhqFdTUXdX1B9hg==",
|
||||
"requires": {
|
||||
"bluebird-lst": "1.0.4",
|
||||
"fs-extra": "4.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz",
|
||||
"integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=",
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11",
|
||||
"jsonfile": "4.0.0",
|
||||
"universalify": "0.1.1"
|
||||
}
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
@@ -1770,6 +1787,10 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"bundled": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
@@ -1779,10 +1800,6 @@
|
||||
"strip-ansi": "3.0.1"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"bundled": true
|
||||
},
|
||||
"stringstream": {
|
||||
"version": "0.0.5",
|
||||
"bundled": true
|
||||
@@ -2272,19 +2289,6 @@
|
||||
"hoek": "4.2.0"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.4.18",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz",
|
||||
"integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==",
|
||||
"requires": {
|
||||
"source-map": "0.5.7"
|
||||
}
|
||||
},
|
||||
"spawn-rx": {
|
||||
"version": "2.0.12",
|
||||
"resolved": "https://registry.npmjs.org/spawn-rx/-/spawn-rx-2.0.12.tgz",
|
||||
@@ -2338,6 +2342,11 @@
|
||||
"tweetnacl": "0.14.5"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
||||
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
@@ -2348,11 +2357,6 @@
|
||||
"strip-ansi": "3.0.1"
|
||||
}
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
||||
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
|
||||
},
|
||||
"stringstream": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
|
||||
@@ -2550,14 +2554,6 @@
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"xelement": {
|
||||
"version": "1.0.16",
|
||||
"resolved": "https://registry.npmjs.org/xelement/-/xelement-1.0.16.tgz",
|
||||
"integrity": "sha1-kAu0bCD8Lf+t/3eKnS3DZpnQ/34=",
|
||||
"requires": {
|
||||
"sax": "1.2.4"
|
||||
}
|
||||
},
|
||||
"xtend": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz",
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"command-line-args": "4.0.7",
|
||||
"electron": "1.7.8",
|
||||
"electron": "1.7.9",
|
||||
"electron-is-dev": "0.1.2",
|
||||
"electron-log": "2.2.9",
|
||||
"electron-rebuild": "1.6.0",
|
||||
"electron-settings": "3.1.2",
|
||||
"electron-updater": "2.10.1",
|
||||
"electron-updater": "2.15.0",
|
||||
"node-hid": "0.5.4",
|
||||
"sudo-prompt": "7.0.0",
|
||||
"uhk-usb": "1.0.0"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { ipcMain, BrowserWindow } from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
import { VersionInfo, ProgressInfo } from 'builder-util-runtime';
|
||||
import { UpdateInfo, ProgressInfo } from 'builder-util-runtime';
|
||||
import * as settings from 'electron-settings';
|
||||
import * as isDev from 'electron-is-dev';
|
||||
import * as storage from 'electron-settings';
|
||||
|
||||
import { IpcEvents, LogService } from 'uhk-common';
|
||||
import { MainServiceBase } from './main-service-base';
|
||||
@@ -14,7 +15,7 @@ export class AppUpdateService extends MainServiceBase {
|
||||
super(logService, win);
|
||||
|
||||
this.initListeners();
|
||||
logService.info('AppUpdateService init success');
|
||||
logService.info('[AppUpdateService] init success');
|
||||
}
|
||||
|
||||
saveFirtsRun() {
|
||||
@@ -26,16 +27,17 @@ export class AppUpdateService extends MainServiceBase {
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.checkingForUpdate);
|
||||
});
|
||||
|
||||
autoUpdater.on('update-available', (ev: any, info: VersionInfo) => {
|
||||
autoUpdater.downloadUpdate();
|
||||
autoUpdater.on('update-available', async (ev: any, info: UpdateInfo) => {
|
||||
await autoUpdater.downloadUpdate();
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.updateAvailable, info);
|
||||
});
|
||||
|
||||
autoUpdater.on('update-not-available', (ev: any, info: VersionInfo) => {
|
||||
autoUpdater.on('update-not-available', (ev: any, info: UpdateInfo) => {
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.updateNotAvailable, info);
|
||||
});
|
||||
|
||||
autoUpdater.on('error', (ev: any, err: string) => {
|
||||
console.error('[AppUpdateService] error', err);
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateError, err.substr(0, 100));
|
||||
});
|
||||
|
||||
@@ -43,11 +45,14 @@ export class AppUpdateService extends MainServiceBase {
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateDownloadProgress, progressObj);
|
||||
});
|
||||
|
||||
autoUpdater.on('update-downloaded', (ev: any, info: VersionInfo) => {
|
||||
autoUpdater.on('update-downloaded', (ev: any, info: UpdateInfo) => {
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateDownloaded, info);
|
||||
});
|
||||
|
||||
ipcMain.on(IpcEvents.autoUpdater.updateAndRestart, () => autoUpdater.quitAndInstall(true));
|
||||
ipcMain.on(IpcEvents.autoUpdater.updateAndRestart, () => {
|
||||
this.logService.debug('[AppUpdateService] update and restart from renderer process');
|
||||
return autoUpdater.quitAndInstall(true);
|
||||
});
|
||||
|
||||
ipcMain.on(IpcEvents.app.appStarted, () => {
|
||||
if (this.checkForUpdateAtStartup()) {
|
||||
@@ -55,26 +60,35 @@ export class AppUpdateService extends MainServiceBase {
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on(IpcEvents.autoUpdater.checkForUpdate, () => this.checkForUpdate());
|
||||
ipcMain.on(IpcEvents.autoUpdater.checkForUpdate, () => {
|
||||
this.logService.debug('[AppUpdateService] checkForUpdate request from renderer process');
|
||||
this.checkForUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
private checkForUpdate() {
|
||||
if (isDev) {
|
||||
const msg = 'Application update is not working in dev mode.';
|
||||
const msg = '[AppUpdateService] Application update is not working in dev mode.';
|
||||
this.logService.info(msg);
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.checkForUpdateNotAvailable, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isFirstRun()) {
|
||||
const msg = 'Application update is skipping at first run.';
|
||||
const msg = '[AppUpdateService] Application update is skipping at first run.';
|
||||
this.logService.info(msg);
|
||||
this.sendIpcToWindow(IpcEvents.autoUpdater.checkForUpdateNotAvailable, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
autoUpdater.allowPrerelease = this.allowPreRelease();
|
||||
autoUpdater.checkForUpdates();
|
||||
autoUpdater.checkForUpdates()
|
||||
.then(() => {
|
||||
this.logService.debug('[AppUpdateService] checkForUpdate success');
|
||||
})
|
||||
.catch(error => {
|
||||
this.logService.error('[AppUpdateService] checkForUpdate error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
private isFirstRun() {
|
||||
@@ -96,14 +110,20 @@ export class AppUpdateService extends MainServiceBase {
|
||||
|
||||
private checkForUpdateAtStartup() {
|
||||
const autoUpdateSettings = this.getAutoUpdateSettings();
|
||||
const checkForUpdate = autoUpdateSettings && autoUpdateSettings.checkForUpdateOnStartUp;
|
||||
|
||||
return autoUpdateSettings && autoUpdateSettings.checkForUpdateOnStartUp;
|
||||
this.logService.debug('[AppUpdateService] check for update at startup:', {checkForUpdate, autoUpdateSettings});
|
||||
|
||||
return checkForUpdate;
|
||||
}
|
||||
|
||||
private getAutoUpdateSettings() {
|
||||
// const storageService = new ElectronDataStorageRepositoryService();
|
||||
// return storageService.getAutoUpdateSettings();
|
||||
return { checkForUpdateOnStartUp: false, usePreReleaseUpdate: false };
|
||||
const value = storage.get('auto-update-settings');
|
||||
if (!value) {
|
||||
return {checkForUpdateOnStartUp: false, usePreReleaseUpdate: false};
|
||||
}
|
||||
|
||||
return JSON.parse(<string>value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user