Skip to content

Commit d11e35a

Browse files
committed
Add autoupdate feature
1 parent 566f8f8 commit d11e35a

File tree

3 files changed

+66
-2
lines changed

3 files changed

+66
-2
lines changed

Diff for: main.js

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
if (require('electron-squirrel-startup')) return;
12
const { app, BrowserWindow, ipcMain, shell } = require('electron');
23
const path = require('path');
34

5+
// Handle events from windows squirrel installer
6+
if (process.platform === "win32" && handleSquirrelEvent()) {
7+
// squirrel event handled and app will exit in 1000ms, so don't do anything else
8+
return;
9+
}
10+
11+
const { updateElectronApp } = require('update-electron-app')
12+
updateElectronApp()
13+
414
let mainWindow;
515
let upyPackage;
616
const ARDUINO_VID = 0x2341;

Diff for: package-lock.json

+54-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
"electron": "^31.3.1"
3939
},
4040
"dependencies": {
41+
"electron-squirrel-startup": "^1.0.1",
42+
"update-electron-app": "^3.0.0",
4143
"upy-package": "github:arduino/upy-package"
4244
}
4345
}

0 commit comments

Comments
 (0)