How to customize the icon and name of the exe file generated by electron forge

By default, the executable file (exe file on windows) generated by electron forge has a default icon. It also has the same name as the name property of package.json.

You can update the packagerConfig section of electron forge's configuration file to customize the icon and the name.

Example configuration

Here's an example of forge.config.js:

module.exports = {
  packagerConfig: {
    name: 'my-app',
    icon: 'dev.ico'
  },
  rebuildConfig: {},
  makers: [
    {
      name: '@electron-forge/maker-zip',
      config: {},
    },
  ],
};

In the config file above, we customized the name and icon. The icon property can be an absolute file path or a relative file path.

Posted on 2023-05-04