title: Unable to override app name on mac os electron menu
body: <p>I'm banging my head against the wall on this one. I'm trying to override the name of a demo electron app to give it a custom name instead of just <code>Electron</code>. I created a module for doing this:</p>
  
  <pre><code>const {app, Menu} = require('electron')
  
  const template = [
      {
          label: 'New Name',
          submenu:[
              {
                  label: 'Test',
                  click: (menuItem, browserWindow, event) =&gt; {
                      console.log('menu item clicked')
                  }
              },
              {role: 'quit'}
          ]
      },
      {
          label: 'test test',
          submenu:[
              {
                  label: 'Test',
                  click: (menuItem, browserWindow, event) =&gt; {
                      console.log('menu item clicked')
                  }
              },
              {role: 'quit'}
          ]
      }
  ]
  
  installApplicationMenu = function (){
      const menu = Menu.buildFromTemplate(template)
      let result = Menu.setApplicationMenu(menu)
  }
  
  
  module.exports = {
      installApplicationMenu
  }
  </code></pre>
  
  <p>And I'm invoking this module after creating my window:</p>
  
  <pre><code>const {app, BrowserWindow} = require('electron')
  const path = require('path')
  const url = require('url')
  
  const {installApplicationMenu} = require('./MenuInstaller')
  
  
  require('electron-reload')(__dirname,{
      electron: path.join(__dirname, 'node_modules', '.bin', 'electron')
  })
  
  let win
  
  
  function createWindow(){
      win = new BrowserWindow({
          width: 800,
          height: 600
      })
  
      win.loadURL(
          url.format({
              pathname: path.join(__dirname, 'index.html'),
              protocol: 'file:',
              slashes: true
          })
      )
  
      win.on('closed', () =&gt; {
          win = null
      })
  
  }
  
  app.on('ready', function (){
      createWindow()
      installApplicationMenu()
  })
  
  
  app.on('activate', () =&gt; {
      if(win === null) createWindow()
  })
  </code></pre>
  
  <p>When I do this the second menu set gets it's custom name of <code>test test</code> but the main menu name is still <code>Electron</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/h2e1O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/h2e1O.png" alt="screenshot of menus not set"></a></p>
  
  <p>I've been comparing the code to a different app I created where I was able to override the default name and I can't spot what's keeping the override from working in this case. </p>
  
  <p>Any ideas?</p>