pull/110/head
openbuilds-engineer 2018-07-16 19:24:09 +02:00
rodzic 25e28c98b5
commit 1bae8c6472
3 zmienionych plików z 6 dodań i 28 usunięć

Wyświetl plik

@ -9,7 +9,7 @@ init:
git config --global credential.helper store git config --global credential.helper store
install: install:
- ps: >- - ps: >-
Install-Product node 7 x64 Install-Product node 8 x64
$env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER" Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
build_script: build_script:

Wyświetl plik

@ -11,12 +11,8 @@ var app = express();
var http = require("http").Server(app); var http = require("http").Server(app);
var https = require('https'); var https = require('https');
// var io = require("socket.io")(https);
var ioServer = require('socket.io'); var ioServer = require('socket.io');
var io = new ioServer(); var io = new ioServer();
// var oneIo = io.listen(https);
// var anotherIo = io.listen(https);
var fs = require('fs'); var fs = require('fs');
var path = require("path"); var path = require("path");
@ -40,8 +36,6 @@ const httpserver = http.listen(config.webPort, '0.0.0.0', function() {
io.attach(httpserver); io.attach(httpserver);
io.attach(httpsserver); io.attach(httpsserver);
const grblStrings = require("./grblStrings.js"); const grblStrings = require("./grblStrings.js");
const serialport = require('serialport'); const serialport = require('serialport');
var SerialPort = serialport; var SerialPort = serialport;
@ -64,31 +58,19 @@ var height = 200;
// Electron app // Electron app
const electron = require('electron'); const electron = require('electron');
// Module to control application life.
const electronApp = electron.app; const electronApp = electron.app;
console.log("Local User Data: " + electronApp.getPath('userData')) console.log("Local User Data: " + electronApp.getPath('userData'))
const BrowserWindow = electron.BrowserWindow; const BrowserWindow = electron.BrowserWindow;
const Tray = electron.Tray; const Tray = electron.Tray;
const nativeImage = require('electron').nativeImage const nativeImage = require('electron').nativeImage
const Menu = require('electron').Menu const Menu = require('electron').Menu
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
var appIcon = null, var appIcon = null,
jogWindow = null, jogWindow = null,
mainWindow = null mainWindow = null
//
// const {
// autoUpdater
// } = require("electron-updater");
const autoUpdater = require("electron-updater").autoUpdater const autoUpdater = require("electron-updater").autoUpdater
electronApp.on('ready', function() {
// autoUpdater.checkForUpdates();
});
autoUpdater.on('checking-for-update', () => { autoUpdater.on('checking-for-update', () => {
var string = 'Checking for update...'; var string = 'Checking for update...';
var output = { var output = {
@ -117,6 +99,9 @@ autoUpdater.on('update-available', (ev, info) => {
}) })
autoUpdater.on('update-not-available', (ev, info) => { autoUpdater.on('update-not-available', (ev, info) => {
var string = 'Update not available. Installed version: ' + require('./package').version + " / Available version: " + ev.version + ".\n"; var string = 'Update not available. Installed version: ' + require('./package').version + " / Available version: " + ev.version + ".\n";
if (require('./package').version === ev.version) {
string += "You are already running the latest version!"
}
var output = { var output = {
'command': 'autoupdate', 'command': 'autoupdate',
'response': string 'response': string
@ -172,18 +157,11 @@ autoUpdater.on('update-downloaded', (info) => {
title: "OpenBuilds Machine Driver", title: "OpenBuilds Machine Driver",
content: string content: string
}) })
// autoUpdater.quitAndInstall();
}); });
var uploadsDir = electronApp.getPath('userData') + '/upload/'; var uploadsDir = electronApp.getPath('userData') + '/upload/';
fs.existsSync(uploadsDir) || fs.mkdirSync(uploadsDir) fs.existsSync(uploadsDir) || fs.mkdirSync(uploadsDir)
// fs.mkdir(uploadsDir, err => {
// if (err && err.code != 'EEXIST') throw 'up'
// // already exists
// })
var oldportslist; var oldportslist;
const iconPath = path.join(__dirname, 'app/icon.png'); const iconPath = path.join(__dirname, 'app/icon.png');

Wyświetl plik

@ -7,7 +7,7 @@
"devDependencies": { "devDependencies": {
"copyfiles": "^1.2.0", "copyfiles": "^1.2.0",
"electron": "^1.6.x", "electron": "^1.6.x",
"electron-builder": "^14.5.3", "electron-builder": "^20.22.0",
"ncp": "^2.0.0" "ncp": "^2.0.0"
}, },
"dependencies": { "dependencies": {