From 4ce98817a074eb0f3774f37d71f508d68e18ec1f Mon Sep 17 00:00:00 2001
From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com>
Date: Thu, 23 May 2019 09:37:41 +0000
Subject: [PATCH 1/9] Update CONTRIBUTING.md
---
CONTRIBUTING.md | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 51cce87e..9cee8e89 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -9,15 +9,14 @@ Please note we have a working flow, and a code of conduct. Please follow it in a
### Development
-* Master is the latest working version, always.
-* Do not push to Master directly.
-* New features should be developed on branches (or forks), and merged.
-* Bugfixes likewise should be developed in branches.
+* Master is the latest working version.
+* New features and bug fixes should be developed on branches (or forks), and merged into master.
### Releases
-* Once we've merged a few things in and want to make a release, we tag it on master.
+* Once we've merged a few things in and want to make a release, we tag it on master.
* Not every commit on master will get a tag, we'll accumulate a few changes before making a release, unless there's a reason to release straight away.
+* Once we're confident that the tagged release is building and stable, we merge it into the stable branch.
## Code of Conduct
From 8a0320e2c4377e5fd372613662bc7f5dfa23827c Mon Sep 17 00:00:00 2001
From: Joel Collins <2579603-jtc42@users.noreply.gitlab.com>
Date: Fri, 24 May 2019 10:47:25 +0000
Subject: [PATCH 2/9] Update CONTRIBUTING.md
---
CONTRIBUTING.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9cee8e89..42d43a66 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,6 +6,7 @@ email, or any other method with the owners of this repository before making a ch
Please note we have a working flow, and a code of conduct. Please follow it in all your interactions with the project.
## Flow
+
### Development
From e0f7f12c3b233ea70f28d86f17e10e82a202f69d Mon Sep 17 00:00:00 2001
From: Joel Collins
Date: Tue, 28 May 2019 11:58:45 +0100
Subject: [PATCH 3/9] Remove legacy setupEvents
---
app/setupEvents.js | 67 ----------------------------------------------
1 file changed, 67 deletions(-)
delete mode 100644 app/setupEvents.js
diff --git a/app/setupEvents.js b/app/setupEvents.js
deleted file mode 100644
index a47108d1..00000000
--- a/app/setupEvents.js
+++ /dev/null
@@ -1,67 +0,0 @@
-const electron = require('electron')
-const app = electron.app
-
-module.exports = {
- handleSquirrelEvent: function () {
- if (process.argv.length === 1) {
- return false;
- }
-
- const ChildProcess = require('child_process');
- const path = require('path');
-
- const appFolder = path.resolve(process.execPath, '..');
- const rootAtomFolder = path.resolve(appFolder, '..');
- const updateDotExe = path.resolve(path.join(rootAtomFolder, 'Update.exe'));
- const exeName = path.basename(process.execPath);
- const spawn = function (command, args) {
- let spawnedProcess, error;
-
- try {
- spawnedProcess = ChildProcess.spawn(command, args, {
- detached: true
- });
- } catch (error) {}
-
- return spawnedProcess;
- };
-
- const spawnUpdate = function (args) {
- return spawn(updateDotExe, args);
- };
-
- const squirrelEvent = process.argv[1];
- switch (squirrelEvent) {
- case '--squirrel-install':
- case '--squirrel-updated':
- // Optionally do things such as:
- // - Add your .exe to the PATH
- // - Write to the registry for things like file associations and
- // explorer context menus
-
- // Install desktop and start menu shortcuts
- spawnUpdate(['--createShortcut', exeName]);
-
- setTimeout(app.quit, 1000);
- return true;
-
- case '--squirrel-uninstall':
- // Undo anything you did in the --squirrel-install and
- // --squirrel-updated handlers
-
- // Remove desktop and start menu shortcuts
- spawnUpdate(['--removeShortcut', exeName]);
-
- setTimeout(app.quit, 1000);
- return true;
-
- case '--squirrel-obsolete':
- // This is called on the outgoing version of your app before
- // we update to the new version - it's the opposite of
- // --squirrel-updated
-
- app.quit();
- return true;
- }
- }
-}
\ No newline at end of file
From 34cbc6c1ec7c8237684809167d2dd5fcb2ca3c95 Mon Sep 17 00:00:00 2001
From: Joel Collins
Date: Tue, 28 May 2019 11:59:05 +0100
Subject: [PATCH 4/9] Switch to combined builder config
---
app/builder-config-base.yaml | 3 +++
app/builder-config-linux.yaml | 11 -----------
app/builder-config-raspi.yaml | 6 ++++--
app/builder-config-win.yaml | 6 ------
...onfig-dmg.yaml => builder-config-x86_64.yaml} | 16 +++++++++++++++-
5 files changed, 22 insertions(+), 20 deletions(-)
delete mode 100644 app/builder-config-linux.yaml
delete mode 100644 app/builder-config-win.yaml
rename app/{builder-config-dmg.yaml => builder-config-x86_64.yaml} (54%)
diff --git a/app/builder-config-base.yaml b/app/builder-config-base.yaml
index 9c0642e5..d62cf387 100644
--- a/app/builder-config-base.yaml
+++ b/app/builder-config-base.yaml
@@ -4,6 +4,9 @@ directories:
appId: org.openflexure.ev
artifactName: ${name}-${os}-${arch}.${ext}
asar: true
+publish:
+ - provider: generic
+ url: https://gitlab.com
files:
- filter:
- '**/*'
diff --git a/app/builder-config-linux.yaml b/app/builder-config-linux.yaml
deleted file mode 100644
index 37f52c87..00000000
--- a/app/builder-config-linux.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-extends: app/builder-config-base.yaml
-linux:
- target:
- - target: deb
- arch:
- - x64
- icon: app/icons/png/
- category: Science
-deb:
- category: Science
-electronVersion: 4.1.5
diff --git a/app/builder-config-raspi.yaml b/app/builder-config-raspi.yaml
index 217293e2..15c0fe82 100644
--- a/app/builder-config-raspi.yaml
+++ b/app/builder-config-raspi.yaml
@@ -1,12 +1,14 @@
extends: app/builder-config-base.yaml
+electronVersion: 3.0.13
linux:
target:
- target: deb
arch:
- armv7l
+ - target: appImage
+ arch:
+ - armv7l
icon: app/icons/png/
category: Science
deb:
- category: Science
fpm: ['--architecture', 'armhf']
-electronVersion: 3.0.13
diff --git a/app/builder-config-win.yaml b/app/builder-config-win.yaml
deleted file mode 100644
index 9a6b6d37..00000000
--- a/app/builder-config-win.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-extends: app/builder-config-base.yaml
-win:
- target:
- - NSIS
- icon: app/icons/win/icon.ico
-electronVersion: 4.1.5
diff --git a/app/builder-config-dmg.yaml b/app/builder-config-x86_64.yaml
similarity index 54%
rename from app/builder-config-dmg.yaml
rename to app/builder-config-x86_64.yaml
index c2ab40be..406fb7a5 100644
--- a/app/builder-config-dmg.yaml
+++ b/app/builder-config-x86_64.yaml
@@ -1,4 +1,19 @@
extends: app/builder-config-base.yaml
+electronVersion: 4.1.5
+win:
+ target:
+ - NSIS
+ icon: app/icons/win/icon.ico
+linux:
+ target:
+ - target: deb
+ arch:
+ - x64
+ - target: appImage
+ arch:
+ - x64
+ icon: app/icons/png/
+ category: Science
mac:
icon: app/icons/mac/icon.icns
category: public.app-category.utilities
@@ -10,4 +25,3 @@ dmg:
y: 150
type: link
path: /Applications
-electronVersion: 4.1.5
From a4a2ada99b37bda4267cbefa3860d2f8c1894576 Mon Sep 17 00:00:00 2001
From: Joel Collins
Date: Tue, 28 May 2019 11:59:34 +0100
Subject: [PATCH 5/9] Add electron-updater and new build scripts
---
package-lock.json | 66 ++++++++++++++++++++++++++++++-----------------
package.json | 14 +++++-----
2 files changed, 50 insertions(+), 30 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index c3ae37b3..ded0d3f8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1657,7 +1657,6 @@
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
- "dev": true,
"requires": {
"sprintf-js": "~1.0.2"
}
@@ -2071,14 +2070,12 @@
"bluebird": {
"version": "3.5.4",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz",
- "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==",
- "dev": true
+ "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw=="
},
"bluebird-lst": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/bluebird-lst/-/bluebird-lst-1.0.7.tgz",
"integrity": "sha512-5ix04IbXVIZ6nSRM4aZnwQfk40Td0D57WAl8LfhnICF6XwT4efCZYh0veOHvfDmgpbqE4ju5L5XEAMIcAe13Kw==",
- "dev": true,
"requires": {
"bluebird": "^3.5.3"
}
@@ -2347,8 +2344,7 @@
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
- "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
- "dev": true
+ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
},
"buffer-indexof": {
"version": "1.1.1",
@@ -4218,6 +4214,35 @@
"integrity": "sha512-lyoC8aoqbbDqsprb6aPdt9n3DpOZZzdz/T4IZKsR0/dkZIxnJVUjjcpOSwA66jPRIOyDAamCTAUqweU05kKNSg==",
"dev": true
},
+ "electron-updater": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-4.0.6.tgz",
+ "integrity": "sha512-JPGLME6fxJcHG8hX7HWFl6Aew6iVm0DkcrENreKa5SUJCHG+uUaAhxDGDt+YGcNkyx1uJ6eBGMvFxDTLUv67pg==",
+ "requires": {
+ "bluebird-lst": "^1.0.6",
+ "builder-util-runtime": "~8.1.0",
+ "fs-extra-p": "^7.0.0",
+ "js-yaml": "^3.12.0",
+ "lazy-val": "^1.0.3",
+ "lodash.isequal": "^4.5.0",
+ "pako": "^1.0.7",
+ "semver": "^5.6.0",
+ "source-map-support": "^0.5.9"
+ },
+ "dependencies": {
+ "builder-util-runtime": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.1.1.tgz",
+ "integrity": "sha512-+ieS4PMB33vVE2S3ZNWBEQJ1zKmAs/agrBdh7XadE1lKLjrH4aXYuOh9OOGdxqIRldhlhNBaF+yKMMEFOdNVig==",
+ "requires": {
+ "bluebird-lst": "^1.0.6",
+ "debug": "^4.1.1",
+ "fs-extra-p": "^7.0.0",
+ "sax": "^1.2.4"
+ }
+ }
+ }
+ },
"electron-windows-store": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/electron-windows-store/-/electron-windows-store-2.1.0.tgz",
@@ -4376,8 +4401,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=="
},
"esrecurse": {
"version": "4.2.1",
@@ -5003,7 +5027,6 @@
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fs-extra-p/-/fs-extra-p-7.0.1.tgz",
"integrity": "sha512-yhd2OV0HnHt2oitlp+X9hl2ReX4X/7kQeL7/72qzPHTZj5eUPGzAKOvEglU02Fa1OeG2rSy/aKB4WGVaLiF8tw==",
- "dev": true,
"requires": {
"bluebird-lst": "^1.0.7",
"fs-extra": "^7.0.1"
@@ -6726,7 +6749,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"
@@ -6852,8 +6874,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=="
},
"lcid": {
"version": "2.0.0",
@@ -7013,6 +7034,11 @@
"integrity": "sha1-vsECT4WxvZbL6kBbI8FK1kQ6b4E=",
"dev": true
},
+ "lodash.isequal": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
+ "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
+ },
"lodash.kebabcase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz",
@@ -7972,8 +7998,7 @@
"pako": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz",
- "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==",
- "dev": true
+ "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw=="
},
"parallel-transform": {
"version": "1.1.0",
@@ -9672,8 +9697,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": "0.4.7",
@@ -9703,8 +9727,7 @@
"semver": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
- "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
- "dev": true
+ "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
},
"semver-diff": {
"version": "2.1.0",
@@ -10172,7 +10195,6 @@
"version": "0.5.12",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
- "dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
@@ -10181,8 +10203,7 @@
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
}
}
},
@@ -10282,8 +10303,7 @@
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
- "dev": true
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
},
"sshpk": {
"version": "1.16.1",
diff --git a/package.json b/package.json
index 4f335103..8a905f78 100644
--- a/package.json
+++ b/package.json
@@ -11,13 +11,12 @@
"license": "GNU General Public License v3.0 ",
"main": "./app/app.js",
"scripts": {
- "dist:all": "npm run dist:linux && npm run dist:raspi && npm run dist:win",
- "dist:linux": "electron-builder --linux --config app/builder-config-linux.yaml",
+ "release": "electron-builder --linux --config app/builder-config-raspi.yaml & electron-builder --win --linux --config app/builder-config-x86_64.yaml",
+ "dist:linux": "electron-builder --linux --config app/builder-config-x86_64.yaml",
"dist:raspi": "electron-builder --linux --config app/builder-config-raspi.yaml",
- "dist:win": "electron-builder --win --config app/builder-config-win.yaml",
+ "dist:win": "electron-builder --win --config app/builder-config-x86_64.yaml",
+ "dist:dmg": "electron-builder --mac --config app/builder-config-x86_64.yaml",
"dist:appx": "electron-builder --win --config app/builder-config-appx.yaml",
- "dist:dmg": "electron-builder --mac --config app/builder-config-dmg.yaml",
- "release": "npm run build && npm run dist:all",
"build": "vue-cli-service build",
"electron:run": "electron .",
"electron:dev": "electron app/app.dev.js",
@@ -25,7 +24,8 @@
},
"dependencies": {
"about-window": "^1.12.1",
- "electron-context-menu": "^0.11.0"
+ "electron-context-menu": "^0.11.0",
+ "electron-updater": "^4.0.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.3.0",
@@ -54,4 +54,4 @@
"last 2 versions",
"not ie <= 8"
]
-}
\ No newline at end of file
+}
From ad805b91c06987e76aa3443e2f8f2912ccbdc1b3 Mon Sep 17 00:00:00 2001
From: Joel Collins
Date: Tue, 28 May 2019 11:59:46 +0100
Subject: [PATCH 6/9] Add updater to apps
---
app/app.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++------
app/menu.js | 8 ++++++
2 files changed, 71 insertions(+), 7 deletions(-)
diff --git a/app/app.js b/app/app.js
index ed3efe86..bcf07ea0 100644
--- a/app/app.js
+++ b/app/app.js
@@ -1,15 +1,70 @@
-//handle setupevents as quickly as possible
-const setupEvents = require('./setupEvents')
-if (setupEvents.handleSquirrelEvent()) {
- // squirrel event handled and app will exit in 1000ms, so don't do anything else
- return;
-}
-
// Required packages
const electron = require('electron')
+const { dialog } = require('electron')
+const updater = require("electron-updater");
+const autoUpdater = updater.autoUpdater;
const contextMenu = require('electron-context-menu')
const path = require('path')
+// Auto upadater
+autoUpdater.autoDownload = false;
+
+autoUpdater.setFeedURL({
+ provider: "generic",
+ url: "https://gitlab.com/openflexure/openflexure-microscope-jsclient/-/jobs/artifacts/master/raw?job=package"
+});
+
+autoUpdater.on('checking-for-update', function () {
+ sendStatusToWindow('Checking for update...');
+});
+
+autoUpdater.on('update-available', function (info) {
+ sendStatusToWindow('Update available.' + info)
+ dialog.showMessageBox(mainWindow, {
+ type: 'info',
+ title: 'Update available',
+ message: 'A new version of OpenFlexure eV is available.',
+ buttons: ['Download', 'Later']
+ }, (buttonIndex) => {
+ if (buttonIndex === 0) {
+ autoUpdater.downloadUpdate()
+ }
+ })
+});
+
+autoUpdater.on('update-downloaded', function (info) {
+ sendStatusToWindow('Update downloaded.' + info)
+ dialog.showMessageBox(mainWindow, {
+ type: 'info',
+ title: "Update downloaded",
+ message: 'Please restart the application to apply the update.',
+ buttons: ['Update', 'Later']
+ }, (buttonIndex) => {
+ if (buttonIndex === 0) {
+ autoUpdater.quitAndInstall();
+ }
+ })
+});
+
+autoUpdater.on('update-not-available', function (info) {
+ sendStatusToWindow('Update not available.');
+});
+
+autoUpdater.on('error', function (err) {
+ sendStatusToWindow('Error in auto-updater.');
+});
+
+autoUpdater.on('download-progress', function (progressObj) {
+ let log_message = "Download speed: " + progressObj.bytesPerSecond;
+ log_message = log_message + ' - Downloaded ' + parseInt(progressObj.percent) + '%';
+ log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
+ sendStatusToWindow(log_message);
+});
+
+function sendStatusToWindow(message) {
+ console.log(message);
+}
+
// Set up the app
const app = electron.app
const BrowserWindow = electron.BrowserWindow
@@ -36,6 +91,7 @@ function createWindow() {
});
mainWindow.loadURL(url)
+ autoUpdater.checkForUpdates();
// Emitted when the window is closed.
mainWindow.on('closed', function() {
diff --git a/app/menu.js b/app/menu.js
index 21d77b05..950e8f42 100644
--- a/app/menu.js
+++ b/app/menu.js
@@ -1,4 +1,6 @@
const { app, Menu } = require('electron')
+const updater = require("electron-updater");
+const autoUpdater = updater.autoUpdater;
const path = require('path')
const openAboutWindow = require('about-window').default
@@ -47,6 +49,12 @@ const template = [
homepage: "https://gitlab.com/openflexure/openflexure-microscope-jsclient",
})
}
+ },
+ {
+ label: 'Check for Updates',
+ click () {
+ autoUpdater.checkForUpdates();
+ }
}
]
}
From cfb448e8d389bff3850cd5923820dd33fed08d09 Mon Sep 17 00:00:00 2001
From: Joel Collins
Date: Tue, 28 May 2019 12:00:02 +0100
Subject: [PATCH 7/9] Update CI to new updatable builds
---
.gitlab-ci.yml | 58 +++++++++++++-------------------------------------
1 file changed, 15 insertions(+), 43 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3b17564e..1c6c7e3f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,7 +17,7 @@ build:
- npm install
- npm run build
artifacts:
- name: "openflexure-ev-web"
+ name: "build"
paths:
- dist/
only:
@@ -25,56 +25,28 @@ build:
- tags
- web
- # Platform-specific Electron builds
-package:rpi:
+# Platform-specific Electron builds
+package:
stage: package
dependencies:
- build
image: electronuserland/builder:wine
retry: 2
script:
- - npm run dist:raspi
- - mv ./release-builds/openflexure-ev-linux-armv7l.deb .
+ - npm run release
+ - mv ./release-builds/*.AppImage .
+ - mv ./release-builds/*.deb .
+ - mv ./release-builds/*.exe .
+ - mv ./release-builds/*.exe.blockmap .
+ - mv ./release-builds/latest*.yml .
artifacts:
- name: "openflexure-ev-linux-armv7l"
+ name: "dist"
paths:
- - openflexure-ev-linux-armv7l.deb
- only:
- - stable
- - tags
- - web
-
-package:deb:
- stage: package
- dependencies:
- - build
- image: electronuserland/builder:wine
- retry: 2
- script:
- - npm run dist:linux
- - mv ./release-builds/openflexure-ev-linux-amd64.deb .
- artifacts:
- name: "openflexure-ev-linux-amd64"
- paths:
- - openflexure-ev-linux-amd64.deb
- only:
- - stable
- - tags
- - web
-
-package:win32:
- stage: package
- dependencies:
- - build
- image: electronuserland/builder:wine
- retry: 2
- script:
- - npm run dist:win
- - mv ./release-builds/openflexure-ev-win.exe .
- artifacts:
- name: "openflexure-ev-win"
- paths:
- - openflexure-ev-win.exe
+ - "*.AppImage"
+ - "*.deb"
+ - "*.exe"
+ - "*.exe.blockmap"
+ - "latest*.yml"
only:
- stable
- tags
From 63ef0d7af88ec8bb86eb5106a1add2c4e9b178b4 Mon Sep 17 00:00:00 2001
From: Joel Collins
Date: Tue, 28 May 2019 12:02:56 +0100
Subject: [PATCH 8/9] Fixed choco dependency
---
.gitlab-ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1c6c7e3f..6a571865 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -56,7 +56,7 @@ package:
meta:choco:
stage: meta
dependencies:
- - package:win32
+ - package
image: patrickhuber/choco-linux
script:
- chmod +x ./app/make-nupkg.sh
From d65329eafd907f4a05deeb03795ee6eadc5e0b52 Mon Sep 17 00:00:00 2001
From: Joel Collins
Date: Tue, 28 May 2019 12:05:48 +0100
Subject: [PATCH 9/9] Fixed feed URL to stable branch
---
app/app.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/app.js b/app/app.js
index bcf07ea0..d1fe5162 100644
--- a/app/app.js
+++ b/app/app.js
@@ -11,7 +11,7 @@ autoUpdater.autoDownload = false;
autoUpdater.setFeedURL({
provider: "generic",
- url: "https://gitlab.com/openflexure/openflexure-microscope-jsclient/-/jobs/artifacts/master/raw?job=package"
+ url: "https://gitlab.com/openflexure/openflexure-microscope-jsclient/-/jobs/artifacts/stable/raw?job=package"
});
autoUpdater.on('checking-for-update', function () {