This commit is contained in:
Florian Rappl
2026-09-04 14:29:38 +02:00
parent 7cd552a78f
commit 672ff6c40d
6 changed files with 55 additions and 5 deletions

View File

@@ -28,11 +28,35 @@ These are the current default values when you don't make any changes:
<ElectronPackageId>$(MSBuildProjectName.Replace(".", "-").ToLower())</ElectronPackageId>
<ElectronBuilderJson>electron-builder.json</ElectronBuilderJson>
<Title>$(MSBuildProjectName)</Title>
<ElectronExecutableName></ElectronExecutableName>
<ElectronRootDir>../..</ElectronRootDir>
<ElectronSkipExecCommands>false</ElectronSkipExecCommands>
</PropertyGroup>
```
### Product Name and Executable Name
`Title` is the product name of the application. It is used for the window title, the installer, the macOS app bundle and the Linux desktop entry, and it may contain spaces and other characters that are awkward in a file name.
`ElectronExecutableName` controls the name of the executable inside the package (electron-builder's `executableName`). When it is not set, it defaults to the following behavior:
| Target | Default |
| --- | --- |
| Windows | `$(Title)` |
| Linux / macOS | `$(ElectronPackageId)` |
So to ship a product called `My Great App` with a `mygreatapp` binary on every platform:
```xml
<PropertyGroup>
<Title>My Great App</Title>
<ElectronExecutableName>mygreatapp</ElectronExecutableName>
</PropertyGroup>
```
> [!NOTE]
> `ElectronExecutable` is a separate, advanced setting: it is the binary Electron.NET launches when the .NET app starts first. It defaults to `ElectronExecutableName` and only needs to be changed when the package contains a launcher stub (for example added by an electron-builder hook) that should be started instead of the Electron binary.
### Custom Packaging Layout
`ElectronRootDir` tells the .NET app where to find the Electron binary when it is started first (DotNet-First startup of a packaged app). The path is resolved relative to the directory of the .NET executable; absolute paths are used as-is.
@@ -86,11 +110,17 @@ Since electron builder still expects a `package.json` file to exist, ElectronNET
"productName": "$(ElectronTitle)",
"build": {
"appId": "$(ElectronPackageId)",
"win": {
"executableName": "$(ElectronExecutableName)"
},
"mac": {
"executableName": "$(ElectronExecutableName)"
},
"linux": {
"desktop": {
"entry": { "Name": "$(Title)" }
},
"executableName": "$(ElectronPackageId)"
"executableName": "$(ElectronExecutableName)"
},
"deb": {
"desktop": {