const electron = require('electron'); const path = require('path'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { mainWindow = new BrowserWindow({width: 600, height: 475, icon: path.resolve(__dirname, 'images/icon.png')}); mainWindow.loadURL(`file://${__dirname}/index.html`); mainWindow.on('closed', function () { mainWindow = null; }); } app.on('ready', createWindow); app.on('window-all-closed', function () { if (process.platform !== 'darwin') { app.quit(); } }); app.on('activate', function () { if (mainWindow === null) { createWindow(); } });