From 1bae8c647292599ccb347d4cb9b0c31842279d59 Mon Sep 17 00:00:00 2001
From: openbuilds-engineer
Date: Mon, 16 Jul 2018 19:24:09 +0200
Subject: [PATCH] upda
---
appveyor.yml | 2 +-
index.js | 30 ++++--------------------------
package.json | 2 +-
3 files changed, 6 insertions(+), 28 deletions(-)
diff --git a/appveyor.yml b/appveyor.yml
index 029d033..6668008 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -9,7 +9,7 @@ init:
git config --global credential.helper store
install:
- ps: >-
- Install-Product node 7 x64
+ Install-Product node 8 x64
$env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
build_script:
diff --git a/index.js b/index.js
index c9413e3..2d4cdcb 100644
--- a/index.js
+++ b/index.js
@@ -11,12 +11,8 @@ var app = express();
var http = require("http").Server(app);
var https = require('https');
-// var io = require("socket.io")(https);
-
var ioServer = require('socket.io');
var io = new ioServer();
-// var oneIo = io.listen(https);
-// var anotherIo = io.listen(https);
var fs = require('fs');
var path = require("path");
@@ -40,8 +36,6 @@ const httpserver = http.listen(config.webPort, '0.0.0.0', function() {
io.attach(httpserver);
io.attach(httpsserver);
-
-
const grblStrings = require("./grblStrings.js");
const serialport = require('serialport');
var SerialPort = serialport;
@@ -64,31 +58,19 @@ var height = 200;
// Electron app
const electron = require('electron');
-// Module to control application life.
const electronApp = electron.app;
-
console.log("Local User Data: " + electronApp.getPath('userData'))
-
const BrowserWindow = electron.BrowserWindow;
const Tray = electron.Tray;
const nativeImage = require('electron').nativeImage
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,
jogWindow = null,
mainWindow = null
-//
-// const {
-// autoUpdater
-// } = require("electron-updater");
const autoUpdater = require("electron-updater").autoUpdater
-electronApp.on('ready', function() {
- // autoUpdater.checkForUpdates();
-});
-
autoUpdater.on('checking-for-update', () => {
var string = 'Checking for update...';
var output = {
@@ -117,6 +99,9 @@ autoUpdater.on('update-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";
+ if (require('./package').version === ev.version) {
+ string += "You are already running the latest version!"
+ }
var output = {
'command': 'autoupdate',
'response': string
@@ -172,18 +157,11 @@ autoUpdater.on('update-downloaded', (info) => {
title: "OpenBuilds Machine Driver",
content: string
})
- // autoUpdater.quitAndInstall();
});
var uploadsDir = electronApp.getPath('userData') + '/upload/';
fs.existsSync(uploadsDir) || fs.mkdirSync(uploadsDir)
-// fs.mkdir(uploadsDir, err => {
-// if (err && err.code != 'EEXIST') throw 'up'
-// // already exists
-// })
-
-
var oldportslist;
const iconPath = path.join(__dirname, 'app/icon.png');
diff --git a/package.json b/package.json
index db98b7c..327d18a 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"devDependencies": {
"copyfiles": "^1.2.0",
"electron": "^1.6.x",
- "electron-builder": "^14.5.3",
+ "electron-builder": "^20.22.0",
"ncp": "^2.0.0"
},
"dependencies": {