Why is $(ElectronPackageId) mapped to different electron builder items or am I confused how this works #1046

Open
opened 2026-01-29 16:56:33 +00:00 by claunia · 2 comments
Owner

Originally created by @markatosi on GitHub (Jan 2, 2026).

  • Version: 4.0
  • Target: .net 10.0.1

ElectronPackageId seems to be mapped to: (according to the wiki) multiple items from electron builder config that should be separate values. I may be confused on this point though but this is what the wiki implies.

This is problematic. For instance Apple wants the appId value to conform to
com.companyname.appname

{
  "name": "$(ElectronPackageId)", <== HERE
  "productName": "$(ElectronTitle)",
  "build": {
    "appId": "$(ElectronPackageId)", <== HERE
    "linux": {
      "desktop": {
        "entry": { "Name": "$(Title)" }
      },
      "executableName": "$(ElectronPackageId)" <== HERE
    },
    "deb": {
      "desktop": {
        "entry": { "Name": "$(Title)" }
      }
    }
  },
  "description": "$(Description)",
  "version": "$(Version)",
  "main": "main.js",
  "author": {
    "name": "$(Company)"
  },
  "license": "$(License)",
  "executable": "$(TargetName)",
  "singleInstance": "$(ElectronSingleInstance)",
  "homepage": "$(ProjectUrl)",
  "splashscreen": {
    "imageFile": "$(ElectronSplashScreen)"
  }
}
Originally created by @markatosi on GitHub (Jan 2, 2026). <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 4.0 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> <!-- What target are you building for? --> * **Target**: .net 10.0.1 <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> ElectronPackageId seems to be mapped to: (according to the wiki) multiple items from electron builder config that should be separate values. I may be confused on this point though but this is what the wiki implies. This is problematic. For instance Apple wants the appId value to conform to com.companyname.appname ``` { "name": "$(ElectronPackageId)", <== HERE "productName": "$(ElectronTitle)", "build": { "appId": "$(ElectronPackageId)", <== HERE "linux": { "desktop": { "entry": { "Name": "$(Title)" } }, "executableName": "$(ElectronPackageId)" <== HERE }, "deb": { "desktop": { "entry": { "Name": "$(Title)" } } } }, "description": "$(Description)", "version": "$(Version)", "main": "main.js", "author": { "name": "$(Company)" }, "license": "$(License)", "executable": "$(TargetName)", "singleInstance": "$(ElectronSingleInstance)", "homepage": "$(ProjectUrl)", "splashscreen": { "imageFile": "$(ElectronSplashScreen)" } } ```
claunia added the question label 2026-01-29 16:56:33 +00:00
Author
Owner

@softworkz commented on GitHub (Jan 9, 2026):

The only value that is being hard-set here is "name".

The others are only defaults, they are set here because they should have a reasonable and consistent value (by default), especially since electron-builder uses a different executable name on Linux than on other platforms, but for dotnet-first app launch, we need a consistent executable name (unless someone takes control of it explicitly).

So, why "only defaults"? Because the JSON value of "build" is the electron-builder config and what you have in electron-builder.json should get merged over this, allowing you to override those values there.

@softworkz commented on GitHub (Jan 9, 2026): The only value that is being hard-set here is "name". The others are only defaults, they are set here because they should have a reasonable and consistent value (by default), especially since electron-builder uses a different executable name on Linux than on other platforms, but for dotnet-first app launch, we need a consistent executable name (unless someone takes control of it explicitly). So, why "only defaults"? Because the JSON value of "build" is the electron-builder config and what you have in `electron-builder.json` should get merged over this, allowing you to override those values there.
Author
Owner

@markatosi commented on GitHub (Jan 9, 2026):

Cool, thanks for the clarification

@markatosi commented on GitHub (Jan 9, 2026): Cool, thanks for the clarification
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1046