Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron won't read application name

Tags:

npm

electron

i am using: node 5.1.1, Chromium 49.0.2623.75, and Electron 0.37.2.

My package.json have both name and productName set. And there is zero syntax errors.

If I start the application Electron starts up with it's default menu, and the application is called "Electron" (i can see it on the first menu item on OSX and if i call app.getName() // returns "Electron"

If i set app.setName('correct name') then it will work from that point on. But the default menu and the application name for the OS will always show "Electron".

The Electron manuals doesn't mention any case where package.json's name/productName won't be used. Is there any? the values i have are simply ascii strings.

I also tried to checkout the electron-quick-start repo, and there the application is also called "Electron" there. I noticed it only had name set in package.json, so i also add productName to the same disappointing result.

like image 274
gcb Avatar asked Mar 21 '16 05:03

gcb


Video Answer


1 Answers

I suppose you are using electron-prebuild and because it's a prebuild app (located on your /node_modules/electron-prebuild/dist/Electron.app) has it's own name (Electron).

To change the app name you have to rebuild/package your app and it will use the "name" or "productName" from your package.json.

To package your app you can use electron-packager here: https://github.com/electron-userland/electron-packager

like image 86
Philip Avatar answered Nov 15 '22 08:11

Philip