Skip to content

Commit

Permalink
Prepare auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Nordquist committed Jan 8, 2019
1 parent 2a800dc commit 25cc7ad
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 25 deletions.
7 changes: 5 additions & 2 deletions build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const linux: builder.CliOptions = {
arm64: true,
linux: ['snap', 'AppImage', 'deb', 'pacman'],
projectDir: './build/clean',
publish: 'onTag',
}

const win: builder.CliOptions = {
Expand All @@ -16,6 +17,7 @@ const win: builder.CliOptions = {
arm64: false,
win: ['portable'],
projectDir: './build/clean',
publish: 'onTag',
}

const mac: builder.CliOptions = {
Expand All @@ -25,12 +27,13 @@ const mac: builder.CliOptions = {
arm64: false,
mac: ['dmg'],
projectDir: './build/clean',
publish: 'onTag',
}

async function buildAll() {
// await builder.build(linux)
await builder.build(linux)
await builder.build(mac)
// await builder.build(win)
await builder.build(win)
}

buildAll()
12 changes: 11 additions & 1 deletion electron.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
const { autoUpdater } = require("electron-updater")
const log = require('electron-log');

autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = 'info';
log.info('App starting...');

// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
try {
Expand Down Expand Up @@ -38,7 +45,10 @@ function createWindow () {
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
app.on('ready', () => {
createWindow()
autoUpdater.checkForUpdatesAndNotify()
})

// Quit when all windows are closed.
app.on('window-all-closed', function () {
Expand Down
65 changes: 45 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"test-backend": "cd backend && npm run test && cd ..",
"release": "npm run test && ./release.sh"
},
"repository": {
"type": "git",
"url": "https://github.com/thomasnordquist/MQTT-Explorer.git"
},
"build": {
"appId": "mqtt-explorer",
"mac": {
Expand Down Expand Up @@ -56,8 +60,10 @@
"dependencies": {
"@types/electron": "^1.6.10",
"@types/socket.io": "^2.1.2",
"socket.io": "^2.2.0",
"electron-log": "^2.2.17",
"electron-updater": "^4.0.6",
"mqtt": "^2.18.8",
"sha1": "^1.1.1"
"sha1": "^1.1.1",
"socket.io": "^2.2.0"
}
}

0 comments on commit 25cc7ad

Please sign in to comment.