-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (32 loc) · 973 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const { app, BrowserWindow, screen } = require('electron');
const { autoUpdater } = require("electron-updater");
require('electron-reload')(__dirname);
(async () => {
const FOUR_HOURS = 1000 * 60 * 60 * 4;
setInterval(async () => {
try {
await autoUpdater.checkForUpdates();
} catch (error) {
console.log('That did not go well.')
}
}, FOUR_HOURS);
try {
await autoUpdater.checkForUpdates();
} catch (error) {
console.log('That did not go well.')
}
})();
const createWindow = () => {
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
window = new BrowserWindow({
width: width / 1.25,
height: height / 1.25,
webPreferences: {
nodeIntegration: true
}
});
window.loadFile('public/index.html');
}
let window = null;
app.whenReady().then(createWindow)
app.on('window-all-closed', () => app.quit());