electron / electron/forge

Electron App Name & Icon single source of truth / documentation

Open
#3,660 1 comment 21 reactions 0 assignees View on GitHub
documentation
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 17m
Merged PRs (30d)
32

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Electron Forge version

7.4.0

### Electron version

v31.2.1

### Operating system

MacOS 14.2.1 (23C71) / Macbook Air M1 Apple Silicon

### Last known working Electron Forge version

_No response_

### Expected behavior

**Forge Config** file should be the **single source of truth** to configure Electron Forge apps in **dev** and **staging** especially for App Name and Icons

### Actual behavior

My team and I are part of a commercial project, soon to be open sourced, that created Multi Platform apps out of a single JS Codebase. We use Electron under the hood and shifting from `electron-builder` to `forge`.

#### Changing `package.json`, `name` and `productName` fields as well as the `name` field in `packagerConfig` in `forge.config.ts` to the following values:

image
image

## In Dev Mode
Running `npm run start`

### App Name

The App name as seen on the mac is still "Electron"
![image](https://github.com/user-attachments/assets/0de846cb-d3ab-4a2c-94f8-198df19c3aa6)

### Electron Menu
As you can see here the Oval is still "Electron" while the default menu in rectangles is picking up the name from `productName` from `package.json`.
![image](https://github.com/user-attachments/assets/9330fca8-2cde-4412-9b18-09f10435ab0c)

## After MAKE
Running `npm run make`

### App Name
The App Name is packaged correctly like so
image

The Binary is also correct like so
image

So is the App name in the Mac OS Dock
image

The App Name in the Mac Menubar is right but again the default menu picks up from `package.json`
image

## The Problem
1. Can we have consistent behaviour across Dev and Make?
2. Can we have a single source of truth ie the *Forge Config* that sets the App Icon and Name across Menus, Binaries and other OS Level places?
3. If not, can we update the documentation to reflect _when & where_ the App name is set, in the Forge website itself?
4. There is a very similar issue with the App Icon as well. Based on the feedback on this issue, I will post a detailed Issue for that as well.

My Team & I can definitely contribute here, but if someone can just point us in the right direction in terms of the codebase, that would be great!

## Is this a [Core Electron](https://github.com/electron/electron) Issue?
Yes it might be, however one of the reasons why we chose forge over something like *electron-builder* is as per what's given [here, in the Forge Website](https://www.electronforge.io/core-concepts/why-electron-forge#forge-vs.-builder)

> image

Hence, our team understood that there's a strong communication channel in both Core Electron and Forge, maybe even shared maintainers?

### Apologies
Apologies if I've posted this in the wrong Repo, maybe one of the shared core maintainers can guide me on where to post this / how to fix this in the core Electron Repo?

### Steps to reproduce

Run the Forge Init in an empty folder as given in the documentation
image

Make no Changes to Code.

Run to start dev
```asm
npm run start
```

Run to build the binary
```asm
npm run make
```
Then run the binary

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.