Skip to content

Modern macOS App Icon Not Supported #1047

@AeonSake

Description

@AeonSake

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions