-
-
Notifications
You must be signed in to change notification settings - Fork 745
Description
Currently, the ElectronIcon property expects a file path which is then copied with the Copy instruction as a MSBuild task. However, the issue here is that the new/modern macOS app icon format .icon is actually just a folder (similar to how apps are also just folders with the .app extension). This format allows dynamic icons, grouping certain layers within the icon, applying different effects, and have platform-specific switches. The Copy instruction can only copy files, not directories, which causes the build to fail. Electron-builder itself has full support for the modern app icon format (see documentation) which is also the preferred format.
- NuGet Version: 0.4.1
- Electron Version: 41.0.3
- Electron Builder Version: 26.8.1
- Framework: net10.0
- Target: osx-arm64 (specified via publish profile)
- IDE: Visual Studio Code 1.111.0
electron_builder.json (relevant section only):
{
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/refs/heads/master/packages/app-builder-lib/scheme.json",
"mac": {
"files": [ "**/*", "!mac*/*" ],
"target": [ "dir" ],
"icon": "icon.icon"
}
}Project configuration (relevant section only):
<PropertyGroup Label="ElectronNetCommon">
<ElectronIcon>..\assets\icon.icon</ElectronIcon>
</PropertyGroup>Current workaround:
Using the legacy format .icns and normal .png both work (but you lose all the possibilities of the modern format).