Rebranding the application

The Electron prebuilt binary comes with the Electron icon and its own branding. You will need to rebrand the Electron binary after bundling the application into your own brand and theme. This includes changing the executable icon, application metadata, platform registration information for the application, and so on.

You need to use different tools for each platform to rebrand the executable. Also, the steps to edit the executables will be platform specific, and you should follow unique steps for each platform to rebrand the binary-for example, when the application is in an .exe format and you need to use the exe editor like rcedit or any other .exe resource editor tools. You can get more information about rcedit on GitHub repository at https://github.com/electron/rcedit/releasesrcedit is a command-line tool that can be used to edit the resource file inside the .exe files. Let's see how we can use this tool and also about rebranding the Electron application for Mac, Linux, and Windows platforms.

On MacOS, the executable is named as electron.app;  you can simply rename it to whatever name you want to. You also need to rename the CFBundleDisplayNameCFBundleIdentifier, and CFBundleName fields in the following files:

  • Electron.app/Contents/Info.plistElectron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist
  • Electron.app/Contents/Frameworks/Electron Helper.app/Contents/Info.plist

You can also rename the helper app to avoid showing the Electron Helper in the activity monitor. Ensure that you have renamed the helper app's executable filename.

The structure of the renamed app would be like the following on Mac OS:

MyApp.app/Contents
├── Info.plist
├── MacOS/
│ └── MyApp
└── Frameworks/
├── MyApp Helper EH.app
| ├── Info.plist
| └── MacOS/
| └── MyApp Helper EH
├── MyApp Helper NP.app
| ├── Info.plist
| └── MacOS/
| └── MyApp Helper NP
└── MyApp Helper.app
├── Info.plist
└── MacOS/
└── MyApp Helper

On the Linux machine, simply rename the executable of the application and it will reflect everywhere when you run the application. 

For Windows platform, as we discussed you can use rcedit.  The rcedit executable is available at https://github.com/electron/rcedit/releases. You can download the exe file and use it from the command line. Make it available in your PATH or copy the exe into the project. This can be used as a command-line tool, or you can use it with your task runners. The executable icon can be changed using rcedit through the following command:

rcedit "electron.exe" --set-icon "path-to-ico"
The rcedit is an executable file. So that the actual command may have to change according to the command line prompt. For example, if you are using windows command line prompt, you can try either use rcedit command directly or with "./rcedit.exe".  When using PowerShell command prompt or similar command line prompts, change the path notations accordingly.

The icon file should be in the .ico format and provide the exact path information to the file as in the preceding command. In a similar way, the product and file version can be changed using the following command:

rcedit "electron.exe" --set-file-version "10.7"
rcedit "electron.exe" --set-product-version "10.7"
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.255.7