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

@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(ElectronExecutable)' == ''">
<PropertyGroup Condition="'$(ElectronExecutableName)' == ''">
<WinPrefix>win</WinPrefix>
<ElectronExecutable Condition="'$(RuntimeIdentifier.StartsWith($(WinPrefix)))' == 'true'">$(Title)</ElectronExecutable>
<ElectronExecutable Condition="'$(RuntimeIdentifier.StartsWith($(WinPrefix)))' != 'true'">$(ElectronPackageId)</ElectronExecutable>
<ElectronExecutableName Condition="'$(RuntimeIdentifier.StartsWith($(WinPrefix)))' == 'true'">$(Title)</ElectronExecutableName>
<ElectronExecutableName Condition="'$(RuntimeIdentifier.StartsWith($(WinPrefix)))' != 'true'">$(ElectronPackageId)</ElectronExecutableName>
</PropertyGroup>
<PropertyGroup>
<!-- The binary Electron.NET launches. It only differs from the packaged executable in advanced
scenarios, e.g. when a build hook adds a launcher stub to the package. -->
<ElectronExecutable Condition="'$(ElectronExecutable)' == ''">$(ElectronExecutableName)</ElectronExecutable>
</PropertyGroup>
<PropertyGroup>

View File

@@ -633,6 +633,7 @@ For more information, see: https://github.com/ElectronNET/Electron.NET/wiki/Migr
app\package.json instead. -->
<ItemGroup>
<DevTemplateProperty Include="ElectronPackageId" Value="$(ElectronPackageId)" />
<DevTemplateProperty Include="ElectronExecutableName" Value="$(ElectronExecutableName)" />
<DevTemplateProperty Include="Title" Value="$(Title)" />
<DevTemplateProperty Include="Version" Value="$(Version)" />
</ItemGroup>

View File

@@ -553,6 +553,12 @@
Category="General">
</StringProperty>
<StringProperty Name="ElectronExecutableName"
DisplayName="Executable Name"
Description="Name of the executable inside the package, without extension. Defaults to the title on Windows and to the package id on Linux and macOS"
Category="General">
</StringProperty>
<StringProperty Name="ElectronRootDir"
DisplayName="Electron Root Directory"
Description="Location of the Electron binary relative to the .NET application directory of a packaged app. Default: ../.. (the .NET app lives in resources/bin)"

View File

@@ -4,11 +4,17 @@
"private": true,
"build": {
"appId": "$(ElectronPackageId)",
"win": {
"executableName": "$(ElectronExecutableName)"
},
"mac": {
"executableName": "$(ElectronExecutableName)"
},
"linux": {
"desktop": {
"entry": { "Name": "$(Title)" }
},
"executableName": "$(ElectronPackageId)"
"executableName": "$(ElectronExecutableName)"
},
"deb": {
"desktop": {