Compare commits

...

2 Commits

Author SHA1 Message Date
Florian Rappl
b5858a697a Added support for Electron 42+ 2026-06-07 13:22:25 +02:00
Florian Rappl
58b9ad0125 Improved argument forwarding 2026-06-06 21:10:19 +02:00
5 changed files with 34 additions and 5 deletions

View File

@@ -1,4 +1,11 @@
## 0.5.0
# 0.5.1
## ElectronNET.Core
- Fixed slicing of arguments for packaged applications (#1072)
- Added support for Electron 42+ (#1073)
# 0.5.0
## ElectronNET.Core

View File

@@ -133,7 +133,8 @@ if (manifestJsonFile.singleInstance) {
// Collect user supplied command line args (excluding those handled by Electron host itself)
function getForwardedArgs() {
const skipSwitches = new Set(['unpackedelectron', 'unpackeddotnet', 'dotnetpacked']);
return process.argv.slice(2).filter(arg => {
const sliceIndex = app.isPackaged ? 1 : 2;
return process.argv.slice(sliceIndex).filter(arg => {
if (!arg) return false;
// Node/Electron internal or we already process them
if (arg.startsWith('--manifest')) return false;

View File

@@ -46,6 +46,7 @@
<ElectronDirName>.electron</ElectronDirName>
<ElectronSplashScreenFileName Condition="'$(ElectronSplashScreen)' != ''">$([System.IO.Path]::GetFileName($(ElectronSplashScreen)))</ElectronSplashScreenFileName>
<ElectronIconFileName Condition="'$(ElectronIcon)' != ''">$([System.IO.Path]::GetFileName($(ElectronIcon)))</ElectronIconFileName>
<ElectronMajor>$([System.String]::Copy('$(ElectronVersion)').Split('.')[0])</ElectronMajor>
</PropertyGroup>
@@ -363,6 +364,7 @@
<PropertyGroup>
<ElectronOutputPath>$([System.IO.Path]::GetFullPath('$(ElectronOutDir)'))</ElectronOutputPath>
<_NpmCmd>npm install --no-bin-links</_NpmCmd>
<_NpmCmd Condition="$(ElectronMajor) &gt;= 42">npx install-electron</_NpmCmd>
<!-- Add cross-platform parameters when there's a platform mismatch (for remote debugging preparation) -->
<_NpmCmd Condition="'$(_IsPlatformMismatch)' == 'true'">$(_NpmCmd) --os=$(NpmOs) --cpu=$(NpmCpu) --arch=$(NpmCpu) --platform=$(NpmOs)</_NpmCmd>
<_NpmCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpmCmd)'</_NpmCmd>
@@ -376,10 +378,23 @@
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
</Exec>
<!--<Exec Command="powershell -Command &quot;Start-Sleep -Seconds 10&quot;" />-->
<Message Importance="High" Text="Electron setup failed!" Condition="'$(ExecExitCode)' != '0'" />
<PropertyGroup>
<_NpmCmd>npx install-electron</_NpmCmd>
<!-- Add cross-platform parameters when there's a platform mismatch (for remote debugging preparation) -->
<_NpmCmd Condition="'$(_IsPlatformMismatch)' == 'true'">$(_NpmCmd) --os=$(NpmOs) --cpu=$(NpmCpu) --arch=$(NpmCpu) --platform=$(NpmOs)</_NpmCmd>
<_NpmCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpmCmd)'</_NpmCmd>
</PropertyGroup>
<Message Importance="High" Text="Running command: $(_NpmCmd) in folder: $(ElectronOutputPath)" Condition="$(ElectronMajor) &gt;= 42 AND @(_CopiedFiles->Count()) > 0" />
<Exec Command="$(_NpmCmd)" WorkingDirectory="$(ElectronOutputPath)" Timeout="600000" StandardOutputImportance="High" StandardErrorImportance="High" ContinueOnError="false" Condition="$(ElectronMajor) &gt;= 42 AND @(_CopiedFiles->Count()) > 0">
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
</Exec>
<Message Importance="High" Text="Electron installation failed!" Condition="'$(ExecExitCode)' != '0'" />
<!-- Fix up incorrect symlinks created by npm on Windows when targeting macOS -->
<PropertyGroup>
<_ElectronFrameworksDir>$(ElectronOutDir)node_modules\electron\dist\Electron.app\Contents\Frameworks</_ElectronFrameworksDir>

View File

@@ -436,6 +436,7 @@
<EnumValue Name="40.9.3" DisplayName="40.9.3" />
<EnumValue Name="40.10.0" DisplayName="40.10.0" />
<EnumValue Name="40.10.1" DisplayName="40.10.1" />
<EnumValue Name="40.10.2" DisplayName="40.10.2" />
<EnumValue Name="41.0.0" DisplayName="41.0.0" />
<EnumValue Name="41.0.1" DisplayName="41.0.1" />
<EnumValue Name="41.0.2" DisplayName="41.0.2" />
@@ -454,10 +455,15 @@
<EnumValue Name="41.6.0" DisplayName="41.6.0" />
<EnumValue Name="41.6.1" DisplayName="41.6.1" />
<EnumValue Name="41.7.0" DisplayName="41.7.0" />
<EnumValue Name="41.7.1" DisplayName="41.7.1" />
<EnumValue Name="42.0.0" DisplayName="42.0.0" />
<EnumValue Name="42.0.1" DisplayName="42.0.1" />
<EnumValue Name="42.1.0" DisplayName="42.1.0" />
<EnumValue Name="42.2.0" DisplayName="42.2.0" />
<EnumValue Name="42.3.0" DisplayName="42.3.0" />
<EnumValue Name="42.3.1" DisplayName="42.3.1" />
<EnumValue Name="42.3.2" DisplayName="42.3.2" />
<EnumValue Name="42.3.3" DisplayName="42.3.3" />
</EnumProperty>
<EnumProperty Name="ElectronBuilderVersion"

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.5.0</Version>
<Version>0.5.1</Version>
<PackageNamePrefix>ElectronNET.Core</PackageNamePrefix>
<Authors>Gregor Biswanger, Florian Rappl, softworkz</Authors>
<Product>Electron.NET</Product>