From efac384e50e34d2b9366d21ab02913962bc093ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Wei=C3=9F?= Date: Fri, 10 Nov 2017 00:21:41 +0100 Subject: [PATCH 1/3] Trying out different ways to integrate the localization. Put the i18n class into a higher level folder for better overview as it is accessed by both processes main and render --- app/lib/i18n/de-AT.json | 24 ++++++++++++++++++++++++ app/lib/i18n/de-CH.json | 24 ++++++++++++++++++++++++ app/lib/i18n/de-DE.json | 24 ++++++++++++++++++++++++ app/lib/i18n/de.json | 24 ++++++++++++++++++++++++ app/lib/i18n/en-US.json | 24 ++++++++++++++++++++++++ app/{main/src => lib}/i18n/en.json | 7 ++++++- app/{main/src => lib}/i18n/i18n.ts | 12 +++++------- app/main/src/MenuBuilder.ts | 2 +- app/main/src/main.ts | 1 + webpack.config.js | 6 +++++- 10 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 app/lib/i18n/de-AT.json create mode 100644 app/lib/i18n/de-CH.json create mode 100644 app/lib/i18n/de-DE.json create mode 100644 app/lib/i18n/de.json create mode 100644 app/lib/i18n/en-US.json rename app/{main/src => lib}/i18n/en.json (57%) rename app/{main/src => lib}/i18n/i18n.ts (72%) diff --git a/app/lib/i18n/de-AT.json b/app/lib/i18n/de-AT.json new file mode 100644 index 0000000..bcdd74d --- /dev/null +++ b/app/lib/i18n/de-AT.json @@ -0,0 +1,24 @@ +{ + "about": "Über", + "check": "Check", + "check for updates": "Auf Updates überprüfen...", + "checksum match": "Übereinstimmung", + "checksum mismatch": "Die Checksums stimmen nicht überein", + "checksum fail": "Fehler - Hast du versucht einen Ordner hinzuzufügen?", + "choose file": "Datei wählen...", + "copy": "Kopieren", + "cut": "Ausschneiden", + "drop file": "Datei hier ablegen", + "edit": "Bearbeiten", + "help": "Hilfe", + "hide others": "Andere ausblenden", + "hide": "Verstecken", + "learn more": "Erfahre mehr", + "open logs": "Öffne Logs", + "paste": "Einfügen", + "quit": "Beenden", + "unhide": "Alles anzeigen", + "update available": "Update verfügbar", + "update error": "Fehler beim Suchen nach Updates", + "update latest": "Deine Version ist aktuell" +} diff --git a/app/lib/i18n/de-CH.json b/app/lib/i18n/de-CH.json new file mode 100644 index 0000000..bcdd74d --- /dev/null +++ b/app/lib/i18n/de-CH.json @@ -0,0 +1,24 @@ +{ + "about": "Über", + "check": "Check", + "check for updates": "Auf Updates überprüfen...", + "checksum match": "Übereinstimmung", + "checksum mismatch": "Die Checksums stimmen nicht überein", + "checksum fail": "Fehler - Hast du versucht einen Ordner hinzuzufügen?", + "choose file": "Datei wählen...", + "copy": "Kopieren", + "cut": "Ausschneiden", + "drop file": "Datei hier ablegen", + "edit": "Bearbeiten", + "help": "Hilfe", + "hide others": "Andere ausblenden", + "hide": "Verstecken", + "learn more": "Erfahre mehr", + "open logs": "Öffne Logs", + "paste": "Einfügen", + "quit": "Beenden", + "unhide": "Alles anzeigen", + "update available": "Update verfügbar", + "update error": "Fehler beim Suchen nach Updates", + "update latest": "Deine Version ist aktuell" +} diff --git a/app/lib/i18n/de-DE.json b/app/lib/i18n/de-DE.json new file mode 100644 index 0000000..bcdd74d --- /dev/null +++ b/app/lib/i18n/de-DE.json @@ -0,0 +1,24 @@ +{ + "about": "Über", + "check": "Check", + "check for updates": "Auf Updates überprüfen...", + "checksum match": "Übereinstimmung", + "checksum mismatch": "Die Checksums stimmen nicht überein", + "checksum fail": "Fehler - Hast du versucht einen Ordner hinzuzufügen?", + "choose file": "Datei wählen...", + "copy": "Kopieren", + "cut": "Ausschneiden", + "drop file": "Datei hier ablegen", + "edit": "Bearbeiten", + "help": "Hilfe", + "hide others": "Andere ausblenden", + "hide": "Verstecken", + "learn more": "Erfahre mehr", + "open logs": "Öffne Logs", + "paste": "Einfügen", + "quit": "Beenden", + "unhide": "Alles anzeigen", + "update available": "Update verfügbar", + "update error": "Fehler beim Suchen nach Updates", + "update latest": "Deine Version ist aktuell" +} diff --git a/app/lib/i18n/de.json b/app/lib/i18n/de.json new file mode 100644 index 0000000..bcdd74d --- /dev/null +++ b/app/lib/i18n/de.json @@ -0,0 +1,24 @@ +{ + "about": "Über", + "check": "Check", + "check for updates": "Auf Updates überprüfen...", + "checksum match": "Übereinstimmung", + "checksum mismatch": "Die Checksums stimmen nicht überein", + "checksum fail": "Fehler - Hast du versucht einen Ordner hinzuzufügen?", + "choose file": "Datei wählen...", + "copy": "Kopieren", + "cut": "Ausschneiden", + "drop file": "Datei hier ablegen", + "edit": "Bearbeiten", + "help": "Hilfe", + "hide others": "Andere ausblenden", + "hide": "Verstecken", + "learn more": "Erfahre mehr", + "open logs": "Öffne Logs", + "paste": "Einfügen", + "quit": "Beenden", + "unhide": "Alles anzeigen", + "update available": "Update verfügbar", + "update error": "Fehler beim Suchen nach Updates", + "update latest": "Deine Version ist aktuell" +} diff --git a/app/lib/i18n/en-US.json b/app/lib/i18n/en-US.json new file mode 100644 index 0000000..5512046 --- /dev/null +++ b/app/lib/i18n/en-US.json @@ -0,0 +1,24 @@ +{ + "about": "About", + "check": "Check", + "check for updates": "Check for updates...", + "checksum match": "Checksum match", + "checksum mismatch": "Checksum mismatch", + "checksum fail": "Error - Did you try to add a directory ?", + "choose file": "Choose file", + "copy": "Copy", + "cut": "Cut", + "drop file": "Drop your file here", + "edit": "Edit", + "help": "Help", + "hide others": "Hide others", + "hide": "Hide", + "learn more": "Learn more", + "open logs": "Open Logs", + "paste": "Paste", + "quit": "Quit", + "unhide": "Unhide", + "update available": "Update available", + "update error": "Error while checking updates", + "update latest": "You have the latest version" +} diff --git a/app/main/src/i18n/en.json b/app/lib/i18n/en.json similarity index 57% rename from app/main/src/i18n/en.json rename to app/lib/i18n/en.json index f7320c5..74ed274 100644 --- a/app/main/src/i18n/en.json +++ b/app/lib/i18n/en.json @@ -1,6 +1,8 @@ { "about": "About", + "check": "Check", "check for updates": "Check for updates...", + "choose file": "Choose file", "copy": "Copy", "cut": "Cut", "edit": "Edit", @@ -11,5 +13,8 @@ "open logs": "Open Logs", "paste": "Paste", "quit": "Quit", - "unhide": "Unhide" + "unhide": "Unhide", + "update available": "Update available", + "update error": "Error while checking updates", + "update latest": "You have the latest version" } diff --git a/app/main/src/i18n/i18n.ts b/app/lib/i18n/i18n.ts similarity index 72% rename from app/main/src/i18n/i18n.ts rename to app/lib/i18n/i18n.ts index 8135d2d..44610a2 100644 --- a/app/main/src/i18n/i18n.ts +++ b/app/lib/i18n/i18n.ts @@ -1,7 +1,7 @@ import * as electron from 'electron'; +import log from 'electron-log'; import * as fs from 'fs'; import * as path from 'path'; - interface ILanguages { [key: string]: string; } @@ -9,14 +9,12 @@ interface ILanguages { class I18n { private loadedLanguage: ILanguages; - private app = electron.app ? electron.app : electron.remote.app; - - - + private app = electron.app; constructor() { - if (fs.existsSync(path.join(__dirname, this.app.getLocale() + '.json'))) { - this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, this.app.getLocale() + '.json'), 'utf8')); + console.log('I18n constructor'); + if (fs.existsSync(path.join(__dirname, '/' + this.app.getLocale() + '.json'))) { + this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, '/' + this.app.getLocale() + '.json'), 'utf8')); } else { this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, 'en.json'), 'utf8')); } diff --git a/app/main/src/MenuBuilder.ts b/app/main/src/MenuBuilder.ts index d948729..16e677f 100644 --- a/app/main/src/MenuBuilder.ts +++ b/app/main/src/MenuBuilder.ts @@ -3,8 +3,8 @@ import { app, Menu, shell } from 'electron'; import * as fs from 'fs'; import * as path from 'path'; import * as username from 'username'; +import I18n from '../../lib/i18n/i18n'; import AppUpdater from './AppUpdater'; -import I18n from './i18n/i18n'; import IPCHandler from './IPCHandler'; export default class MenuBuilder { diff --git a/app/main/src/main.ts b/app/main/src/main.ts index 5f3a8ca..93e48dc 100644 --- a/app/main/src/main.ts +++ b/app/main/src/main.ts @@ -49,6 +49,7 @@ function createWindow() { ipcHandler = new IPCHandler(mainWindow); appUpdater = new AppUpdater(ipcHandler); ipcHandler.updater = appUpdater; + console.log('main' + app.getLocale()); // Init the touchbar with ipcHandler support to send events to the renderer process mainWindow.setTouchBar(new TouchBarBuilder(ipcHandler).build()); diff --git a/webpack.config.js b/webpack.config.js index a82241c..da728e2 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,6 +12,10 @@ module.exports = function(env) { let rendererConfig = Object.assign({}, config, { watch: env.mode == 'watch' ? true : false, target: 'electron-renderer', + node: { + __dirname: false, + __filename: false + }, entry: './app/renderer/src/entry.tsx', output: { path: __dirname + '/app/renderer/build', @@ -93,7 +97,7 @@ module.exports = function(env) { module: { loaders: [{ test: /.ts$/, loader: 'awesome-typescript-loader' }] }, - plugins: [new CopyWebpackPlugin([{ from: 'app/main/src/i18n/', to: 'app/main/build/' }], { ignore: ['*.ts'] }), new DashboardPlugin()] + plugins: [new CopyWebpackPlugin([{ from: 'app/lib/i18n/', to: 'app/main/build/' }], { ignore: ['*.ts'] }), new DashboardPlugin()] }); return [rendererConfig, mainConfig]; From b4e282e2c6f7531bcbbce870eff9687f84bdd9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Wei=C3=9F?= Date: Fri, 10 Nov 2017 11:04:52 +0100 Subject: [PATCH 2/3] Finalize localization --- .gitignore | 3 +- app/lib/i18n/i18n.ts | 22 +++++++++++---- app/main/src/AppUpdater.ts | 9 ++++-- app/main/src/MenuBuilder.ts | 28 ++++++++++--------- app/main/src/main.ts | 2 +- app/package.json | 5 ++-- app/renderer/index.html | 4 +-- .../src/components/Checksum.component.tsx | 25 ++++++++++------- app/yarn.lock | 4 +++ package.json | 4 +-- webpack.config.js | 8 +++--- 11 files changed, 69 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index 98a5c7d..46803bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Webpack -app/renderer/build -app/main/build +app/build # Logs logs diff --git a/app/lib/i18n/i18n.ts b/app/lib/i18n/i18n.ts index 44610a2..6b56820 100644 --- a/app/lib/i18n/i18n.ts +++ b/app/lib/i18n/i18n.ts @@ -1,6 +1,7 @@ import * as electron from 'electron'; import log from 'electron-log'; import * as fs from 'fs'; +import * as isRenderer from 'is-electron-renderer'; import * as path from 'path'; interface ILanguages { [key: string]: string; @@ -9,15 +10,24 @@ interface ILanguages { class I18n { private loadedLanguage: ILanguages; - private app = electron.app; + private app = electron.app ? electron.app : electron.remote.app; constructor() { - console.log('I18n constructor'); - if (fs.existsSync(path.join(__dirname, '/' + this.app.getLocale() + '.json'))) { - this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, '/' + this.app.getLocale() + '.json'), 'utf8')); + if (isRenderer) { + // we are invoking the i18n from the renderer and need another path + if (fs.existsSync(path.join(__dirname, '../build/' + this.app.getLocale() + '.json'))) { + this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, '../build/' + this.app.getLocale() + '.json'), 'utf8')); + } else { + this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, '../build/' + 'en.json'), 'utf8')); + } } else { - this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, 'en.json'), 'utf8')); + if (fs.existsSync(path.join(__dirname, '/' + this.app.getLocale() + '.json'))) { + this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, '/' + this.app.getLocale() + '.json'), 'utf8')); + } else { + this.loadedLanguage = JSON.parse(fs.readFileSync(path.join(__dirname, 'en.json'), 'utf8')); + } } + } public translate(phrase: string): string { @@ -29,4 +39,4 @@ class I18n { } } -export default new I18n(); +export default I18n; diff --git a/app/main/src/AppUpdater.ts b/app/main/src/AppUpdater.ts index fad84f7..4a1246e 100644 --- a/app/main/src/AppUpdater.ts +++ b/app/main/src/AppUpdater.ts @@ -1,14 +1,17 @@ import { dialog } from 'electron'; import log from 'electron-log'; import { autoUpdater } from 'electron-updater'; +import I18n from '../../lib/i18n/i18n'; import IPCHandler from './IPCHandler'; export default class AppUpdater { private ipcHandler: IPCHandler; + private i18n: I18n; constructor(ipcHandler: IPCHandler) { this.ipcHandler = ipcHandler; + this.i18n = new I18n(); autoUpdater.autoDownload = false; @@ -24,7 +27,7 @@ export default class AppUpdater { autoUpdater.on('error', (error) => { this.ipcHandler.sendToRenderer('update', { error: true, - msg: 'Error while checking updates ' + error, + msg: this.i18n.translate('update error') + ' ' + error, updateAvailable: false, }); }); @@ -32,7 +35,7 @@ export default class AppUpdater { autoUpdater.on('update-available', () => { this.ipcHandler.sendToRenderer('update', { error: false, - msg: 'Update available', + msg: this.i18n.translate('update available'), updateAvailable: true, }); }); @@ -53,7 +56,7 @@ export default class AppUpdater { autoUpdater.on('update-not-available', () => { this.ipcHandler.sendToRenderer('update', { error: false, - msg: 'You have the latest version', + msg: this.i18n.translate('update latest'), updateAvailable: false, }); }); diff --git a/app/main/src/MenuBuilder.ts b/app/main/src/MenuBuilder.ts index 16e677f..995acba 100644 --- a/app/main/src/MenuBuilder.ts +++ b/app/main/src/MenuBuilder.ts @@ -9,10 +9,12 @@ import IPCHandler from './IPCHandler'; export default class MenuBuilder { + private i18n: I18n; private updater: AppUpdater; constructor(updater: AppUpdater) { this.updater = updater; + this.i18n = new I18n(); } /** @@ -25,43 +27,43 @@ export default class MenuBuilder { { label: app.getName(), submenu: [ - { role: 'about', label: I18n.translate('about') }, + { role: 'about', label: this.i18n.translate('about') }, { click: () => { this.updater.checkForUpdate(); }, - label: I18n.translate('check for updates'), + label: this.i18n.translate('check for updates'), }, - { role: 'hide', label: I18n.translate('hide') }, - { role: 'hideothers', label: I18n.translate('hide others') }, - { role: 'unhide', label: I18n.translate('unhide') }, + { role: 'hide', label: this.i18n.translate('hide') }, + { role: 'hideothers', label: this.i18n.translate('hide others') }, + { role: 'unhide', label: this.i18n.translate('unhide') }, { type: 'separator' }, - { role: 'quit', label: I18n.translate('quit') }, + { role: 'quit', label: this.i18n.translate('quit') }, ], }, { - label: I18n.translate('edit'), + label: this.i18n.translate('edit'), submenu: [ { type: 'separator' }, - { role: 'cut', label: I18n.translate('cut') }, - { role: 'copy', label: I18n.translate('copy') }, - { role: 'paste', label: I18n.translate('paste') }, + { role: 'cut', label: this.i18n.translate('cut') }, + { role: 'copy', label: this.i18n.translate('copy') }, + { role: 'paste', label: this.i18n.translate('paste') }, ], }, { - label: I18n.translate('help'), role: 'help', + label: this.i18n.translate('help'), role: 'help', submenu: [ { click: () => { shell.openExternal('https://github.com/alexanderwe/checksum-validator'); }, - label: I18n.translate('learn more'), + label: this.i18n.translate('learn more'), }, { click: () => { shell.openItem(path.join('/Users/', username.sync(), '/Library/logs/checksum-validator/log.log')); }, - label: I18n.translate('open logs'), + label: this.i18n.translate('open logs'), }, ], }, diff --git a/app/main/src/main.ts b/app/main/src/main.ts index 93e48dc..8a39e53 100644 --- a/app/main/src/main.ts +++ b/app/main/src/main.ts @@ -34,7 +34,7 @@ function createWindow() { }); // and load the index.html of the app. - mainWindow.loadURL(`file://${__dirname}/../../renderer/index.html`); + mainWindow.loadURL(`file://${__dirname}/../renderer/index.html`); // Open the DevTools. if (process.env.ELECTRON_DEV) { diff --git a/app/package.json b/app/package.json index 52646a4..3996c60 100644 --- a/app/package.json +++ b/app/package.json @@ -1,14 +1,15 @@ { "name": "checksum-validator", - "version": "0.1.7", + "version": "0.2.0", "description": "Small Electron application to validate checksums.", - "main": "main/build/main.js", + "main": "build/main.js", "author": "Alexander Weiss", "dependencies": { "bulma": "^0.6.0", "classnames": "^2.2.5", "electron-log": "^2.2.10", "electron-updater": "^2.15.0", + "is-electron-renderer": "^2.0.1", "react": "^16.0.0", "react-dom": "^16.0.0", "react-transition-group": "^2.2.1", diff --git a/app/renderer/index.html b/app/renderer/index.html index cd67300..a2bd561 100644 --- a/app/renderer/index.html +++ b/app/renderer/index.html @@ -4,12 +4,12 @@ Checksum Validator - +
- + \ No newline at end of file diff --git a/app/renderer/src/components/Checksum.component.tsx b/app/renderer/src/components/Checksum.component.tsx index 8a3139f..e228260 100644 --- a/app/renderer/src/components/Checksum.component.tsx +++ b/app/renderer/src/components/Checksum.component.tsx @@ -4,6 +4,7 @@ import Transition from 'react-transition-group/Transition'; import Button from './bulma/element/Button.component'; import Icon from './bulma/element/Icon.component'; + import Notification from './bulma/element/Notification.component'; import Form from './bulma/form/Form.component'; import Container from './bulma/layout/Container.component'; @@ -13,6 +14,10 @@ import FadeAndSlideDownTransition from './transition/FadeAndSlideDownTransition. import Tag from './bulma/element/Tag.component'; +import I18n from '../../../lib/i18n/i18n'; + +const i18n: I18n = new I18n(); + interface IUpdateMsg { error: boolean; msg: string; @@ -182,15 +187,15 @@ class ChecksumValidator extends React.Component { this.closeNotification()}> {!this.state.checksumResult ?
- Failed - did you try to compute the checksum of an directory ? -
: this.state.match ? ( -
- Checksum match + {i18n.translate('checksum fail')} +
: this.state.match ? ( +
+ {i18n.translate('checksum match')}
- ) : ( + ) : (
- Checksum mismatch -
+ {i18n.translate('checksum mismatch')} + )}
@@ -199,7 +204,7 @@ class ChecksumValidator extends React.Component {

- Drop your file here + {i18n.translate('drop file')}

@@ -208,7 +213,7 @@ class ChecksumValidator extends React.Component {
- + @@ -226,7 +231,7 @@ class ChecksumValidator extends React.Component {
{this.state.updateMsg ? diff --git a/app/yarn.lock b/app/yarn.lock index e974f61..5e06afd 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -148,6 +148,10 @@ iconv-lite@~0.4.13: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" +is-electron-renderer@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-electron-renderer/-/is-electron-renderer-2.0.1.tgz#a469d056f975697c58c98c6023eb0aa79af895a2" + is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" diff --git a/package.json b/package.json index 18e073b..524d358 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "checksum-validator", - "version": "0.1.7", + "version": "0.2.0", "description": "Small Electron application to validate checksums.", "main": "main.js", "scripts": { @@ -10,7 +10,7 @@ "dist": "build -m --x64 --ia32", "postinstall": "install-app-deps", "release": "build", - "start": "ELECTRON_DEV=1 electron app/main/build/main.js", + "start": "ELECTRON_DEV=1 electron app/build/main.js", "test": "mocha", "tsc:watch": "tsc --watch --p tsconfig.json --declaration --target es5" }, diff --git a/webpack.config.js b/webpack.config.js index da728e2..edb096c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -18,9 +18,9 @@ module.exports = function(env) { }, entry: './app/renderer/src/entry.tsx', output: { - path: __dirname + '/app/renderer/build', + path: __dirname + '/app/build/', publicPath: 'build/', - filename: 'bundle.js' + filename: 'renderer.js' }, resolve: { // Add '.ts' and '.tsx' as resolvable extensions. @@ -89,7 +89,7 @@ module.exports = function(env) { externals: [nodeExternals()], watch: env.mode == 'watch' ? true : false, output: { - filename: './app/main/build/main.js' + filename: './app/build/main.js' }, resolve: { extensions: ['.ts', '.js', '.json'] @@ -97,7 +97,7 @@ module.exports = function(env) { module: { loaders: [{ test: /.ts$/, loader: 'awesome-typescript-loader' }] }, - plugins: [new CopyWebpackPlugin([{ from: 'app/lib/i18n/', to: 'app/main/build/' }], { ignore: ['*.ts'] }), new DashboardPlugin()] + plugins: [new CopyWebpackPlugin([{ from: 'app/lib/i18n/', to: 'app/build/' }], { ignore: ['*.ts'] }), new DashboardPlugin()] }); return [rendererConfig, mainConfig]; From e08a03f2a87a87f6641279f7351e3a3bb2cd6631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Wei=C3=9F?= Date: Fri, 10 Nov 2017 11:27:26 +0100 Subject: [PATCH 3/3] Fix test.ts main.js path --- test/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.ts b/test/test.ts index 984361f..a6778d7 100644 --- a/test/test.ts +++ b/test/test.ts @@ -11,7 +11,7 @@ chai.should(); beforeEach(() => { this.app = new Application({ - args: ['app/main/build/main.js'], + args: ['app/build/main.js'], path: 'node_modules/.bin/electron', });