Build cross platform desktop apps with JavaScript, HTML, and CSS
|
|
{
"name": "electron-boilerplate",
"version": "1.0.0",
"main": "main.js",
"description": "electron boilerplate for it-economics Conference Day",
"author": "alxlchnr",
"devDependencies": {
"electron": "1.6.14",
"electron-builder": "^19.34.1",
"electron-builder-squirrel-windows": "^19.34.0"
},
"dependencies": {
"electron-log": "^2.2.9",
"electron-updater": "^2.10.1"
},
"build": {
"appId": "your.app.id",
"publish": [
{
"provider": "github",
"owner": "YOUR_USERNAME",
"repo": "YOUR_REPOSITORY"
}
],
"mac": {
"category": "your.app.category.type",
"target": "dmg"
},
"win": {
"target": "squirrel"
}
},
"scripts": {
"postinstall": "install-app-deps",
"start": "electron .",
"build": "build -m -w --x64",
"release": "build -m -w --x64 "
}
}
const {app, BrowserWindow} = require('electron');
const {autoUpdater} = require("electron-updater");
autoUpdater.on('update-downloaded', function () {
autoUpdater.quitAndInstall();
});
app.on('ready', function () {
let win = new BrowserWindow();
win.on('closed', function () {
win = null;
});
win.loadURL(`file://${__dirname}/index.html`);
autoUpdater.checkForUpdates();
});
app.on('window-all-closed', function () {
app.quit();
});