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:
Róbert Kiss
2017-10-29 00:52:09 +02:00
committed by László Monda
parent bcf9607ae3
commit 053352467d
17 changed files with 1508 additions and 2033 deletions

View File

@@ -12,12 +12,15 @@ cache:
matrix: matrix:
fast_finish: true fast_finish: true
platform:
- x64
build: off build: off
shallow_clone: true shallow_clone: true
install: install:
- ps: Install-Product node $env:nodejs_version - ps: Install-Product node $env:nodejs_version $env:platform
- npm i -g npm@latest - npm i -g npm@latest
- choco install chromium - choco install chromium
- set CI=true - set CI=true

943
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "uhk-agent", "name": "uhk-agent",
"author": "Ultimate Gadget Laboratories", "author": "Ultimate Gadget Laboratories",
"main": "electron/dist/electron-main.js", "main": "electron/dist/electron-main.js",
"version": "1.0.1", "version": "1.1.0",
"description": "Agent is the configuration application of the Ultimate Hacking Keyboard.", "description": "Agent is the configuration application of the Ultimate Hacking Keyboard.",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -27,7 +27,7 @@
"cross-env": "5.0.5", "cross-env": "5.0.5",
"devtron": "1.4.0", "devtron": "1.4.0",
"electron": "1.7.5", "electron": "1.7.5",
"electron-builder": "19.34.2", "electron-builder": "19.42.2",
"electron-debug": "1.4.0", "electron-debug": "1.4.0",
"electron-devtools-installer": "2.2.0", "electron-devtools-installer": "2.2.0",
"electron-log": "2.2.9", "electron-log": "2.2.9",

View File

@@ -149,14 +149,6 @@
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
"integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" "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": { "boom": {
"version": "4.3.1", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
@@ -174,26 +166,6 @@
"concat-map": "0.0.1" "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": { "builtin-modules": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
@@ -427,12 +399,20 @@
} }
}, },
"electron": { "electron": {
"version": "1.7.8", "version": "1.7.9",
"resolved": "https://registry.npmjs.org/electron/-/electron-1.7.8.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-1.7.9.tgz",
"integrity": "sha1-J7eRpolRcafVKZG5lELNvRCjU50=", "integrity": "sha1-rdVOn4+D7QL2UZ7BATX2mLGTNs8=",
"requires": { "requires": {
"@types/node": "7.0.46",
"electron-download": "3.3.0", "electron-download": "3.3.0",
"extract-zip": "1.6.5" "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": { "electron-download": {
@@ -517,26 +497,92 @@
} }
}, },
"electron-updater": { "electron-updater": {
"version": "2.10.1", "version": "2.15.0",
"resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-2.10.1.tgz", "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-2.15.0.tgz",
"integrity": "sha512-4KmnpyfJwu/SDXUlSvznXZBJcbPAg+cicOEbzta1YyXBaj7M+ZWih2n1QAT9CmLXU2k3k1nOYM2hOyegVoAI4A==", "integrity": "sha512-xHGUPJav7EOKrEs/Tdlv6HFhtzkDfemLKew+S4iIjXyGPuV8hg7bFnbrHdOXid1iQF6ZE2QiNa1iT1Or2gnZsQ==",
"requires": { "requires": {
"bluebird-lst": "1.0.4", "bluebird-lst": "1.0.5",
"builder-util-runtime": "1.0.7", "builder-util-runtime": "2.4.0",
"electron-is-dev": "0.3.0", "electron-is-dev": "0.3.0",
"fs-extra-p": "4.4.3", "fs-extra-p": "4.4.4",
"js-yaml": "3.10.0", "js-yaml": "3.10.0",
"lazy-val": "1.0.2", "lazy-val": "1.0.2",
"lodash.isequal": "4.5.0", "lodash.isequal": "4.5.0",
"semver": "5.4.1", "semver": "5.4.1",
"source-map-support": "0.4.18", "source-map-support": "0.5.0"
"xelement": "1.0.16"
}, },
"dependencies": { "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": { "electron-is-dev": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-0.3.0.tgz", "resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-0.3.0.tgz",
"integrity": "sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4=" "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" "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": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "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": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
@@ -1779,10 +1800,6 @@
"strip-ansi": "3.0.1" "strip-ansi": "3.0.1"
} }
}, },
"string_decoder": {
"version": "0.10.31",
"bundled": true
},
"stringstream": { "stringstream": {
"version": "0.0.5", "version": "0.0.5",
"bundled": true "bundled": true
@@ -2272,19 +2289,6 @@
"hoek": "4.2.0" "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": { "spawn-rx": {
"version": "2.0.12", "version": "2.0.12",
"resolved": "https://registry.npmjs.org/spawn-rx/-/spawn-rx-2.0.12.tgz", "resolved": "https://registry.npmjs.org/spawn-rx/-/spawn-rx-2.0.12.tgz",
@@ -2338,6 +2342,11 @@
"tweetnacl": "0.14.5" "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": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@@ -2348,11 +2357,6 @@
"strip-ansi": "3.0.1" "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": { "stringstream": {
"version": "0.0.5", "version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "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", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" "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": { "xtend": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz",

View File

@@ -15,12 +15,12 @@
}, },
"dependencies": { "dependencies": {
"command-line-args": "4.0.7", "command-line-args": "4.0.7",
"electron": "1.7.8", "electron": "1.7.9",
"electron-is-dev": "0.1.2", "electron-is-dev": "0.1.2",
"electron-log": "2.2.9", "electron-log": "2.2.9",
"electron-rebuild": "1.6.0", "electron-rebuild": "1.6.0",
"electron-settings": "3.1.2", "electron-settings": "3.1.2",
"electron-updater": "2.10.1", "electron-updater": "2.15.0",
"node-hid": "0.5.4", "node-hid": "0.5.4",
"sudo-prompt": "7.0.0", "sudo-prompt": "7.0.0",
"uhk-usb": "1.0.0" "uhk-usb": "1.0.0"

View File

@@ -1,8 +1,9 @@
import { ipcMain, BrowserWindow } from 'electron'; import { ipcMain, BrowserWindow } from 'electron';
import { autoUpdater } from 'electron-updater'; 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 settings from 'electron-settings';
import * as isDev from 'electron-is-dev'; import * as isDev from 'electron-is-dev';
import * as storage from 'electron-settings';
import { IpcEvents, LogService } from 'uhk-common'; import { IpcEvents, LogService } from 'uhk-common';
import { MainServiceBase } from './main-service-base'; import { MainServiceBase } from './main-service-base';
@@ -14,7 +15,7 @@ export class AppUpdateService extends MainServiceBase {
super(logService, win); super(logService, win);
this.initListeners(); this.initListeners();
logService.info('AppUpdateService init success'); logService.info('[AppUpdateService] init success');
} }
saveFirtsRun() { saveFirtsRun() {
@@ -26,16 +27,17 @@ export class AppUpdateService extends MainServiceBase {
this.sendIpcToWindow(IpcEvents.autoUpdater.checkingForUpdate); this.sendIpcToWindow(IpcEvents.autoUpdater.checkingForUpdate);
}); });
autoUpdater.on('update-available', (ev: any, info: VersionInfo) => { autoUpdater.on('update-available', async (ev: any, info: UpdateInfo) => {
autoUpdater.downloadUpdate(); await autoUpdater.downloadUpdate();
this.sendIpcToWindow(IpcEvents.autoUpdater.updateAvailable, info); 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); this.sendIpcToWindow(IpcEvents.autoUpdater.updateNotAvailable, info);
}); });
autoUpdater.on('error', (ev: any, err: string) => { autoUpdater.on('error', (ev: any, err: string) => {
console.error('[AppUpdateService] error', err);
this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateError, err.substr(0, 100)); this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateError, err.substr(0, 100));
}); });
@@ -43,11 +45,14 @@ export class AppUpdateService extends MainServiceBase {
this.sendIpcToWindow(IpcEvents.autoUpdater.autoUpdateDownloadProgress, progressObj); 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); 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, () => { ipcMain.on(IpcEvents.app.appStarted, () => {
if (this.checkForUpdateAtStartup()) { 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() { private checkForUpdate() {
if (isDev) { 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.logService.info(msg);
this.sendIpcToWindow(IpcEvents.autoUpdater.checkForUpdateNotAvailable, msg); this.sendIpcToWindow(IpcEvents.autoUpdater.checkForUpdateNotAvailable, msg);
return; return;
} }
if (this.isFirstRun()) { 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.logService.info(msg);
this.sendIpcToWindow(IpcEvents.autoUpdater.checkForUpdateNotAvailable, msg); this.sendIpcToWindow(IpcEvents.autoUpdater.checkForUpdateNotAvailable, msg);
return; return;
} }
autoUpdater.allowPrerelease = this.allowPreRelease(); 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() { private isFirstRun() {
@@ -96,14 +110,20 @@ export class AppUpdateService extends MainServiceBase {
private checkForUpdateAtStartup() { private checkForUpdateAtStartup() {
const autoUpdateSettings = this.getAutoUpdateSettings(); 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() { private getAutoUpdateSettings() {
// const storageService = new ElectronDataStorageRepositoryService(); const value = storage.get('auto-update-settings');
// return storageService.getAutoUpdateSettings(); if (!value) {
return { checkForUpdateOnStartUp: false, usePreReleaseUpdate: false }; return {checkForUpdateOnStartUp: false, usePreReleaseUpdate: false};
}
return JSON.parse(<string>value);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@
"@types/node": "8.0.28" "@types/node": "8.0.28"
}, },
"dependencies": { "dependencies": {
"node-hid": "0.5.4", "node-hid": "0.5.7",
"uhk-common": "1.0.0" "uhk-common": "1.0.0"
} }
} }

View File

@@ -3949,6 +3949,13 @@
} }
} }
}, },
"string_decoder": {
"version": "1.0.1",
"bundled": true,
"requires": {
"safe-buffer": "5.0.1"
}
},
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
@@ -3958,13 +3965,6 @@
"strip-ansi": "3.0.1" "strip-ansi": "3.0.1"
} }
}, },
"string_decoder": {
"version": "1.0.1",
"bundled": true,
"requires": {
"safe-buffer": "5.0.1"
}
},
"stringstream": { "stringstream": {
"version": "0.0.5", "version": "0.0.5",
"bundled": true, "bundled": true,
@@ -6547,6 +6547,10 @@
} }
} }
}, },
"string_decoder": {
"version": "0.10.31",
"bundled": true
},
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
@@ -6556,10 +6560,6 @@
"strip-ansi": "3.0.1" "strip-ansi": "3.0.1"
} }
}, },
"string_decoder": {
"version": "0.10.31",
"bundled": true
},
"stringstream": { "stringstream": {
"version": "0.0.5", "version": "0.0.5",
"bundled": true "bundled": true
@@ -9212,6 +9212,11 @@
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=" "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM="
}, },
"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": { "string-width": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
@@ -9236,11 +9241,6 @@
} }
} }
}, },
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
},
"stringstream": { "stringstream": {
"version": "0.0.5", "version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",

View File

@@ -2,7 +2,7 @@ import { Injectable, NgZone } from '@angular/core';
import { Action, Store } from '@ngrx/store'; import { Action, Store } from '@ngrx/store';
import { IpcEvents } from 'uhk-common'; import { IpcEvents } from 'uhk-common';
import { AppState } from '../store/index'; import { AppState } from '../store';
import { UpdateDownloadedAction, UpdateErrorAction } from '../store/actions/app-update.action'; import { UpdateDownloadedAction, UpdateErrorAction } from '../store/actions/app-update.action';
import { CheckForUpdateFailedAction, CheckForUpdateSuccessAction } from '../store/actions/auto-update-settings'; import { CheckForUpdateFailedAction, CheckForUpdateSuccessAction } from '../store/actions/auto-update-settings';
import { IpcCommonRenderer } from './ipc-common-renderer'; import { IpcCommonRenderer } from './ipc-common-renderer';

View File

@@ -79,13 +79,13 @@ import { AutoUpdateSettings } from './components/auto-update-settings/auto-updat
import { angularNotifierConfig } from './models/angular-notifier-config'; import { angularNotifierConfig } from './models/angular-notifier-config';
import { UndoableNotifierComponent } from './components/undoable-notifier'; import { UndoableNotifierComponent } from './components/undoable-notifier';
import { UhkHeader } from './components/uhk-header/uhk-header'; import { UhkHeader } from './components/uhk-header/uhk-header';
import { UpdateAvailableComponent } from './components/update-available/update-available.component'; import { UpdateAvailableComponent } from './components/update-available';
import { UhkMessageComponent } from './components/uhk-message/uhk-message.component'; import { UhkMessageComponent } from './components/uhk-message';
import { AppRendererService } from './services/app-renderer.service'; import { AppRendererService } from './services/app-renderer.service';
import { AppUpdateRendererService } from './services/app-update-renderer.service'; import { AppUpdateRendererService } from './services/app-update-renderer.service';
import { IpcCommonRenderer } from './services/ipc-common-renderer'; import { IpcCommonRenderer } from './services/ipc-common-renderer';
import { MissingDeviceComponent } from './components/missing-device/missing-device.component'; import { MissingDeviceComponent } from './components/missing-device';
import { PrivilegeCheckerComponent } from './components/privilege-checker/privilege-checker.component'; import { PrivilegeCheckerComponent } from './components/privilege-checker';
import { UhkDeviceConnectedGuard } from './services/uhk-device-connected.guard'; import { UhkDeviceConnectedGuard } from './services/uhk-device-connected.guard';
import { UhkDeviceDisconnectedGuard } from './services/uhk-device-disconnected.guard'; import { UhkDeviceDisconnectedGuard } from './services/uhk-device-disconnected.guard';
import { UhkDeviceUninitializedGuard } from './services/uhk-device-uninitialized.guard'; import { UhkDeviceUninitializedGuard } from './services/uhk-device-uninitialized.guard';

View File

@@ -1,15 +1,15 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Action } from '@ngrx/store'; import { Action } from '@ngrx/store';
import { Actions, Effect, toPayload } from '@ngrx/effects'; import { Actions, Effect } from '@ngrx/effects';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/do'; import 'rxjs/add/operator/do';
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import 'rxjs/add/operator/first'; import 'rxjs/add/operator/first';
import { NotificationType } from 'uhk-common'; import { LogService, NotificationType } from 'uhk-common';
import { ActionTypes } from '../actions/app-update.action'; import { ActionTypes, UpdateErrorAction } from '../actions/app-update.action';
import { ActionTypes as AutoUpdateActionTypes } from '../actions/auto-update-settings'; import { ActionTypes as AutoUpdateActionTypes } from '../actions/auto-update-settings';
import { ShowNotificationAction } from '../actions/app'; import { ShowNotificationAction } from '../actions/app';
import { AppUpdateRendererService } from '../../services/app-update-renderer.service'; import { AppUpdateRendererService } from '../../services/app-update-renderer.service';
@@ -27,12 +27,13 @@ export class AppUpdateEffect {
@Effect({ dispatch: false }) checkForUpdate$: Observable<Action> = this.actions$ @Effect({ dispatch: false }) checkForUpdate$: Observable<Action> = this.actions$
.ofType(AutoUpdateActionTypes.CHECK_FOR_UPDATE_NOW) .ofType(AutoUpdateActionTypes.CHECK_FOR_UPDATE_NOW)
.do(() => { .do(() => {
this.logService.debug('[AppUpdateEffect] call checkForUpdate');
this.appUpdateRendererService.checkForUpdate(); this.appUpdateRendererService.checkForUpdate();
}); });
@Effect() handleError$: Observable<Action> = this.actions$ @Effect() handleError$: Observable<Action> = this.actions$
.ofType(ActionTypes.UPDATE_ERROR) .ofType<UpdateErrorAction>(ActionTypes.UPDATE_ERROR)
.map(toPayload) .map(action => action.payload)
.map((message: string) => { .map((message: string) => {
return new ShowNotificationAction({ return new ShowNotificationAction({
type: NotificationType.Error, type: NotificationType.Error,
@@ -41,7 +42,8 @@ export class AppUpdateEffect {
}); });
constructor(private actions$: Actions, constructor(private actions$: Actions,
private appUpdateRendererService: AppUpdateRendererService) { private appUpdateRendererService: AppUpdateRendererService,
private logService: LogService) {
} }
} }

View File

@@ -4,6 +4,7 @@ import { MacroEffects } from './macro';
import { KeymapEffects } from './keymap'; import { KeymapEffects } from './keymap';
import { UserConfigEffects } from './user-config'; import { UserConfigEffects } from './user-config';
import { ApplicationEffects } from './app'; import { ApplicationEffects } from './app';
import { AppUpdateEffect } from './app-update';
export * from './keymap'; export * from './keymap';
export * from './macro'; export * from './macro';
@@ -13,6 +14,7 @@ export * from './app';
export const effects = [ export const effects = [
ApplicationEffects, ApplicationEffects,
AppUpdateEffect,
UserConfigEffects, UserConfigEffects,
KeymapEffects, KeymapEffects,
MacroEffects, MacroEffects,

View File

@@ -4,8 +4,8 @@ import { LogService } from 'uhk-common';
import { ElectronDataStorageRepositoryService } from './services/electron-datastorage-repository.service'; import { ElectronDataStorageRepositoryService } from './services/electron-datastorage-repository.service';
import { ElectronLogService } from './services/electron-log.service'; import { ElectronLogService } from './services/electron-log.service';
import { ElectronErrorHandlerService } from './services/electron-error-handler.service'; import { ElectronErrorHandlerService } from './services/electron-error-handler.service';
import { routing } from '../app/app.routes'; import { routing } from '../../';
import { MainAppComponent } from '../app/app.component'; import { MainAppComponent } from '../../';
import { IpcUhkRenderer } from './services/ipc-uhk-renderer'; import { IpcUhkRenderer } from './services/ipc-uhk-renderer';
import { IpcCommonRenderer } from '../app/services/ipc-common-renderer'; import { IpcCommonRenderer } from '../app/services/ipc-common-renderer';
import { DataStorageRepositoryService } from '../app/services/datastorage-repository.service'; import { DataStorageRepositoryService } from '../app/services/datastorage-repository.service';

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,7 @@
"dependencies": { "dependencies": {
"chalk": "2.1.0", "chalk": "2.1.0",
"commander": "^2.11.0", "commander": "^2.11.0",
"node-hid": "0.5.4", "node-hid": "0.5.7",
"uhk-common": "1.0.0", "uhk-common": "1.0.0",
"uhk-usb": "1.0.0" "uhk-usb": "1.0.0"
} }

View File

@@ -1,7 +1,8 @@
'use strict'; 'use strict';
const jsonfile = require('jsonfile'); const jsonfile = require('jsonfile');
const TEST_BUILD = process.env.TEST_BUILD; // set true if you would like to test on your local machince const TEST_BUILD = process.env.TEST_BUILD;// set true if you would like to test on your local machine
const DIR = process.env.DIR;
// electron-builder security override. // electron-builder security override.
// Need if wanna create test release build from PR // Need if wanna create test release build from PR
@@ -29,7 +30,7 @@ if (process.env.TRAVIS) {
repoName = process.env.APPVEYOR_REPO_NAME; repoName = process.env.APPVEYOR_REPO_NAME;
} }
console.log({ branchName, pullRequestNr, gitTag, repoName }); console.log({branchName, pullRequestNr, gitTag, repoName});
const isReleaseCommit = TEST_BUILD || branchName === gitTag && repoName === 'UltimateHackingKeyboard/agent'; const isReleaseCommit = TEST_BUILD || branchName === gitTag && repoName === 'UltimateHackingKeyboard/agent';
@@ -56,13 +57,13 @@ let extraResources = [];
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
target = Platform.MAC.createTarget(); target = Platform.MAC.createTarget();
artifactName += '.${ext}'; artifactName += '.${version}.${ext}';
} else if (process.platform === 'win32') { } else if (process.platform === 'win32') {
target = Platform.WINDOWS.createTarget(); target = Platform.WINDOWS.createTarget('nsis', builder.Arch.ia32, builder.Arch.x64);
artifactName += '-${arch}.${ext}'; artifactName += '-${arch}.${ext}';
} else if (process.platform === 'linux') { } else if (process.platform === 'linux') {
target = Platform.LINUX.createTarget(); target = Platform.LINUX.createTarget('AppImage', builder.Arch.ia32, builder.Arch.x64, builder.Arch.armv7l);
artifactName += '.${ext}'; artifactName += '-${arch}.${ext}';
extraResources.push('rules/setup-rules.sh'); extraResources.push('rules/setup-rules.sh');
extraResources.push('rules/50-uhk60.rules'); extraResources.push('rules/50-uhk60.rules');
} else { } else {
@@ -82,7 +83,7 @@ if (TEST_BUILD || gitTag) {
updateVersionNumberIn2rndPackageJson(jsonVersion); updateVersionNumberIn2rndPackageJson(jsonVersion);
builder.build({ builder.build({
dir: TEST_BUILD, dir: DIR,
targets: target, targets: target,
appMetadata: { appMetadata: {
main: 'electron-main.js', main: 'electron-main.js',
@@ -130,10 +131,10 @@ else {
} }
function updateVersionNumberIn2rndPackageJson(version) { function updateVersionNumberIn2rndPackageJson(version) {
const jsonPath = path.join(__dirname,'../packages/uhk-agent/dist/package.json'); const jsonPath = path.join(__dirname, '../packages/uhk-agent/dist/package.json');
const json = require(jsonPath); const json = require(jsonPath);
json.version = version; json.version = version;
jsonfile.writeFileSync(jsonPath, json, {spaces: 2}) jsonfile.writeFileSync(jsonPath, json, {spaces: 2})
} }