mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Separate Product Name and Executable Name #1047
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AeonSake on GitHub (Jan 2, 2026).
Currently, the name of the Electron executable output/artifact is determined by the
Titlefield in the project/publish configuration (fallback toMSBuildProjectName). There is currently also the rather hiddenElectronExecutablefield available for further customization, but that only affects the C# binding name for the Electron executable, not the actual output itself.I would like to propose to make
ElectronExecutablethe actual executable name (fallback toTitleorMSBuildProjectNameif needed/for backwards compatibility) and use theTitleonly for the product name. In theelectron-builderconfiguration, this would mean:Titlemaps toproductName(which I believe it already does right now)ElectronExecutablemaps toexecutableName(which so far usedproductName)This way, we could also (theoretically) clean up any illegal file characters without affecting the application title itself.
@AeonSake commented on GitHub (Jan 2, 2026):
Looking at the
package.jsontemplate, it looks like only Windows and macOS executables may be affected by this. The Linux executable has a manual overwrite specified to useElectronPackageIdinstead. It would still be a good idea to separate the two name types into individual fields rather than using theTitlefor everything.@softworkz commented on GitHub (Jan 2, 2026):
No. The ElectronExecutable does not control the name of the built executable in the packages. It simply follows what electron-builder is doing and there are only rare cases where you want to change it, like for example when you do some custom package manipulations via electron-builder's build hooks, like for example you could add a stub script to the package and want that to be called by Electron.NET instead of the actual electron executable.
In other words: If you change ElectronExecutable to a different value, your app would not launch anymore - unless you put something into the package which has that value as its file name.
That's the reason why it is kind-of hidden.
@softworkz commented on GitHub (Jan 2, 2026):
I know that this all looks somewhat messy, but it's electron-builder doing that and we are just following.
@AeonSake commented on GitHub (Jan 2, 2026):
I know it doesn't control the name right now, but I would like it would do so. As far as I can tell, it's as easy as using the field in the package template instead of leaving it blank as it is right now (electron-builder itself will then fall back to
productName).I really disagree using the
Titlefield as the executable file name. It will include e.g. also whitespace, which you might want to preserve for the product name but not the file name. That's the exact reason why there even is a manual overwrite for Linux in the template (according to the comment).@AeonSake commented on GitHub (Jan 2, 2026):
Electron-builder has explicit configuration settings to change the executable file name, but they are not used by the Electron.NET build pipeline as far as I can tell. Since you can specify the electron-builder configuration (or parts of it) also in the generated
package.jsonfile, setting the executable file name from the template shouldn't be an issue. And since electron-builder will loadpackage.jsonfirst, and merge the separate config file on top, any custom configuration created by users will always win regardless.@softworkz commented on GitHub (Jan 2, 2026):
You're not building and distributing Linux packages, right?
@AeonSake commented on GitHub (Jan 2, 2026):
I've built and maintained several .NET applications for Linux (mainly servers), but never as a Blazor GUI App, no. But that's the main reason I'm using this project in the first place. The dev experience so far has been really great, but the publishing pipeline has been rather frustrating to be perfectly honest. But I'm not sure how that relates to the issue I've proposed. It's literally a setting for the electron-builder itself. Please explain, what the problem with that would be so I can understand it better.