Merge branch 'develop' of https://github.com/ElectronNET/Electron.NET into feature/auth-sample-docs

This commit is contained in:
Florian Rappl
2026-05-25 21:27:52 +02:00
39 changed files with 1028 additions and 169 deletions

View File

@@ -134,4 +134,16 @@ TL;DR: Unless there is a technical reason (e.g., a crucial new API not being ava
We pretty much release whenever we have something new (i.e., do fixes such as a 0.1.1, or add new features, such as a 0.2.0) quite quickly.
We will go for a 1.0.0 release of this as early as ~mid of January 2026 (unless we find some critical things or want to extend the beta phase for ElectronNET.Core). This should be sufficient time to get some user input and have enough experience to call it stable.
We will go for a 1.0.0 release of this as early as ~mid of June 2026 (unless we find some critical things or want to extend the beta phase for ElectronNET.Core). This should be sufficient time to get some user input and have enough experience to call it stable.
## Updating Electron Versions
The releases of Electron are found on the [releases.electronjs.org](https://releases.electronjs.org/release?page=1) website.
You can update the `src\ElectronNET\build\ElectronNETRules.Project.xaml` file with new entries using the following script (run it in the browser's console when being on the Electron Releases website):
```js
[...new Set([...document.querySelectorAll('tbody tr a[href^="/release/v"]')].map(m => m.getAttribute('href').replace('/release/v', '')))].map(m => `<EnumValue Name="${m}" DisplayName="${m}" />`).sort().join('\n')
```
Alternatively, use the website's information to feed into an AI agent of your choice.

View File

@@ -1,6 +1,8 @@
name: Build and Publish
on: [push]
on:
push:
branches: [main, develop]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -4,13 +4,14 @@ on:
workflow_call:
concurrency:
group: integration-tests-${{ github.ref }}
group: integration-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.os }} API-${{ matrix.electronVersion }}
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
@@ -42,13 +43,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Random delay (0-20 seconds)
shell: bash
run: |
DELAY=$((RANDOM % 21))
echo "Waiting for $DELAY seconds..."
sleep $DELAY
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
@@ -79,27 +73,31 @@ jobs:
- name: Run tests (Linux)
if: runner.os == 'Linux'
continue-on-error: true
timeout-minutes: 15
run: |
mkdir -p test-results
xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
-c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} \
--logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" \
--logger "console;verbosity=detailed" \
--blame-hang --blame-hang-timeout 5min \
--results-directory test-results
- name: Run tests (Windows)
if: runner.os == 'Windows'
continue-on-error: true
timeout-minutes: 15
run: |
New-Item -ItemType Directory -Force -Path test-results | Out-Null
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --blame-hang --blame-hang-timeout 5min --results-directory test-results
- name: Run tests (macOS)
if: runner.os == 'macOS'
continue-on-error: true
timeout-minutes: 15
run: |
mkdir -p test-results
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --blame-hang --blame-hang-timeout 5min --results-directory test-results
- name: Upload raw test results
if: always()
@@ -114,6 +112,7 @@ jobs:
runs-on: ubuntu-24.04
if: always()
needs: [tests]
timeout-minutes: 10
permissions:
actions: read

View File

@@ -27,7 +27,7 @@ jobs:
run: |
echo "Inspecting jobs of workflow run $RUN_ID in $REPO"
jobs_json="$(gh api -R $REPO repos/$REPO/actions/runs/$RUN_ID/jobs)"
jobs_json="$(gh api repos/$REPO/actions/runs/$RUN_ID/jobs)"
echo "Jobs and conclusions:"
echo "$jobs_json" | jq '.jobs[] | {name: .name, conclusion: .conclusion}'

View File

@@ -2,7 +2,11 @@
## ElectronNET.Core
- tbd
- Updated internal facade from `SocketIoFacade` to `ISocketConnection` (#1037)
- Fixed `HasShadow` is not `true` by default (#1049) @AeonSake
- Fixed missing `ReadAllLines` in MSBuild execution (#1035)
- Fixed serialization of release notes for the updater (#1041)
- Added automatic port selection and secured IPC communication (#1038)
# 0.4.1

View File

@@ -215,7 +215,8 @@ namespace ElectronNET.API.Entities
/// <summary>
/// Whether window should have a shadow. Default is true.
/// </summary>
public bool HasShadow { get; set; }
[DefaultValue(true)]
public bool HasShadow { get; set; } = true;
/// <summary>
/// Forces using dark theme for the window, only works on some GTK+3 desktop environments. Default is false.

View File

@@ -1,4 +1,8 @@
namespace ElectronNET.API.Entities
using System;
using System.Text.Json.Serialization;
using ElectronNET.API.Converter;
namespace ElectronNET.API.Entities
{
/// <summary>
///
@@ -24,7 +28,8 @@
/// <summary>
/// Gets or sets the release notes.
/// </summary>
public ReleaseNoteInfo[] ReleaseNotes { get; set; } = new ReleaseNoteInfo[0];
[JsonConverter(typeof(ReleaseNotesConverter))]
public ReleaseNoteInfo[] ReleaseNotes { get; set; } = Array.Empty<ReleaseNoteInfo>();
/// <summary>
/// Gets or sets the release date.

View File

@@ -3,10 +3,12 @@
namespace ElectronNET.API;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ElectronNET.API.Serialization;
using SocketIO.Serializer.SystemTextJson;
using SocketIO = SocketIOClient.SocketIO;
using SocketIOOptions = SocketIOClient.SocketIOOptions;
internal class SocketIOConnection : ISocketConnection
{
@@ -14,9 +16,16 @@ internal class SocketIOConnection : ISocketConnection
private readonly object _lockObj = new object();
private bool _isDisposed;
public SocketIOConnection(string uri)
public SocketIOConnection(string uri, string authorization)
{
_socket = new SocketIO(uri);
var opts = string.IsNullOrEmpty(authorization) ? new SocketIOOptions() : new SocketIOOptions
{
ExtraHeaders = new Dictionary<string, string>
{
["authorization"] = authorization
},
};
_socket = new SocketIO(uri, opts);
_socket.Serializer = new SystemTextJsonSerializer(ElectronJson.Options);
// Use default System.Text.Json serializer from SocketIOClient.
// Outgoing args are normalized to camelCase via SerializeArg in Emit.

View File

@@ -26,6 +26,8 @@
private readonly StringBuilder stdOut = new StringBuilder(4 * 1024);
private readonly StringBuilder stdErr = new StringBuilder(4 * 1024);
public event EventHandler<string> LineReceived;
private volatile ManualResetEvent stdOutEvent;
private volatile ManualResetEvent stdErrEvent;
private volatile Stopwatch stopwatch;
@@ -571,6 +573,7 @@
if (e.Data != null)
{
Console.WriteLine("|| " + e.Data);
LineReceived?.Invoke(this, e.Data);
}
else
{

View File

@@ -0,0 +1,91 @@
using ElectronNET.API.Entities;
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace ElectronNET.API.Converter;
/// <summary>
/// Handles the polymorphic shape of releaseNotes coming from electron-builder.
/// Depending on the updater.fullChangelog setting, electron-builder sends:
/// - null → when there are no notes
/// - "some string" → plain string (FullChangelog = false, default)
/// - ["note A", "note B"] → array of strings (after broken normalize in older TS)
/// - [{ version, note }, ...] → array of objects (FullChangelog = true)
/// All forms are normalised to ReleaseNoteInfo[] so the C# model stays clean.
/// See: https://github.com/ElectronNET/Electron.NET/issues/1039
/// </summary>
public class ReleaseNotesConverter : JsonConverter<ReleaseNoteInfo[]>
{
// Ensure the converter is called even when the JSON token is null,
// so we can return an empty array instead of null.
public override bool HandleNull => true;
public override ReleaseNoteInfo[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case JsonTokenType.Null:
return Array.Empty<ReleaseNoteInfo>();
case JsonTokenType.String:
// Plain string: "Some release notes"
return new[] { new ReleaseNoteInfo { Note = reader.GetString() } };
case JsonTokenType.StartArray:
var list = new List<ReleaseNoteInfo>();
while (reader.Read() && reader.TokenType != JsonTokenType.EndArray)
{
if (reader.TokenType == JsonTokenType.String)
{
// Array of strings: ["Note A", "Note B"]
list.Add(new ReleaseNoteInfo { Note = reader.GetString() });
}
else if (reader.TokenType == JsonTokenType.StartObject)
{
// Array of objects: [{ "version": "1.0", "note": "..." }]
var entry = JsonSerializer.Deserialize<ReleaseNoteInfo>(ref reader, options) ?? new ReleaseNoteInfo();
list.Add(entry);
}
else
{
reader.Skip();
}
}
return list.ToArray();
default:
throw new JsonException($"Unexpected token {reader.TokenType} when reading releaseNotes.");
}
}
public override void Write(Utf8JsonWriter writer, ReleaseNoteInfo[] value, JsonSerializerOptions options)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
if (value.Length == 0)
{
writer.WriteStartArray();
writer.WriteEndArray();
return;
}
writer.WriteStartArray();
foreach (var item in value)
{
writer.WriteStartObject();
if (item.Version is not null)
{
writer.WriteString("version", item.Version);
}
writer.WriteString("note", item.Note);
writer.WriteEndObject();
}
writer.WriteEndArray();
}
}

View File

@@ -16,6 +16,7 @@
internal const int DefaultWebPort = 8001;
internal const string ElectronPortArgumentName = "electronPort";
internal const string ElectronPidArgumentName = "electronPID";
internal const string ElectronAuthTokenArgumentName = "electronAuthToken";
/// <summary>Initializes the <see cref="ElectronNetRuntime"/> class.</summary>
static ElectronNetRuntime()
@@ -26,6 +27,8 @@
public static string ElectronExtraArguments { get; set; }
public static string ElectronAuthToken { get; internal set; }
public static int? ElectronSocketPort { get; internal set; }
public static int? AspNetWebPort { get; internal set; }

View File

@@ -13,7 +13,6 @@
{
private ElectronProcessBase electronProcess;
private SocketBridgeService socketBridge;
private int? port;
public RuntimeControllerDotNetFirst()
{
@@ -41,19 +40,13 @@
var isUnPacked = ElectronNetRuntime.StartupMethod.IsUnpackaged();
var electronBinaryName = ElectronNetRuntime.ElectronExecutable;
var args = string.Format("{0} {1}", ElectronNetRuntime.ElectronExtraArguments, Environment.CommandLine).Trim();
this.port = ElectronNetRuntime.ElectronSocketPort;
if (!this.port.HasValue)
{
this.port = PortHelper.GetFreePort(ElectronNetRuntime.DefaultSocketPort);
ElectronNetRuntime.ElectronSocketPort = this.port;
}
var port = ElectronNetRuntime.ElectronSocketPort ?? 0;
Console.Error.WriteLine("[StartCore]: isUnPacked: {0}", isUnPacked);
Console.Error.WriteLine("[StartCore]: electronBinaryName: {0}", electronBinaryName);
Console.Error.WriteLine("[StartCore]: args: {0}", args);
this.electronProcess = new ElectronProcessActive(isUnPacked, electronBinaryName, args, this.port.Value);
this.electronProcess = new ElectronProcessActive(isUnPacked, electronBinaryName, args, port);
this.electronProcess.Ready += this.ElectronProcess_Ready;
this.electronProcess.Stopped += this.ElectronProcess_Stopped;
@@ -63,8 +56,10 @@
private void ElectronProcess_Ready(object sender, EventArgs e)
{
var port = ElectronNetRuntime.ElectronSocketPort.Value;
var token = ElectronNetRuntime.ElectronAuthToken;
this.TransitionState(LifetimeState.Started);
this.socketBridge = new SocketBridgeService(this.port!.Value);
this.socketBridge = new SocketBridgeService(port, token);
this.socketBridge.Ready += this.SocketBridge_Ready;
this.socketBridge.Stopped += this.SocketBridge_Stopped;
this.socketBridge.Start();

View File

@@ -11,7 +11,6 @@
{
private ElectronProcessBase electronProcess;
private SocketBridgeService socketBridge;
private int? port;
public RuntimeControllerElectronFirst()
{
@@ -36,12 +35,8 @@
protected override Task StartCore()
{
this.port = ElectronNetRuntime.ElectronSocketPort;
if (!this.port.HasValue)
{
throw new Exception("No port has been specified by Electron!");
}
var port = ElectronNetRuntime.ElectronSocketPort.Value;
var token = ElectronNetRuntime.ElectronAuthToken;
if (!ElectronNetRuntime.ElectronProcessId.HasValue)
{
@@ -49,7 +44,7 @@
}
this.TransitionState(LifetimeState.Starting);
this.socketBridge = new SocketBridgeService(this.port!.Value);
this.socketBridge = new SocketBridgeService(port, token);
this.socketBridge.Ready += this.SocketBridge_Ready;
this.socketBridge.Stopped += this.SocketBridge_Stopped;
this.socketBridge.Start();

View File

@@ -2,9 +2,12 @@
{
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using ElectronNET.Common;
using ElectronNET.Runtime.Data;
@@ -15,6 +18,8 @@
[Localizable(false)]
internal class ElectronProcessActive : ElectronProcessBase
{
private readonly Regex extractor = new Regex("^Electron Socket: listening on port (\\d+) at .* using ([a-f0-9]+)$");
private readonly bool isUnpackaged;
private readonly string electronBinaryName;
private readonly string extraArguments;
@@ -101,7 +106,6 @@
}
var osPart = buildInfoRid.Split('-').First();
var mismatch = false;
switch (osPart)
@@ -155,20 +159,59 @@
return Task.CompletedTask;
}
private async Task StartInternal(string startCmd, string args, string directoriy)
private async Task StartInternal(string startCmd, string args, string directory)
{
var tcs = new TaskCompletionSource();
using var cts = new CancellationTokenSource(2 * 60_000); // cancel after 2 minutes
using var _ = cts.Token.Register(() =>
{
// Time is over - let's kill the process and move on
this.process.Cancel();
// We don't want to raise exceptions here - just pass the barrier
tcs.TrySetResult();
});
void Read_SocketIO_Parameters(object sender, string line)
{
// Look for "Electron Socket: listening on port %s at ..."
var match = extractor.Match(line);
if (match?.Success ?? false)
{
var port = int.Parse(match.Groups[1].Value);
var token = match.Groups[2].Value;
this.process.LineReceived -= Read_SocketIO_Parameters;
ElectronNetRuntime.ElectronAuthToken = token;
ElectronNetRuntime.ElectronSocketPort = port;
tcs.SetResult();
}
}
void Monitor_SocketIO_Failure(object sender, EventArgs e)
{
// We don't want to raise exceptions here - just pass the barrier
if (tcs.Task.IsCompleted)
{
this.Process_Exited(sender, e);
}
else
{
tcs.TrySetResult();
}
}
try
{
await Task.Delay(10.ms()).ConfigureAwait(false);
Console.Error.WriteLine("[StartInternal]: startCmd: {0}", startCmd);
Console.Error.WriteLine("[StartInternal]: args: {0}", args);
this.process = new ProcessRunner("ElectronRunner");
this.process.ProcessExited += this.Process_Exited;
this.process.Run(startCmd, args, directoriy);
this.process.ProcessExited += Monitor_SocketIO_Failure;
this.process.LineReceived += Read_SocketIO_Parameters;
this.process.Run(startCmd, args, directory);
await Task.Delay(500.ms()).ConfigureAwait(false);
await tcs.Task.ConfigureAwait(false);
Console.Error.WriteLine("[StartInternal]: after run:");
@@ -178,11 +221,11 @@
Console.Error.WriteLine("[StartInternal]: Process is not running: " + this.process.StandardOutput);
Task.Run(() => this.TransitionState(LifetimeState.Stopped));
throw new Exception("Failed to launch the Electron process.");
}
this.TransitionState(LifetimeState.Ready);
else
{
this.TransitionState(LifetimeState.Ready);
}
}
catch (Exception ex)
{

View File

@@ -8,12 +8,14 @@
internal class SocketBridgeService : LifetimeServiceBase
{
private readonly int socketPort;
private readonly string authorization;
private readonly string socketUrl;
private SocketIOConnection socket;
public SocketBridgeService(int socketPort)
public SocketBridgeService(int socketPort, string authorization)
{
this.socketPort = socketPort;
this.authorization = authorization;
this.socketUrl = $"http://localhost:{this.socketPort}";
}
@@ -23,7 +25,7 @@
protected override Task StartCore()
{
this.socket = new SocketIOConnection(this.socketUrl);
this.socket = new SocketIOConnection(this.socketUrl, this.authorization);
this.socket.BridgeConnected += this.Socket_BridgeConnected;
this.socket.BridgeDisconnected += this.Socket_BridgeDisconnected;
Task.Run(this.Connect);

View File

@@ -106,6 +106,20 @@
Console.WriteLine("Electron Process ID: " + result);
}
}
var authTokenArg = argsList.FirstOrDefault(e => e.Contains(ElectronNetRuntime.ElectronAuthTokenArgumentName, StringComparison.OrdinalIgnoreCase));
if (authTokenArg != null)
{
var parts = authTokenArg.Split('=', StringSplitOptions.TrimEntries);
if (parts.Length > 1 && !string.IsNullOrWhiteSpace(parts[1]))
{
var result = parts[1];
ElectronNetRuntime.ElectronAuthToken = result;
Console.WriteLine("Use Auth Token: " + result);
}
}
}
private void SetElectronExecutable()

View File

@@ -1,6 +1,7 @@
namespace ElectronNET.API
{
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using ElectronNET.AspNet;
@@ -10,6 +11,7 @@
using ElectronNET.Runtime.Helpers;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
/// <summary>
/// Provides extension methods for <see cref="IWebHostBuilder"/> to enable Electron.NET
@@ -66,23 +68,26 @@
// work as expected, see issue #952
Environment.SetEnvironmentVariable("ELECTRON_RUN_AS_NODE", null);
var webPort = PortHelper.GetFreePort(ElectronNetRuntime.AspNetWebPort ?? ElectronNetRuntime.DefaultWebPort);
ElectronNetRuntime.AspNetWebPort = webPort;
var webPort = ElectronNetRuntime.AspNetWebPort ?? 0;
// check for the content folder if its exists in base director otherwise no need to include
// It was used before because we are publishing the project which copies everything to bin folder and contentroot wwwroot was folder there.
// now we have implemented the live reload if app is run using /watch then we need to use the default project path.
// For port 0 (dynamic port assignment), Kestrel requires binding to specific IP (127.0.0.1) not localhost
var host = webPort == 0 ? "127.0.0.1" : "localhost";
if (Directory.Exists($"{AppDomain.CurrentDomain.BaseDirectory}\\wwwroot"))
{
builder = builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
.UseUrls("http://localhost:" + webPort);
.UseUrls($"http://{host}:{webPort}");
}
else
{
builder = builder.UseUrls("http://localhost:" + webPort);
builder = builder.UseUrls($"http://{host}:{webPort}");
}
builder = builder.ConfigureServices(services =>
builder = builder.ConfigureServices((context, services) =>
{
services.AddTransient<IStartupFilter, ServerReadyStartupFilter>();
services.AddSingleton<AspNetLifetimeAdapter>();

View File

@@ -0,0 +1,100 @@
namespace ElectronNET.AspNet.Middleware
{
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using ElectronNET.AspNet.Services;
/// <summary>
/// Middleware that validates authentication for all Electron requests.
/// Checks for authentication cookie or token query parameter on first request.
/// Sets HttpOnly cookie for subsequent requests.
///
/// Security Model:
/// - First request includes token as query parameter (?token=guid)
/// - Middleware validates token and sets secure HttpOnly cookie
/// - Subsequent requests use cookie (no token in URL)
/// - HTTP endpoints protected
/// </summary>
public class ElectronAuthenticationMiddleware
{
private readonly RequestDelegate _next;
private readonly IElectronAuthenticationService _authService;
private readonly ILogger<ElectronAuthenticationMiddleware> _logger;
private const string AuthCookieName = "ElectronAuth";
public ElectronAuthenticationMiddleware(
RequestDelegate next,
IElectronAuthenticationService authService,
ILogger<ElectronAuthenticationMiddleware> logger)
{
_next = next;
_authService = authService;
_logger = logger;
}
public async Task InvokeAsync(HttpContext context)
{
var path = context.Request.Path.Value;
// Check if authentication cookie exists
var authCookie = context.Request.Cookies[AuthCookieName];
if (!string.IsNullOrEmpty(authCookie))
{
// Cookie present - validate it
if (_authService.ValidateToken(authCookie))
{
await _next(context);
return;
}
else
{
// Invalid cookie - reject
_logger.LogWarning("Authentication failed: Invalid cookie for path {Path} from {RemoteIp}", path, context.Connection.RemoteIpAddress);
context.Response.StatusCode = 401;
await context.Response.WriteAsync("Unauthorized: Invalid authentication");
return;
}
}
// No cookie - check for token in query string (first-time authentication)
var token = context.Request.Query["token"].ToString();
if (!string.IsNullOrEmpty(token))
{
if (_authService.ValidateToken(token))
{
// Valid token - set cookie for future requests
_logger.LogInformation("Authentication successful: Setting cookie for path {Path}", path);
context.Response.Cookies.Append(AuthCookieName, token, new CookieOptions
{
HttpOnly = true, // Prevent JavaScript access (XSS protection)
SameSite = SameSiteMode.Strict, // CSRF protection
Path = "/", // Valid for all routes
Secure = false, // False because localhost is HTTP
IsEssential = true // Required for app to function
});
await _next(context);
return;
}
else
{
// Invalid token - reject
_logger.LogWarning("Authentication failed: Invalid token (prefix: {TokenPrefix}...) for path {Path} from {RemoteIp}", token.Length > 8 ? token.Substring(0, 8) : token, path, context.Connection.RemoteIpAddress);
context.Response.StatusCode = 401;
await context.Response.WriteAsync("Unauthorized: Invalid authentication");
return;
}
}
// Neither cookie nor valid token present - reject
_logger.LogWarning("Authentication failed: No cookie or token provided for path {Path} from {RemoteIp}", path, context.Connection.RemoteIpAddress);
context.Response.StatusCode = 401;
await context.Response.WriteAsync("Unauthorized: Authentication required");
}
}
}

View File

@@ -1,8 +1,13 @@
namespace ElectronNET.AspNet.Runtime
{
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.Extensions.DependencyInjection;
using ElectronNET.API;
using ElectronNET.AspNet.Services;
using ElectronNET.Common;
using ElectronNET.Runtime.Controllers;
using ElectronNET.Runtime.Data;
@@ -10,12 +15,16 @@
internal abstract class RuntimeControllerAspNetBase : RuntimeControllerBase
{
private readonly IServer server;
private readonly AspNetLifetimeAdapter aspNetLifetimeAdapter;
private readonly IElectronAuthenticationService authenticationService;
private SocketBridgeService socketBridge;
protected RuntimeControllerAspNetBase(AspNetLifetimeAdapter aspNetLifetimeAdapter)
protected RuntimeControllerAspNetBase(IServer server, AspNetLifetimeAdapter aspNetLifetimeAdapter, IElectronAuthenticationService authenticationService = null)
{
this.server = server;
this.aspNetLifetimeAdapter = aspNetLifetimeAdapter;
this.authenticationService = authenticationService;
this.aspNetLifetimeAdapter.Ready += this.AspNetLifetimeAdapter_Ready;
this.aspNetLifetimeAdapter.Stopping += this.AspNetLifetimeAdapter_Stopping;
this.aspNetLifetimeAdapter.Stopped += this.AspNetLifetimeAdapter_Stopped;
@@ -38,9 +47,9 @@
}
}
protected void CreateSocketBridge(int port)
protected void CreateSocketBridge(int port, string authorization)
{
this.socketBridge = new SocketBridgeService(port);
this.socketBridge = new SocketBridgeService(port, authorization);
this.socketBridge.Ready += this.SocketBridge_Ready;
this.socketBridge.Stopped += this.SocketBridge_Stopped;
this.socketBridge.Start();
@@ -52,6 +61,15 @@
this.ElectronProcess.IsReady() &&
this.aspNetLifetimeAdapter.IsReady())
{
var token = ElectronNetRuntime.ElectronAuthToken;
var serverAddressesFeature = this.server.Features.Get<IServerAddressesFeature>();
var address = serverAddressesFeature.Addresses.First();
var uri = new Uri(address);
// Only if somebody registered an IElectronAuthenticationService service - otherwise we do not care
this.authenticationService?.SetExpectedToken(token);
ElectronNetRuntime.AspNetWebPort = uri.Port;
this.TransitionState(LifetimeState.Ready);
Task.Run(this.RunReadyCallback);
}

View File

@@ -2,6 +2,9 @@
{
using System;
using System.Threading.Tasks;
using System.Security.Principal;
using Microsoft.AspNetCore.Hosting.Server;
using ElectronNET.AspNet.Services;
using ElectronNET.Common;
using ElectronNET.Runtime.Data;
using ElectronNET.Runtime.Helpers;
@@ -10,9 +13,8 @@
internal class RuntimeControllerAspNetDotnetFirst : RuntimeControllerAspNetBase
{
private ElectronProcessBase electronProcess;
private int? port;
public RuntimeControllerAspNetDotnetFirst(AspNetLifetimeAdapter aspNetLifetimeAdapter) : base(aspNetLifetimeAdapter)
public RuntimeControllerAspNetDotnetFirst(IServer server, AspNetLifetimeAdapter aspNetLifetimeAdapter, IElectronAuthenticationService authenticationService = null) : base(server, aspNetLifetimeAdapter, authenticationService)
{
}
@@ -23,15 +25,9 @@
var isUnPacked = ElectronNetRuntime.StartupMethod.IsUnpackaged();
var electronBinaryName = ElectronNetRuntime.ElectronExecutable;
var args = Environment.CommandLine;
this.port = ElectronNetRuntime.ElectronSocketPort;
var port = ElectronNetRuntime.ElectronSocketPort ?? 0;
if (!this.port.HasValue)
{
this.port = PortHelper.GetFreePort(ElectronNetRuntime.DefaultSocketPort);
ElectronNetRuntime.ElectronSocketPort = this.port;
}
this.electronProcess = new ElectronProcessActive(isUnPacked, electronBinaryName, args, this.port.Value);
this.electronProcess = new ElectronProcessActive(isUnPacked, electronBinaryName, args, port);
this.electronProcess.Ready += this.ElectronProcess_Ready;
this.electronProcess.Stopped += this.ElectronProcess_Stopped;
@@ -46,8 +42,10 @@
private void ElectronProcess_Ready(object sender, EventArgs e)
{
var port = ElectronNetRuntime.ElectronSocketPort.Value;
var token = ElectronNetRuntime.ElectronAuthToken;
this.TransitionState(LifetimeState.Started);
this.CreateSocketBridge(this.port!.Value);
this.CreateSocketBridge(port, token);
}
private void ElectronProcess_Stopped(object sender, EventArgs e)

View File

@@ -2,15 +2,16 @@
{
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting.Server;
using ElectronNET.AspNet.Services;
using ElectronNET.Runtime.Data;
using ElectronNET.Runtime.Services.ElectronProcess;
internal class RuntimeControllerAspNetElectronFirst : RuntimeControllerAspNetBase
{
private ElectronProcessBase electronProcess;
private int? port;
public RuntimeControllerAspNetElectronFirst(AspNetLifetimeAdapter aspNetLifetimeAdapter) : base(aspNetLifetimeAdapter)
public RuntimeControllerAspNetElectronFirst(IServer server, AspNetLifetimeAdapter aspNetLifetimeAdapter, IElectronAuthenticationService authenticationService = null) : base(server, aspNetLifetimeAdapter, authenticationService)
{
}
@@ -18,19 +19,15 @@
protected override Task StartCore()
{
this.port = ElectronNetRuntime.ElectronSocketPort;
if (!this.port.HasValue)
{
throw new Exception("No port has been specified by Electron!");
}
var port = ElectronNetRuntime.ElectronSocketPort.Value;
var token = ElectronNetRuntime.ElectronAuthToken;
if (!ElectronNetRuntime.ElectronProcessId.HasValue)
{
throw new Exception("No electronPID has been specified by Electron!");
}
this.CreateSocketBridge(this.port!.Value);
this.CreateSocketBridge(port, token);
this.electronProcess = new ElectronProcessPassive(ElectronNetRuntime.ElectronProcessId.Value);
this.electronProcess.Stopped += this.ElectronProcess_Stopped;

View File

@@ -0,0 +1,53 @@
namespace ElectronNET.AspNet.Services
{
/// <summary>
/// Implementation of authentication service for Electron clients.
/// Stores and validates the authentication token to ensure only the spawned Electron process can connect.
/// </summary>
public class ElectronAuthenticationService : IElectronAuthenticationService
{
private string _expectedToken;
private readonly object _lock = new object();
/// <inheritdoc />
public void SetExpectedToken(string token)
{
lock (_lock)
{
_expectedToken = token;
}
}
/// <inheritdoc />
public bool ValidateToken(string token)
{
if (string.IsNullOrEmpty(token))
return false;
lock (_lock)
{
if (string.IsNullOrEmpty(_expectedToken))
return false;
// Constant-time comparison to prevent timing attacks
return ConstantTimeEquals(token, _expectedToken);
}
}
/// <summary>
/// Performs constant-time string comparison to prevent timing attacks.
/// </summary>
private static bool ConstantTimeEquals(string a, string b)
{
if (a == null || b == null || a.Length != b.Length)
return false;
var result = 0;
for (int i = 0; i < a.Length; i++)
{
result |= a[i] ^ b[i];
}
return result == 0;
}
}
}

View File

@@ -0,0 +1,24 @@
namespace ElectronNET.AspNet.Services
{
/// <summary>
/// Service for validating authentication tokens from Electron clients.
/// Used to ensure only the Electron process spawned by this .NET instance can connect.
/// </summary>
public interface IElectronAuthenticationService
{
/// <summary>
/// Sets the expected authentication token for this instance.
/// Should be called when launching Electron with the generated token.
/// </summary>
/// <param name="token">The authentication token</param>
void SetExpectedToken(string token);
/// <summary>
/// Validates an incoming token against the expected token.
/// Uses constant-time comparison to prevent timing attacks.
/// </summary>
/// <param name="token">The token to validate</param>
/// <returns>True if token is valid, false otherwise</returns>
bool ValidateToken(string token);
}
}

View File

@@ -203,18 +203,35 @@
}
},
"node_modules/socket.io-parser": {
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz",
"integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==",
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.6.tgz",
"integrity": "sha512-asJqbVBDsBCJx0pTqw3WfesSY0iRX+2xzWEWzrpcH7L6fLzrhyF8WPI8UaeM4YCuDfpwA/cgsdugMsmtz8EJeg==",
"license": "MIT",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",
"debug": "~4.3.1"
"debug": "~4.4.1"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/socket.io-parser/node_modules/debug": {
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",

View File

@@ -1,6 +1,14 @@
"use strict";
const electron_updater_1 = require("electron-updater");
let electronSocket;
function normalize(updateInfo) {
if (typeof updateInfo?.releaseNotes === "string") {
updateInfo.releaseNotes = [{ note: updateInfo.releaseNotes }];
}
else if (Array.isArray(updateInfo?.releaseNotes)) {
updateInfo.releaseNotes = updateInfo.releaseNotes.map((entry) => typeof entry === "string" ? { note: entry } : entry);
}
}
module.exports = (socket) => {
electronSocket = socket;
socket.on("register-autoUpdater-error", (id) => {
@@ -15,11 +23,13 @@ module.exports = (socket) => {
});
socket.on("register-autoUpdater-update-available", (id) => {
electron_updater_1.autoUpdater.on("update-available", (updateInfo) => {
normalize(updateInfo);
electronSocket.emit("autoUpdater-update-available" + id, updateInfo);
});
});
socket.on("register-autoUpdater-update-not-available", (id) => {
electron_updater_1.autoUpdater.on("update-not-available", (updateInfo) => {
normalize(updateInfo);
electronSocket.emit("autoUpdater-update-not-available" + id, updateInfo);
});
});
@@ -30,6 +40,7 @@ module.exports = (socket) => {
});
socket.on("register-autoUpdater-update-downloaded", (id) => {
electron_updater_1.autoUpdater.on("update-downloaded", (updateInfo) => {
normalize(updateInfo);
electronSocket.emit("autoUpdater-update-downloaded" + id, updateInfo);
});
});
@@ -89,6 +100,7 @@ module.exports = (socket) => {
electron_updater_1.autoUpdater
.checkForUpdatesAndNotify()
.then((updateCheckResult) => {
normalize(updateCheckResult?.updateInfo);
electronSocket.emit("autoUpdater-checkForUpdatesAndNotify-completed" + guid, updateCheckResult);
})
.catch((error) => {
@@ -99,6 +111,7 @@ module.exports = (socket) => {
electron_updater_1.autoUpdater
.checkForUpdates()
.then((updateCheckResult) => {
normalize(updateCheckResult?.updateInfo);
electronSocket.emit("autoUpdater-checkForUpdates-completed" + guid, updateCheckResult);
})
.catch((error) => {

File diff suppressed because one or more lines are too long

View File

@@ -3,6 +3,16 @@ import { autoUpdater } from "electron-updater";
let electronSocket: Socket;
function normalize(updateInfo) {
if (typeof updateInfo?.releaseNotes === "string") {
updateInfo.releaseNotes = [{ note: updateInfo.releaseNotes }];
} else if (Array.isArray(updateInfo?.releaseNotes)) {
updateInfo.releaseNotes = updateInfo.releaseNotes.map((entry) =>
typeof entry === "string" ? { note: entry } : entry,
);
}
}
export = (socket: Socket) => {
electronSocket = socket;
@@ -20,12 +30,14 @@ export = (socket: Socket) => {
socket.on("register-autoUpdater-update-available", (id) => {
autoUpdater.on("update-available", (updateInfo) => {
normalize(updateInfo);
electronSocket.emit("autoUpdater-update-available" + id, updateInfo);
});
});
socket.on("register-autoUpdater-update-not-available", (id) => {
autoUpdater.on("update-not-available", (updateInfo) => {
normalize(updateInfo);
electronSocket.emit("autoUpdater-update-not-available" + id, updateInfo);
});
});
@@ -38,6 +50,7 @@ export = (socket: Socket) => {
socket.on("register-autoUpdater-update-downloaded", (id) => {
autoUpdater.on("update-downloaded", (updateInfo) => {
normalize(updateInfo);
electronSocket.emit("autoUpdater-update-downloaded" + id, updateInfo);
});
});
@@ -143,6 +156,7 @@ export = (socket: Socket) => {
autoUpdater
.checkForUpdatesAndNotify()
.then((updateCheckResult) => {
normalize(updateCheckResult?.updateInfo);
electronSocket.emit(
"autoUpdater-checkForUpdatesAndNotify-completed" + guid,
updateCheckResult,
@@ -160,6 +174,7 @@ export = (socket: Socket) => {
autoUpdater
.checkForUpdates()
.then((updateCheckResult) => {
normalize(updateCheckResult?.updateInfo);
electronSocket.emit(
"autoUpdater-checkForUpdates-completed" + guid,
updateCheckResult,

View File

@@ -277,7 +277,15 @@ module.exports = (socket, app) => {
}
});
if (loadUrl) {
window.loadURL(loadUrl);
// Append authentication token to initial URL if available
const token = global["authToken"];
if (token) {
const separator = loadUrl.includes("?") ? "&" : "?";
window.loadURL(`${loadUrl}${separator}token=${token}`);
}
else {
window.loadURL(loadUrl);
}
}
if (app.commandLine.hasSwitch("clear-cache") &&
app.commandLine.getSwitchValue("clear-cache")) {

File diff suppressed because one or more lines are too long

View File

@@ -6,6 +6,7 @@ import { browserViewMediateService } from "./browserView";
const windows: Electron.BrowserWindow[] = (global["browserWindows"] =
global["browserWindows"] || []) as Electron.BrowserWindow[];
let readyToShowWindowsIds: number[] = [];
let window;
@@ -308,7 +309,15 @@ export = (socket: Socket, app: Electron.App) => {
});
if (loadUrl) {
window.loadURL(loadUrl);
// Append authentication token to initial URL if available
const token = global["authToken"];
if (token) {
const separator = loadUrl.includes("?") ? "&" : "?";
window.loadURL(`${loadUrl}${separator}token=${token}`);
} else {
window.loadURL(loadUrl);
}
}
if (

View File

@@ -1,10 +1,14 @@
const { app } = require('electron');
const { BrowserWindow } = require('electron');
const { protocol } = require('electron');
const { createServer } = require('http');
const { randomUUID } = require('crypto');
const { Server } = require('socket.io');
const { platform } = require('os');
const path = require('path');
const fs = require('fs');
const cProcess = require('child_process').spawn;
const portscanner = require('portscanner');
const { imageSize } = require('image-size');
let io, server, browserWindows, ipc, apiProcess, loadURL;
let appApi, menu, dialogApi, notification, tray, webContents;
let globalShortcut, shellApi, screen, clipboard, autoUpdater;
@@ -16,20 +20,19 @@ let nativeTheme;
let dock;
let launchFile;
let launchUrl;
let processApi;
let manifestJsonFileName = 'package.json';
let unpackedelectron = false;
let unpackeddotnet = false;
let dotnetpacked = false;
let electronforcedport;
let electronUrl;
let authToken = randomUUID().split('-').join('');
if (app.commandLine.hasSwitch('manifest')) {
manifestJsonFileName = app.commandLine.getSwitchValue('manifest');
}
console.log('Entry!!!: ');
if (app.commandLine.hasSwitch('unpackedelectron')) {
unpackedelectron = true;
}
@@ -41,7 +44,14 @@ else if (app.commandLine.hasSwitch('dotnetpacked')) {
}
if (app.commandLine.hasSwitch('electronforcedport')) {
electronforcedport = app.commandLine.getSwitchValue('electronforcedport');
electronforcedport = +app.commandLine.getSwitchValue('electronforcedport');
}
// Store in global for access by browser windows
global.authToken = authToken;
if (app.commandLine.hasSwitch('electronurl')) {
electronUrl = app.commandLine.getSwitchValue('electronurl');
}
// Custom startup hook: look for custom_main.js and invoke its onStartup(host) if present.
@@ -73,7 +83,7 @@ let manifestJsonFilePath = path.join(currentPath, manifestJsonFileName);
// if running unpackedelectron, lets change the path
if (unpackedelectron || unpackeddotnet) {
console.log('unpackedelectron! dir: ' + currentPath);
console.debug('Running in unpackaged mode, dir: ' + currentPath);
manifestJsonFilePath = path.join(currentPath, manifestJsonFileName);
currentBinPath = path.join(currentPath, '../'); // go to project directory
@@ -153,44 +163,38 @@ app.on('ready', () => {
}
if (electronforcedport) {
console.log('Electron Socket IO (forced) Port: ' + electronforcedport);
console.info('Electron Socket IO (forced) Port: ' + electronforcedport);
startSocketApiBridge(electronforcedport);
return;
} else {
console.info('Electron Socket dynamic IO Port');
startSocketApiBridge(0);
}
// Added default port as configurable for port restricted environments.
let defaultElectronPort = 8000;
if (manifestJsonFile.electronPort) {
defaultElectronPort = manifestJsonFile.electronPort;
}
// hostname needs to be localhost, otherwise Windows Firewall will be triggered.
portscanner.findAPortNotInUse(defaultElectronPort, 65535, 'localhost', function (error, port) {
console.log('Electron Socket IO Port: ' + port);
startSocketApiBridge(port);
});
});
app.on('quit', async (event, exitCode) => {
try {
server.close();
server.closeAllConnections();
} catch (e) {
console.error(e);
}
try {
apiProcess?.kill();
} catch (e) {
console.error(e);
}
try {
if (io && typeof io.close === 'function') {
io.close();
if (server) {
try {
server.close();
server.closeAllConnections();
} catch (e) {
console.error(e);
}
}
if (apiProcess) {
try {
apiProcess.kill();
} catch (e) {
console.error(e);
}
}
if (io && io.close) {
try {
io.close();
} catch (e) {
console.error(e);
}
} catch (e) {
console.error(e);
}
});
@@ -246,9 +250,7 @@ function startSplashScreen() {
// it's an image, so we can compute the desired splash screen size
imageSize(imageFile, (error, dimensions) => {
if (error) {
console.log(`load splashscreen error:`);
console.error(error);
console.error(`load splashscreen error:`, error);
throw new Error(error.message);
}
@@ -259,9 +261,9 @@ function startSplashScreen() {
function startSocketApiBridge(port) {
// instead of 'require('socket.io')(port);' we need to use this workaround
// otherwise the Windows Firewall will be triggered
console.log('Electron Socket: starting...');
server = require('http').createServer();
const { Server } = require('socket.io');
console.debug('Electron Socket: starting...');
server = createServer();
const host = !port ? '127.0.0.1' : 'localhost';
let hostHook;
io = new Server({
pingTimeout: 60000, // in ms, default is 5000
@@ -269,14 +271,16 @@ function startSocketApiBridge(port) {
});
io.attach(server);
server.listen(port, 'localhost');
server.listen(port, host);
server.on('listening', function () {
console.log('Electron Socket: listening on port %s at %s', server.address().port, server.address().address);
const addr = server.address();
console.info(`Electron Socket: listening on port ${addr.port} at ${addr.address} using ${authToken}`);
// Now that socket connection is established, we can guarantee port will not be open for portscanner
if (unpackedelectron) {
startAspCoreBackendUnpackaged(port);
startAspCoreBackendUnpackaged(addr.port);
} else if (!unpackeddotnet && !dotnetpacked) {
startAspCoreBackend(port);
startAspCoreBackend(addr.port);
}
});
@@ -286,9 +290,16 @@ function startSocketApiBridge(port) {
// @ts-ignore
io.on('connection', (socket) => {
console.log('Electron Socket: connected!');
console.info('Electron Socket: connected!');
if (authToken && socket.request.headers.authorization !== authToken) {
console.warn('Electron Socket authentication failed!');
socket.disconnect(true);
return;
}
socket.on('disconnect', function (reason) {
console.log('Got disconnect! Reason: ' + reason);
console.debug('Got disconnect! Reason: ' + reason);
try {
////console.log('requireCache');
////console.log(require.cache['electron-host-hook']);
@@ -308,7 +319,7 @@ function startSocketApiBridge(port) {
global['electronsocket'].setMaxListeners(0);
}
console.log('Electron Socket: loading components...');
console.debug('Electron Socket: loading components...');
if (appApi === undefined) appApi = require('./api/app')(socket, app);
if (browserWindows === undefined) browserWindows = require('./api/browserWindows')(socket, app);
@@ -369,7 +380,7 @@ function startSocketApiBridge(port) {
console.error(error.message);
}
console.log('Electron Socket: startup complete.');
console.info('Electron Socket: startup complete.');
});
}
@@ -383,23 +394,23 @@ function startAspCoreBackend(electronPort) {
envParam,
`/electronPort=${electronPort}`,
`/electronPID=${process.pid}`,
`/electronAuthToken=${authToken}`,
// forward user supplied args (avoid duplicate environment)
...forwardedArgs.filter(a => !(envParam && a.startsWith('--environment=')))
].filter(p => p);
let binaryFile = manifestJsonFile.executable;
const os = require('os');
if (os.platform() === 'win32') {
if (platform() === 'win32') {
binaryFile = binaryFile + '.exe';
}
let binFilePath = path.join(currentBinPath, binaryFile);
var options = { cwd: currentBinPath };
console.log('Starting backend with parameters:', parameters.join(' '));
console.debug('Starting backend with parameters:', parameters.join(' '));
apiProcess = cProcess(binFilePath, parameters, options);
apiProcess.stdout.on('data', (data) => {
console.log(`stdout: ${data.toString()}`);
console.debug(`stdout: ${data.toString()}`);
});
}
}
@@ -414,22 +425,22 @@ function startAspCoreBackendUnpackaged(electronPort) {
envParam,
`/electronPort=${electronPort}`,
`/electronPID=${process.pid}`,
`/electronAuthToken=${authToken}`,
...forwardedArgs.filter(a => !(envParam && a.startsWith('--environment=')))
].filter(p => p);
let binaryFile = manifestJsonFile.executable;
const os = require('os');
if (os.platform() === 'win32') {
if (platform() === 'win32') {
binaryFile = binaryFile + '.exe';
}
let binFilePath = path.join(currentBinPath, binaryFile);
var options = { cwd: currentBinPath };
console.log('Starting backend (unpackaged) with parameters:', parameters.join(' '));
console.debug('Starting backend (unpackaged) with parameters:', parameters.join(' '));
apiProcess = cProcess(binFilePath, parameters, options);
apiProcess.stdout.on('data', (data) => {
console.log(`stdout: ${data.toString()}`);
console.debug(`stdout: ${data.toString()}`);
});
}
}

View File

@@ -1201,9 +1201,9 @@
}
},
"node_modules/flatted": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
"integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
"dev": true,
"license": "ISC"
},
@@ -1601,9 +1601,9 @@
}
},
"node_modules/lodash": {
"version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"license": "MIT"
},
"node_modules/lodash.escaperegexp": {

View File

@@ -19,7 +19,6 @@
"dasherize": "^2.0.0",
"electron-host-hook": "file:./ElectronHostHook",
"image-size": "^1.2.1",
"portscanner": "^2.2.0",
"electron-updater": "^6.6.2",
"socket.io": "^4.8.1"
},

View File

@@ -0,0 +1,193 @@
using System.Diagnostics;
namespace ElectronNET.IntegrationTests.Tests;
/// <summary>
/// Unit tests for ElectronNET.MigrationChecks.targets - no Electron runtime required.
/// Covers GitHub issue #1035: System.IO.File.ReadAllLines is not available as an MSBuild
/// property function on all platforms (e.g. macOS GitHub Actions), causing MSB4185.
/// </summary>
public class MigrationChecksTargetsTests
{
private static readonly string TargetsFilePath = FindTargetsFile();
/// <summary>
/// Walks up the directory tree from <see cref="AppContext.BaseDirectory"/> until it finds
/// the migration checks targets file. This is robust against varying output paths
/// (with or without RID subfolder, debug/release, etc.).
/// </summary>
private static string FindTargetsFile()
{
const string RelativeFromRepoRoot =
"src/ElectronNET/build/ElectronNET.MigrationChecks.targets";
const string RelativeFromSrc =
"ElectronNET/build/ElectronNET.MigrationChecks.targets";
var dir = new DirectoryInfo(AppContext.BaseDirectory);
while (dir != null)
{
var fromRepoRoot = Path.Combine(dir.FullName, RelativeFromRepoRoot);
if (File.Exists(fromRepoRoot))
{
return Path.GetFullPath(fromRepoRoot);
}
var fromSrc = Path.Combine(dir.FullName, RelativeFromSrc);
if (File.Exists(fromSrc))
{
return Path.GetFullPath(fromSrc);
}
dir = dir.Parent;
}
throw new FileNotFoundException(
"Could not locate ElectronNET.MigrationChecks.targets by walking up from " +
$"'{AppContext.BaseDirectory}'.");
}
// -----------------------------------------------------------------------
// Content-level test (RED before fix, GREEN after fix on ALL platforms)
// -----------------------------------------------------------------------
[Fact]
public void MigrationChecksTargets_ShouldNotUseReadAllLines()
{
// The file must exist - if this fails the path constant above is wrong.
File.Exists(TargetsFilePath).Should().BeTrue(
$"targets file must exist at '{TargetsFilePath}'");
var content = File.ReadAllText(TargetsFilePath);
// System.IO.File::ReadAllLines is not in the MSBuild property-function
// whitelist on all platforms (MSB4185 on macOS GitHub Actions, see #1035).
// ReadAllText must be used instead.
content.Should().NotContain(
"::ReadAllLines(",
"because ReadAllLines is not available as an MSBuild property function on all " +
"platforms. Use ReadAllText instead (GitHub issue #1035).");
}
// -----------------------------------------------------------------------
// Functional build test - verifies no MSB4185 at runtime
// (RED on platforms where ReadAllLines is restricted, GREEN after fix)
// -----------------------------------------------------------------------
[Fact]
public async Task MigrationChecksTargets_BuildWithCleanPackageJson_ShouldSucceedWithoutMSB4185()
{
// Positive case: a package.json that does NOT mention electron.
// The migration check must successfully read the file via ReadAllText
// (the code path fixed by issue #1035) without producing MSB4185.
var tempDir = CreateTempProjectDirectory();
try
{
await File.WriteAllTextAsync(
Path.Combine(tempDir, "package.json"),
"""{ "devDependencies": { "vite": "^5.0.0" } }""");
await WriteMinimalCsprojAsync(tempDir);
var (exitCode, output) = await RunDotnetBuildAsync(tempDir);
exitCode.Should().Be(0,
$"the build must succeed when the package.json contains no electron references. " +
$"Full build output:\n{output}");
output.Should().NotContain(
"MSB4185",
$"ReadAllLines must not be used as an MSBuild property function. " +
$"Full build output:\n{output}");
}
finally
{
Directory.Delete(tempDir, recursive: true);
}
}
[Fact]
public async Task MigrationChecksTargets_BuildWithPackageJsonContainingElectron_ShouldEmitELECTRON008WarningWithoutMSB4185()
{
// Negative case: a package.json that DOES contain "electron".
// The migration check must still read the file successfully (no MSB4185)
// and must emit the expected ELECTRON008 warning. ELECTRON008 is a
// <Warning>, not an <Error>, so the build itself still succeeds.
var tempDir = CreateTempProjectDirectory();
try
{
await File.WriteAllTextAsync(
Path.Combine(tempDir, "package.json"),
"""{ "devDependencies": { "electron": "^30.0.0" } }""");
await WriteMinimalCsprojAsync(tempDir);
var (exitCode, output) = await RunDotnetBuildAsync(tempDir);
exitCode.Should().Be(0,
$"ELECTRON008 is a Warning (not an Error) so the build itself must still " +
$"succeed. Full build output:\n{output}");
output.Should().NotContain(
"MSB4185",
$"ReadAllLines must not be used as an MSBuild property function. " +
$"Full build output:\n{output}");
output.Should().Contain(
"ELECTRON008",
$"the migration check must still detect electron references in package.json " +
$"after the ReadAllText migration. Full build output:\n{output}");
}
finally
{
Directory.Delete(tempDir, recursive: true);
}
}
// -----------------------------------------------------------------------
// Helpers
// -----------------------------------------------------------------------
private static string CreateTempProjectDirectory()
{
var tempDir = Path.Combine(Path.GetTempPath(), $"electron-net-test-{Guid.NewGuid():N}");
Directory.CreateDirectory(tempDir);
return tempDir;
}
private static Task WriteMinimalCsprojAsync(string tempDir)
{
// A minimal csproj that only imports the migration checks targets to keep the
// build fast. Note: MSBuildProjectDirectory is a reserved MSBuild property and
// must not be redefined manually; MSBuild sets it automatically to the folder
// of the csproj (which is tempDir here).
var targetsPathEscaped = TargetsFilePath.Replace("'", "&apos;");
return File.WriteAllTextAsync(
Path.Combine(tempDir, "TestApp.csproj"),
$"""
<Project>
<Import Project="{targetsPathEscaped}" />
<Target Name="Build" DependsOnTargets="ElectronMigrationChecks" />
</Project>
""");
}
private static async Task<(int ExitCode, string Output)> RunDotnetBuildAsync(string workingDirectory)
{
var psi = new ProcessStartInfo("dotnet", "build --nologo -v:minimal")
{
WorkingDirectory = workingDirectory,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
};
using var process = Process.Start(psi)!;
var stdOut = await process.StandardOutput.ReadToEndAsync();
var stdErr = await process.StandardError.ReadToEndAsync();
await process.WaitForExitAsync();
return (process.ExitCode, stdOut + stdErr);
}
}

View File

@@ -0,0 +1,115 @@
namespace ElectronNET.IntegrationTests.Tests
{
using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using ElectronNET.API.Entities;
/// <summary>
/// Unit tests for UpdateInfo JSON deserialization.
/// Tests the fix for issue #1039: releaseNotes arrives as string or string[] from electron-builder
/// when FullChangelog is false (default), but the C# model expects ReleaseNoteInfo[].
/// No Electron runtime is required for these tests.
/// </summary>
public class UpdateInfoSerializationTests
{
// camelCase + ignore null — mirrors ElectronJson.Options used in production
private static readonly JsonSerializerOptions Options = new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
};
// electron-builder sends a plain string when FullChangelog = false (default)
[Fact]
public void Deserialize_WithStringReleaseNotes_ShouldConvertToSingleEntry()
{
var json = """{"version":"1.2.3","releaseNotes":"Some release notes"}""";
var result = JsonSerializer.Deserialize<UpdateInfo>(json, Options);
result.Should().NotBeNull();
result.ReleaseNotes.Should().HaveCount(1);
result.ReleaseNotes[0].Note.Should().Be("Some release notes");
}
// After the (incorrect) TypeScript normalize: string → ["string"] which is an array of strings,
// not an array of ReleaseNoteInfo objects. The C# model must handle this too.
[Fact]
public void Deserialize_WithArrayOfStringReleaseNotes_ShouldConvertToEntries()
{
var json = """{"version":"1.2.3","releaseNotes":["Note A","Note B"]}""";
var result = JsonSerializer.Deserialize<UpdateInfo>(json, Options);
result.Should().NotBeNull();
result.ReleaseNotes.Should().HaveCount(2);
result.ReleaseNotes[0].Note.Should().Be("Note A");
result.ReleaseNotes[1].Note.Should().Be("Note B");
}
// When FullChangelog = true, electron-builder sends proper objects; this must keep working.
[Fact]
public void Deserialize_WithProperReleaseNoteObjects_ShouldDeserializeNormally()
{
var json = """{"version":"1.2.3","releaseNotes":[{"version":"1.2.3","note":"Proper note"}]}""";
var result = JsonSerializer.Deserialize<UpdateInfo>(json, Options);
result.Should().NotBeNull();
result.ReleaseNotes.Should().HaveCount(1);
result.ReleaseNotes[0].Version.Should().Be("1.2.3");
result.ReleaseNotes[0].Note.Should().Be("Proper note");
}
// Null releaseNotes should result in an empty array (matching the default value).
[Fact]
public void Deserialize_WithNullReleaseNotes_ShouldReturnEmptyArray()
{
var json = """{"version":"1.2.3","releaseNotes":null}""";
var result = JsonSerializer.Deserialize<UpdateInfo>(json, Options);
result.Should().NotBeNull();
result.ReleaseNotes.Should().NotBeNull();
result.ReleaseNotes.Should().BeEmpty();
}
// Absent releaseNotes field should keep the default empty array.
[Fact]
public void Deserialize_WithMissingReleaseNotes_ShouldReturnEmptyArray()
{
var json = """{"version":"1.2.3"}""";
var result = JsonSerializer.Deserialize<UpdateInfo>(json, Options);
result.Should().NotBeNull();
result.ReleaseNotes.Should().NotBeNull();
result.ReleaseNotes.Should().BeEmpty();
}
// Empty array must serialize as [] not null, so round-trips and downstream
// consumers don't receive unexpected null for a non-null array value.
[Fact]
public void Serialize_WithEmptyReleaseNotes_ShouldProduceEmptyArray()
{
var updateInfo = new UpdateInfo { Version = "1.2.3", ReleaseNotes = Array.Empty<ReleaseNoteInfo>() };
var json = JsonSerializer.Serialize(updateInfo, Options);
json.Should().Contain("\"releaseNotes\":[]");
}
// Null value: with DefaultIgnoreCondition.WhenWritingNull the property is
// omitted entirely at the serializer level (before Write() is called).
[Fact]
public void Serialize_WithNullReleaseNotes_ShouldOmitProperty()
{
var updateInfo = new UpdateInfo { Version = "1.2.3", ReleaseNotes = null };
var json = JsonSerializer.Serialize(updateInfo, Options);
json.Should().NotContain("releaseNotes");
}
}
}

View File

@@ -500,9 +500,9 @@
"license": "MIT"
},
"node_modules/brace-expansion": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz",
"integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
@@ -1438,9 +1438,9 @@
}
},
"node_modules/lodash": {
"version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
"license": "MIT"
},
"node_modules/lodash.defaults": {
@@ -1856,9 +1856,9 @@
}
},
"node_modules/socket.io-parser": {
"version": "4.2.5",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.5.tgz",
"integrity": "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ==",
"version": "4.2.6",
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.6.tgz",
"integrity": "sha512-asJqbVBDsBCJx0pTqw3WfesSY0iRX+2xzWEWzrpcH7L6fLzrhyF8WPI8UaeM4YCuDfpwA/cgsdugMsmtz8EJeg==",
"license": "MIT",
"dependencies": {
"@socket.io/component-emitter": "~3.1.0",

View File

@@ -73,12 +73,11 @@ EXCEPTION:
<Target Name="ElectronCheckRootPackageJsonNoElectron"
Condition="Exists('$(MSBuildProjectDirectory)\package.json')">
<ItemGroup>
<_RootPackageJsonLines Include="$([System.IO.File]::ReadAllLines('$(MSBuildProjectDirectory)\package.json'))" />
</ItemGroup>
<PropertyGroup>
<_RootPackageJsonContent>@(_RootPackageJsonLines, ' ')</_RootPackageJsonContent>
<!-- ReadAllText is used here instead of ReadAllLines because ReadAllLines is not available
as an MSBuild property function on all platforms (e.g. macOS GitHub Actions), which
caused MSB4185. ReadAllText is universally supported. See GitHub issue #1035. -->
<_RootPackageJsonContent>$([System.IO.File]::ReadAllText('$(MSBuildProjectDirectory)\package.json'))</_RootPackageJsonContent>
<_RootPackageJsonHasElectron>false</_RootPackageJsonHasElectron>
<_RootPackageJsonHasElectron Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(_RootPackageJsonContent)', 'electron', System.Text.RegularExpressions.RegexOptions.IgnoreCase))">true</_RootPackageJsonHasElectron>
</PropertyGroup>

View File

@@ -338,6 +338,7 @@
<EnumValue Name="36.9.2" DisplayName="36.9.2" />
<EnumValue Name="36.9.3" DisplayName="36.9.3" />
<EnumValue Name="36.9.4" DisplayName="36.9.4" />
<EnumValue Name="36.9.5" DisplayName="36.9.5" />
<EnumValue Name="37.0.0" DisplayName="37.0.0" />
<EnumValue Name="37.1.0" DisplayName="37.1.0" />
<EnumValue Name="37.2.0" DisplayName="37.2.0" />
@@ -354,6 +355,14 @@
<EnumValue Name="37.5.1" DisplayName="37.5.1" />
<EnumValue Name="37.6.0" DisplayName="37.6.0" />
<EnumValue Name="37.6.1" DisplayName="37.6.1" />
<EnumValue Name="37.7.0" DisplayName="37.7.0" />
<EnumValue Name="37.7.1" DisplayName="37.7.1" />
<EnumValue Name="37.8.0" DisplayName="37.8.0" />
<EnumValue Name="37.9.0" DisplayName="37.9.0" />
<EnumValue Name="37.10.0" DisplayName="37.10.0" />
<EnumValue Name="37.10.1" DisplayName="37.10.1" />
<EnumValue Name="37.10.2" DisplayName="37.10.2" />
<EnumValue Name="37.10.3" DisplayName="37.10.3" />
<EnumValue Name="38.0.0" DisplayName="38.0.0" />
<EnumValue Name="38.1.0" DisplayName="38.1.0" />
<EnumValue Name="38.1.1" DisplayName="38.1.1" />
@@ -361,6 +370,94 @@
<EnumValue Name="38.2.0" DisplayName="38.2.0" />
<EnumValue Name="38.2.1" DisplayName="38.2.1" />
<EnumValue Name="38.2.2" DisplayName="38.2.2" />
<EnumValue Name="38.3.0" DisplayName="38.3.0" />
<EnumValue Name="38.4.0" DisplayName="38.4.0" />
<EnumValue Name="38.5.0" DisplayName="38.5.0" />
<EnumValue Name="38.6.0" DisplayName="38.6.0" />
<EnumValue Name="38.7.0" DisplayName="38.7.0" />
<EnumValue Name="38.7.1" DisplayName="38.7.1" />
<EnumValue Name="38.7.2" DisplayName="38.7.2" />
<EnumValue Name="38.8.0" DisplayName="38.8.0" />
<EnumValue Name="38.8.1" DisplayName="38.8.1" />
<EnumValue Name="38.8.2" DisplayName="38.8.2" />
<EnumValue Name="38.8.4" DisplayName="38.8.4" />
<EnumValue Name="38.8.6" DisplayName="38.8.6" />
<EnumValue Name="39.0.0" DisplayName="39.0.0" />
<EnumValue Name="39.1.0" DisplayName="39.1.0" />
<EnumValue Name="39.1.1" DisplayName="39.1.1" />
<EnumValue Name="39.1.2" DisplayName="39.1.2" />
<EnumValue Name="39.2.0" DisplayName="39.2.0" />
<EnumValue Name="39.2.1" DisplayName="39.2.1" />
<EnumValue Name="39.2.2" DisplayName="39.2.2" />
<EnumValue Name="39.2.3" DisplayName="39.2.3" />
<EnumValue Name="39.2.4" DisplayName="39.2.4" />
<EnumValue Name="39.2.5" DisplayName="39.2.5" />
<EnumValue Name="39.2.6" DisplayName="39.2.6" />
<EnumValue Name="39.2.7" DisplayName="39.2.7" />
<EnumValue Name="39.3.0" DisplayName="39.3.0" />
<EnumValue Name="39.4.0" DisplayName="39.4.0" />
<EnumValue Name="39.5.0" DisplayName="39.5.0" />
<EnumValue Name="39.5.1" DisplayName="39.5.1" />
<EnumValue Name="39.5.2" DisplayName="39.5.2" />
<EnumValue Name="39.6.0" DisplayName="39.6.0" />
<EnumValue Name="39.6.1" DisplayName="39.6.1" />
<EnumValue Name="39.7.0" DisplayName="39.7.0" />
<EnumValue Name="39.8.0" DisplayName="39.8.0" />
<EnumValue Name="39.8.1" DisplayName="39.8.1" />
<EnumValue Name="39.8.2" DisplayName="39.8.2" />
<EnumValue Name="39.8.3" DisplayName="39.8.3" />
<EnumValue Name="39.8.4" DisplayName="39.8.4" />
<EnumValue Name="39.8.5" DisplayName="39.8.5" />
<EnumValue Name="39.8.6" DisplayName="39.8.6" />
<EnumValue Name="39.8.7" DisplayName="39.8.7" />
<EnumValue Name="39.8.8" DisplayName="39.8.8" />
<EnumValue Name="39.8.9" DisplayName="39.8.9" />
<EnumValue Name="39.8.10" DisplayName="39.8.10" />
<EnumValue Name="40.0.0" DisplayName="40.0.0" />
<EnumValue Name="40.1.0" DisplayName="40.1.0" />
<EnumValue Name="40.2.0" DisplayName="40.2.0" />
<EnumValue Name="40.2.1" DisplayName="40.2.1" />
<EnumValue Name="40.3.0" DisplayName="40.3.0" />
<EnumValue Name="40.4.0" DisplayName="40.4.0" />
<EnumValue Name="40.4.1" DisplayName="40.4.1" />
<EnumValue Name="40.5.0" DisplayName="40.5.0" />
<EnumValue Name="40.6.0" DisplayName="40.6.0" />
<EnumValue Name="40.6.1" DisplayName="40.6.1" />
<EnumValue Name="40.7.0" DisplayName="40.7.0" />
<EnumValue Name="40.8.0" DisplayName="40.8.0" />
<EnumValue Name="40.8.1" DisplayName="40.8.1" />
<EnumValue Name="40.8.2" DisplayName="40.8.2" />
<EnumValue Name="40.8.3" DisplayName="40.8.3" />
<EnumValue Name="40.8.4" DisplayName="40.8.4" />
<EnumValue Name="40.8.5" DisplayName="40.8.5" />
<EnumValue Name="40.9.0" DisplayName="40.9.0" />
<EnumValue Name="40.9.1" DisplayName="40.9.1" />
<EnumValue Name="40.9.2" DisplayName="40.9.2" />
<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="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" />
<EnumValue Name="41.0.3" DisplayName="41.0.3" />
<EnumValue Name="41.0.4" DisplayName="41.0.4" />
<EnumValue Name="41.1.0" DisplayName="41.1.0" />
<EnumValue Name="41.1.1" DisplayName="41.1.1" />
<EnumValue Name="41.2.0" DisplayName="41.2.0" />
<EnumValue Name="41.2.1" DisplayName="41.2.1" />
<EnumValue Name="41.2.2" DisplayName="41.2.2" />
<EnumValue Name="41.3.0" DisplayName="41.3.0" />
<EnumValue Name="41.4.0" DisplayName="41.4.0" />
<EnumValue Name="41.5.0" DisplayName="41.5.0" />
<EnumValue Name="41.5.1" DisplayName="41.5.1" />
<EnumValue Name="41.5.2" DisplayName="41.5.2" />
<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="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" />
</EnumProperty>
<EnumProperty Name="ElectronBuilderVersion"
@@ -401,6 +498,17 @@
<EnumValue Name="24.12" DisplayName="24.12" />
<EnumValue Name="24.13" DisplayName="24.13" />
<EnumValue Name="26.0" DisplayName="26.0" />
<EnumValue Name="26.1" DisplayName="26.1" />
<EnumValue Name="26.2" DisplayName="26.2" />
<EnumValue Name="26.3" DisplayName="26.3" />
<EnumValue Name="26.4" DisplayName="26.4" />
<EnumValue Name="26.5" DisplayName="26.5" />
<EnumValue Name="26.6" DisplayName="26.6" />
<EnumValue Name="26.7" DisplayName="26.7" />
<EnumValue Name="26.8" DisplayName="26.8" />
<EnumValue Name="26.9" DisplayName="26.9" />
<EnumValue Name="26.10" DisplayName="26.10" />
<EnumValue Name="26.11" DisplayName="26.11" />
<EnumValue Name="27" DisplayName="27" />
<EnumValue Name="28" DisplayName="28" />
<EnumValue Name="29" DisplayName="29" />

View File

@@ -35,7 +35,6 @@
"dasherize": "^2.0.0",
"electron-updater": "^6.6.2",
"image-size": "^1.2.1",
"portscanner": "^2.2.0",
"socket.io": "^4.8.1",
"electron-host-hook": "file:./ElectronHostHook"
},