The electron will not read the application name

I use: node 5.1.1, Chromium 49.0.2623.75 and Electron 0.37.2.

My package.json both the name and productName parameters productName . And there are null syntax errors.

If I run the application, Electron will launch it by default, and the application is called "Electron" (I see it in the first OSX menu item, and if I call app.getName() // returns "Electron"

If I set app.setName('correct name') then it will work from that point. But in the default menu and the application name for the OS, "Electron" will always be displayed.

Electron manuals do not mention a single case where the name package.json / productName will not be used. Whether there is a? the values ​​i have are just ascii strings.

I also tried to check the relay of electronic performance, and there the application is also called "Electron". I noticed that only name was set in package.json, so I also add productName to the same disappointing result.

+5
source share
1 answer

I assume that you use electron-prebuild also because the prebuild application (located on your /node_modules/electron-prebuild/dist/Electron.app ) has its own name (Electron).

To change the name of the application, you need to rebuild / package the application and it will use the "name" or "product name" from your package.json .

To pack the application, you can use electron-packager here: https://github.com/electron-userland/electron-packager

+5
source

Source: https://habr.com/ru/post/1245453/


All Articles