I am using the 2-package.json structure and am trying to set the app name to a friendly name for my app so app.getName()
will return it instead of "Electron". I've tried setting it in several places, but no matter what I do, when I run npm run dev
, app.getName()
always returns Electron
. Where should productName be in the package.json file(s) to override the app name properly? On mac, I want the first menu item to be my app's name instead of "Electron".
I've tried in the root of ./package.json
:
{
"name": "myapp",
"productName": "My App"
}
and in the build
object:
"build": {
"productName": "My App"
}
I've tried in ./app/package.json
:
{
"name": "myapp",
"productName": "My App"
}
Thanks
After reading this section, it seems like I have to modify the Info.plist
file, but I don't see a way to do that. I see Info.plist
in node_modules/electron/dist/Electron.app/Contents/Info.plist
, but I don't know how to modify that from my code or if I can override it somehow.
Disregard - when I run npm run dev
it displays "Electron" as the first menu item, but when I build the mac .app
it correctly displays my app name.
Is there any way to get 'run dev' to display the right app name?
Most helpful comment
Disregard - when I run
npm run dev
it displays "Electron" as the first menu item, but when I build the mac.app
it correctly displays my app name.