Merge branch 'develop'

This commit is contained in:
Florian Rappl
2025-11-04 16:18:53 +01:00
24 changed files with 231 additions and 108 deletions

View File

@@ -1,8 +1,19 @@
# 0.1.0
## ElectronNET.Core
- Updated `PrintToPDFOptions` to also allow specifying the `PageSize` with an object (#769)
- Updated splashscreen image to have 0 margin (#622)
- Fixed single instance behavior using the `ElectronSingleInstance` property (#901)
- Added option to use `ElectronSplashScreen` with an HTML file (#799)
- Added option to provide floating point value as aspect ratios with `SetAspectRatio` (#793)
# 0.0.18
## ElectronNET.Core
### Highlights
- **Complete MSBuild Integration**: Eliminated CLI tool dependency, moved all build processes to MSBuild with deep Visual Studio integration
- **Modernized Architecture**: Restructured process lifecycle with .NET launching first and running Electron as child process for better control and reliability
- **Cross-Platform Development**: Build and debug Linux applications directly from Windows Visual Studio via WSL integration
@@ -11,6 +22,7 @@
- **Console App Support**: No longer requires ASP.NET - now works with simple console applications for file system or remote server HTML/JS
### Build System & Project Structure
- Eliminated electron.manifest.json configuration file, replaced with MSBuild project properties
- Introduced new package structure: ElectronNET.Core (main package), ElectronNET.Core.Api (API definitions), ElectronNET.Core.AspNet (ASP.NET integration)
- Added Runtime Identifier (RID) selection as part of project configuration
@@ -19,19 +31,22 @@
- Added custom MSBuild tasks for Electron-specific build operations
### Development Experience
- Implemented unpackaged run-mode for development using regular .NET builds with unpackaged Electron configuration
- Added support for building Linux packages on Windows via WSL integration
- Enabled running and debugging Linux application outputs on Windows through WSL
- Integrated TypeScript compilation with ASP.NET tooling for consistent builds
- Added process orchestration supporting 8 different launch scenarios (packaged/unpackaged × console/ASP.NET × dotnet-first/electron-first)
- Added process orchestration supporting 8 different launch scenarios (packaged/unpackaged × console/ASP.NET × dotnet-first/electron-first)
### Debugging & Runtime
- Dramatically improved debugging experience with ASP.NET-first launch mode
- Added Hot Reload support for ASP.NET code during development
- Implemented proper process termination handling for all exit scenarios
- Minimized startup times through optimized build and launch procedures
### Technical Improvements
- Enhanced splash screen handling with automatic path resolution
- Improved ElectronHostHook integration as proper npm package dependency
- Updated to latest TypeScript version with ESLint configuration
@@ -40,6 +55,7 @@
- Added build-time Electron version compatibility validation
### Package & Distribution
- Integrated MSBuild publishing mechanisms for creating Electron packages
- Added folder publishing support with improved parameter handling
- Implemented automated package.json generation from MSBuild properties
@@ -47,6 +63,7 @@
- Reduced package sizes by eliminating unnecessary TypeScript dependencies
### Migration & Compatibility
- Maintained backward compatibility for existing ElectronHostHook implementations
- Removed ASP.NET requirement: Now works with simple console applications for file system or remote server HTML/JS scenarios
- Added support for both console and ASP.NET Core application types
@@ -54,4 +71,3 @@
- Added migration path for existing projects through updated package structure
This represents a comprehensive modernization of Electron.NET, addressing the major pain points around debugging, build complexity, and platform limitations while maintaining full API compatibility.

View File

@@ -2,43 +2,40 @@
[![donate](https://img.shields.io/badge/Donate-Donorbox-green.svg)](https://donorbox.org/electron-net) [![Gitter](https://badges.gitter.im/ElectronNET/community.svg)](https://gitter.im/ElectronNET/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Build status](https://github.com/ElectronNET/Electron.NET/actions/workflows/ci.yml/badge.svg)](https://github.com/ElectronNET/Electron.NET/actions/workflows/ci.yml)
# Electron.Net Core is here!
# Electron.NET Core is here!
## A Complete Transformation
ElectronNET.Core represents a fundamental modernization of Electron.NET, addressing years of accumulated pain points while preserving full API compatibility. This isn't just an updateit's a complete rethinking of how .NET developers build and debug cross-platform desktop applications with Electron.
`ElectronNET.Core` represents a fundamental modernization of Electron.NET, addressing years of accumulated pain points while preserving full API compatibility. This isn't just an updateit's a complete rethinking of how .NET developers build and debug cross-platform desktop applications with Electron.
Read more: [**What's New in ElectronNET.Core**](wiki/What's-New)
Build cross platform desktop applications with .NET 6/8 - from console apps to ASP.Net Core (Razor Pages, MVC) to Blazor
Read more: [**What's New in `ElectronNET.Core`**](https://github.com/ElectronNET/Electron.NET/wiki/What's-New)
Build cross platform desktop applications with .NET 6/8/10 - from console apps to ASP.NET Core (Razor Pages, MVC) to Blazor.
## Wait - how does that work exactly?
Well... there are lots of different approaches how to get a X-plat desktop app running. Electron.NET provides a range of ways to build .NET based solutions using Electron at the side of presentation. While the classic Electron.Net setup, using an ASP.Net host ran by the Electron side is still the primary way, there's more flexibility now: both, dotnet and Electron are now able to launch the other for better lifetime management, and when you don't need a local web server - like when running content from files or remote servers, you can drop the ASP.Net stack altogether and got with a lightweight console app instead.
Well... there are lots of different approaches how to get a X-plat desktop app running. Electron.NET provides a range of ways to build .NET based solutions using Electron at the side of presentation.
While the classic Electron.NET setup, using an ASP.NET host ran by the Electron side is still the primary way, there's more flexibility now: both, dotnet and Electron are now able to launch the other for better lifetime management, and when you don't need a local web server - like when running content from files or remote servers, you can drop the ASP.NET stack altogether and got with a lightweight console app instead.
## 📦 NuGet
[![NuGet](https://img.shields.io/nuget/v/ElectronNET.Core.svg?style=flat-square) ElectronNET.Core ](https://www.nuget.org/packages/ElectronNET.Core.API/) | [![NuGet](https://img.shields.io/nuget/v/ElectronNET.Core.API.svg?style=flat-square) ElectronNET.Core.API ](https://www.nuget.org/packages/ElectronNET.Core.API/) | [![NuGet](https://img.shields.io/nuget/v/ElectronNET.Core.AspNet.svg?style=flat-square) ElectronNET.Core.AspNet ](https://www.nuget.org/packages/ElectronNET.Core.AspNet/)
* ElectronNET.Core: [![NuGet](https://img.shields.io/nuget/v/ElectronNET.Core.svg?style=flat-square)](https://www.nuget.org/packages/ElectronNET.Core.API/)
* ElectronNET.Core.API: [![NuGet](https://img.shields.io/nuget/v/ElectronNET.Core.API.svg?style=flat-square)](https://www.nuget.org/packages/ElectronNET.Core.API/)
* ElectronNET.Core.AspNet: [![NuGet](https://img.shields.io/nuget/v/ElectronNET.Core.AspNet.svg?style=flat-square)](https://www.nuget.org/packages/ElectronNET.Core.AspNet/)
## 🛠 Requirements to Run
Our API uses .NET 6/8, so our
You should have installed:
Also you should have installed:
* .NET 6/8 or later.
* The minimum base OS is the same as [.NET 6](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md) / [.NET 8](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md).
* Node.JS using at least [Version 22.x](https://nodejs.org).
* .NET 6/8 or later
* OS
minimum base OS is the same as [.NET 6](https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.md) / [.NET 8](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md).
* NodeJS (at least [Version 22.x](https://nodejs.org))
## 👩‍🏫 Usage with ASP.NET
## 👩‍🏫 Usage with ASP.Net
- Create a new ASP.Net Core project
- Install the following two nuget packages:
- Create a new ASP.NET Core project
- Install the following two NuGet packages:
```ps1
dotnet add package ElectronNET.Core
@@ -46,14 +43,16 @@ dotnet add package ElectronNET.Core
dotnet add package ElectronNET.Core.AspNet
```
### Enable Electron.NET on Startup
### Classic ASP.NET Core
#### Enable Electron.NET on Startup
To do so, use the `UseElectron` extension method on a `WebApplicationBuilder`, an `IWebHostBuilder` or any descendants.
> [!NOTE]
> New in Electron.NET Core is that you provide a callback method as an argument to `UseElectron()`, which ensures that you get to know the right moment to set up your application UI.
### Program.cs
#### Program.cs
```csharp
using ElectronNET.API;
@@ -68,7 +67,7 @@ using ElectronNET.API.Entities;
.Run();
}
public static async Task ElectronAppReady()
public static async Task ElectronAppReady()
{
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
new BrowserWindowOptions { Show = false });
@@ -77,11 +76,46 @@ using ElectronNET.API.Entities;
}
```
### Minimal API Example
For a minimal API you can use:
```csharp
using ElectronNET;
using ElectronNET.API;
using ElectronNET.API.Entities;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddElectron(); // <- might be useful to set up DI
builder.UseElectron(args, async () =>
{
var browserWindow = await Electron.WindowManager.CreateWindowAsync(
new BrowserWindowOptions { Show = false, AutoHideMenuBar = true });
browserWindow.OnReadyToShow += () => browserWindow.Show();
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
}
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapRazorPages();
app.Run();
```
## 🚀 Starting and Debugging the Application
Just press F5 in Visual Studio or use dotnet for debugging.
Just press `F5` in Visual Studio or use dotnet for debugging.
## 📔 Usage of the Electron API
@@ -92,13 +126,11 @@ In this YouTube video, we show you how you can create a new project, use the Ele
> [!NOTE]
> The video hasn't been updated for the changes in ElectronNET.Core, so it is partially outdated.
## 👨‍💻 Authors
* **[Gregor Biswanger](https://github.com/GregorBiswanger)** - (Microsoft MVP, Intel Black Belt and Intel Software Innovator) is a freelance lecturer, consultant, trainer, author and speaker. He is a consultant for large and medium-sized companies, organizations and agencies for software architecture, web- and cross-platform development. You can find Gregor often on the road attending or speaking at international conferences. - [Cross-Platform-Blog](http://www.cross-platform-blog.com) - Twitter [@BFreakout](https://www.twitter.com/BFreakout)
* **[Dr. Florian Rappl](https://github.com/FlorianRappl)** - Software Developer - from Munich, Germany. Microsoft MVP & Web Geek. - [The Art of Micro Frontends](https://microfrontends.art) - [Homepage](https://florian-rappl.de) - Twitter [@florianrappl](https://twitter.com/florianrappl)
* [**softworkz**](https://github.com/softworkz) - full range developer - likes to start where others gave up - MS MVP alumni and Munich citizen as well
* **[softworkz](https://github.com/softworkz)** - Full Range Developer - likes to start where others gave up. MS MVP alumni and Munich citizen as well.
* **[Robert Muehsig](https://github.com/robertmuehsig)** - Software Developer - from Dresden, Germany, now living & working in Switzerland. Microsoft MVP & Web Geek. - [codeinside Blog](https://blog.codeinside.eu) - Twitter [@robert0muehsig](https://twitter.com/robert0muehsig)
See also the list of [contributors](https://github.com/ElectronNET/Electron.NET/graphs/contributors) who participated in this project.
@@ -108,7 +140,6 @@ See also the list of [contributors](https://github.com/ElectronNET/Electron.NET/
Feel free to submit a pull request if you find any bugs (to see a list of active issues, visit the [Issues section](https://github.com/ElectronNET/Electron.NET/issues).
Please make sure all commits are properly documented.
## 🙏 Donate
We do this open source work in our free time. If you'd like us to invest more time on it, please [donate](https://donorbox.org/electron-net). Donation can be used to increase some issue priority. Thank you!
@@ -124,9 +155,7 @@ Any support appreciated! 🍻
## 🎉 License
MIT-licensed. See [LICENSE](./LICENSE) for details.
MIT-licensed. See [LICENSE](https://github.com/ElectronNET/Electron.NET/blob/main/LICENSE) for details.
**Enjoy!**

View File

@@ -103,7 +103,7 @@ class Build : NukeBuild
VersionPostFix = $"-pre";
}
Log.Information("Building version: {Version}", Version);
Log.Information("Building version {Version} with postfix {VersionPostFix}", Version, VersionPostFix);
}
Target Clean => _ => _

View File

@@ -48,7 +48,9 @@ public class BrowserWindow
_readyToShow -= value;
if (_readyToShow == null)
{
BridgeConnector.Socket.Off("browserWindow-ready-to-show" + Id);
}
}
}
@@ -77,7 +79,9 @@ public class BrowserWindow
_pageTitleUpdated -= value;
if (_pageTitleUpdated == null)
{
BridgeConnector.Socket.Off("browserWindow-page-title-updated" + Id);
}
}
}
@@ -106,7 +110,9 @@ public class BrowserWindow
_close -= value;
if (_close == null)
{
BridgeConnector.Socket.Off("browserWindow-close" + Id);
}
}
}
@@ -137,7 +143,9 @@ public class BrowserWindow
_closed -= value;
if (_closed == null)
{
BridgeConnector.Socket.Off("browserWindow-closed" + Id);
}
}
}
@@ -166,7 +174,9 @@ public class BrowserWindow
_sessionEnd -= value;
if (_sessionEnd == null)
{
BridgeConnector.Socket.Off("browserWindow-session-end" + Id);
}
}
}
@@ -195,7 +205,9 @@ public class BrowserWindow
_unresponsive -= value;
if (_unresponsive == null)
{
BridgeConnector.Socket.Off("browserWindow-unresponsive" + Id);
}
}
}
@@ -224,7 +236,9 @@ public class BrowserWindow
_responsive -= value;
if (_responsive == null)
{
BridgeConnector.Socket.Off("browserWindow-responsive" + Id);
}
}
}
@@ -253,7 +267,9 @@ public class BrowserWindow
_blur -= value;
if (_blur == null)
{
BridgeConnector.Socket.Off("browserWindow-blur" + Id);
}
}
}
@@ -282,7 +298,9 @@ public class BrowserWindow
_focus -= value;
if (_focus == null)
{
BridgeConnector.Socket.Off("browserWindow-focus" + Id);
}
}
}
@@ -311,7 +329,9 @@ public class BrowserWindow
_show -= value;
if (_show == null)
{
BridgeConnector.Socket.Off("browserWindow-show" + Id);
}
}
}
@@ -340,7 +360,9 @@ public class BrowserWindow
_hide -= value;
if (_hide == null)
{
BridgeConnector.Socket.Off("browserWindow-hide" + Id);
}
}
}
@@ -369,7 +391,9 @@ public class BrowserWindow
_maximize -= value;
if (_maximize == null)
{
BridgeConnector.Socket.Off("browserWindow-maximize" + Id);
}
}
}
@@ -398,7 +422,9 @@ public class BrowserWindow
_unmaximize -= value;
if (_unmaximize == null)
{
BridgeConnector.Socket.Off("browserWindow-unmaximize" + Id);
}
}
}
@@ -427,7 +453,9 @@ public class BrowserWindow
_minimize -= value;
if (_minimize == null)
{
BridgeConnector.Socket.Off("browserWindow-minimize" + Id);
}
}
}
@@ -456,7 +484,9 @@ public class BrowserWindow
_restore -= value;
if (_restore == null)
{
BridgeConnector.Socket.Off("browserWindow-restore" + Id);
}
}
}
@@ -485,7 +515,9 @@ public class BrowserWindow
_resize -= value;
if (_resize == null)
{
BridgeConnector.Socket.Off("browserWindow-resize" + Id);
}
}
}
@@ -516,7 +548,9 @@ public class BrowserWindow
_move -= value;
if (_move == null)
{
BridgeConnector.Socket.Off("browserWindow-move" + Id);
}
}
}
@@ -545,7 +579,9 @@ public class BrowserWindow
_moved -= value;
if (_moved == null)
{
BridgeConnector.Socket.Off("browserWindow-moved" + Id);
}
}
}
@@ -574,7 +610,9 @@ public class BrowserWindow
_enterFullScreen -= value;
if (_enterFullScreen == null)
{
BridgeConnector.Socket.Off("browserWindow-enter-full-screen" + Id);
}
}
}
@@ -603,7 +641,9 @@ public class BrowserWindow
_leaveFullScreen -= value;
if (_leaveFullScreen == null)
{
BridgeConnector.Socket.Off("browserWindow-leave-full-screen" + Id);
}
}
}
@@ -632,7 +672,9 @@ public class BrowserWindow
_enterHtmlFullScreen -= value;
if (_enterHtmlFullScreen == null)
{
BridgeConnector.Socket.Off("browserWindow-enter-html-full-screen" + Id);
}
}
}
@@ -661,7 +703,9 @@ public class BrowserWindow
_leaveHtmlFullScreen -= value;
if (_leaveHtmlFullScreen == null)
{
BridgeConnector.Socket.Off("browserWindow-leave-html-full-screen" + Id);
}
}
}
@@ -696,7 +740,9 @@ public class BrowserWindow
_appCommand -= value;
if (_appCommand == null)
{
BridgeConnector.Socket.Off("browserWindow-app-command" + Id);
}
}
}
@@ -725,7 +771,9 @@ public class BrowserWindow
_swipe -= value;
if (_swipe == null)
{
BridgeConnector.Socket.Off("browserWindow-swipe" + Id);
}
}
}
@@ -754,7 +802,9 @@ public class BrowserWindow
_sheetBegin -= value;
if (_sheetBegin == null)
{
BridgeConnector.Socket.Off("browserWindow-sheet-begin" + Id);
}
}
}
@@ -783,7 +833,9 @@ public class BrowserWindow
_sheetEnd -= value;
if (_sheetEnd == null)
{
BridgeConnector.Socket.Off("browserWindow-sheet-end" + Id);
}
}
}
@@ -812,7 +864,9 @@ public class BrowserWindow
_newWindowForTab -= value;
if (_newWindowForTab == null)
{
BridgeConnector.Socket.Off("browserWindow-new-window-for-tab" + Id);
}
}
}
@@ -1055,6 +1109,25 @@ public class BrowserWindow
return taskCompletionSource.Task;
}
/// <summary>
/// This will make a window maintain an aspect ratio. The extra size allows a developer to have space,
/// specified in pixels, not included within the aspect ratio calculations. This API already takes into
/// account the difference between a windows size and its content size.
///
/// Consider a normal window with an HD video player and associated controls.Perhaps there are 15 pixels
/// of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below
/// the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within
/// the player itself we would call this function with arguments of 16/9 and[40, 50]. The second argument
/// doesnt care where the extra width and height are within the content viewonly that they exist. Just
/// sum any extra width and height areas you have within the overall content view.
/// </summary>
/// <param name="aspectRatio">The aspect ratio to maintain for some portion of the content view.</param>
/// <param name="extraSize">The extra size not to be included while maintaining the aspect ratio.</param>
public void SetAspectRatio(double aspectRatio, Size extraSize)
{
BridgeConnector.Socket.Emit("browserWindowSetAspectRatio", Id, aspectRatio, JObject.FromObject(extraSize, _jsonSerializer));
}
/// <summary>
/// This will make a window maintain an aspect ratio. The extra size allows a developer to have space,
/// specified in pixels, not included within the aspect ratio calculations. This API already takes into

View File

@@ -48,7 +48,7 @@ namespace ElectronNET.API
public Task<string[]> ShowOpenDialogAsync(BrowserWindow browserWindow, OpenDialogOptions options)
{
var taskCompletionSource = new TaskCompletionSource<string[]>();
string guid = Guid.NewGuid().ToString();
var guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On("showOpenDialogComplete" + guid, (filePaths) =>
{
@@ -75,7 +75,7 @@ namespace ElectronNET.API
public Task<string> ShowSaveDialogAsync(BrowserWindow browserWindow, SaveDialogOptions options)
{
var taskCompletionSource = new TaskCompletionSource<string>();
string guid = Guid.NewGuid().ToString();
var guid = Guid.NewGuid().ToString();
BridgeConnector.Socket.On("showSaveDialogComplete" + guid, (filename) =>
{

View File

@@ -30,7 +30,7 @@ public class PrintToPDFOptions
/// `A5`, `A6`, `Legal`, `Letter`, `Tabloid`, `Ledger`, or an Object containing
/// `height` and `width` in inches. Defaults to `Letter`.
/// </summary>
public string PageSize { get; set; } = "Letter";
public object PageSize { get; set; } = "Letter";
/// <summary>
/// Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string,

View File

@@ -38,9 +38,20 @@
public bool Sandboxed { get; set; }
/// <summary>
/// One of the following values:
/// One of the following values:
/// untrusted | low | medium | high | unknown
/// </summary>
public string IntegrityLevel { get; set; }
/// <summary>
/// The name of the process.
/// Examples for utility: Audio Service, Content Decryption Module Service, Network Service, Video Capture, etc.
/// </summary>
public string Name { get; set; }
/// <summary>
/// The non-localized name of the process.
/// </summary>
public string ServiceName { get; set; }
}
}

View File

@@ -20,6 +20,7 @@
</ItemGroup>
<ItemGroup>
<None Include="PackageIcon.png" Pack="true" PackagePath="\" />
<None Include="../../README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">

View File

@@ -136,18 +136,26 @@
buildInfo.ElectronExecutable = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.ElectronExecutable))?.Value;
buildInfo.ElectronVersion = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.ElectronVersion))?.Value;
buildInfo.RuntimeIdentifier = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.RuntimeIdentifier))?.Value;
buildInfo.ElectronSingleInstance = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.ElectronSingleInstance))?.Value;
buildInfo.Title = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.Title))?.Value;
buildInfo.Version = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.Version))?.Value;
buildInfo.BuildConfiguration = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.BuildConfiguration))?.Value;
var isAspNet = attributes.FirstOrDefault(e => e.Key == "IsAspNet")?.Value;
var isSingleInstance = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.ElectronSingleInstance))?.Value;
var httpPort = attributes.FirstOrDefault(e => e.Key == "AspNetHttpPort")?.Value;
if (isAspNet?.Length > 0 && bool.TryParse(isAspNet, out var res) && res)
if (isAspNet?.Length > 0 && bool.TryParse(isAspNet, out var isAspNetActive) && isAspNetActive)
{
ElectronNetRuntime.DotnetAppType = DotnetAppType.AspNetCoreApp;
}
var httpPort = attributes.FirstOrDefault(e => e.Key == "AspNetHttpPort")?.Value;
if (isSingleInstance?.Length > 0 && bool.TryParse(isSingleInstance, out var isSingleInstanceActive) && isSingleInstanceActive)
{
buildInfo.ElectronSingleInstance = "yes";
}
else
{
buildInfo.ElectronSingleInstance = "no";
}
if (httpPort?.Length > 0 && int.TryParse(httpPort, out var port))
{

View File

@@ -31,6 +31,7 @@
</ItemGroup>
<ItemGroup>
<None Include="PackageIcon.png" Pack="true" PackagePath="\" />
<None Include="../../README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">

View File

@@ -69,7 +69,7 @@
<ProjectReference Include="..\ElectronNET.API\ElectronNET.API.csproj" Condition="$(ElectronNetDevMode)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ElectronNET.Core" Version="0.0.18" Condition="'$(ElectronNetDevMode)' != 'True'" />
<PackageReference Include="ElectronNET.Core" Version="0.1.0" Condition="'$(ElectronNetDevMode)' != 'True'" />
</ItemGroup>
<Import Project="..\ElectronNET\build\ElectronNET.targets" Condition="$(ElectronNetDevMode)" />

View File

@@ -93,7 +93,7 @@ app.on('will-finish-launching', () => {
const manifestJsonFile = require(manifestJsonFilePath);
if (manifestJsonFile.singleInstance) {
if (manifestJsonFile.singleInstance === "yes") {
const mainInstance = app.requestSingleInstanceLock();
app.on('second-instance', (events, args = []) => {
args.forEach((parameter) => {
@@ -205,7 +205,8 @@ function isSplashScreenEnabled() {
}
function startSplashScreen() {
let imageFile = path.join(currentPath, manifestJsonFile.splashscreen.imageFile);
const imageFile = path.join(currentPath, manifestJsonFile.splashscreen.imageFile);
const isHtml = imageFile.endsWith('.html') || imageFile.endsWith('.htm');
const startWindow = (width, height) => {
splashScreen = new BrowserWindow({
width: width,
@@ -225,7 +226,7 @@ function startSplashScreen() {
splashScreen.destroy();
});
const loadSplashscreenUrl = path.join(currentPath, 'splashscreen', 'index.html') + '?imgPath=' + imageFile;
const loadSplashscreenUrl = isHtml ? imageFile : path.join(currentPath, 'splashscreen', 'index.html') + '?imgPath=' + imageFile;
splashScreen.loadURL('file://' + loadSplashscreenUrl);
splashScreen.once('closed', () => {
splashScreen = null;
@@ -233,10 +234,16 @@ function startSplashScreen() {
};
if (manifestJsonFile.splashscreen.width && manifestJsonFile.splashscreen.height) {
startWindow(manifestJsonFile.splashscreen.width, manifestJsonFile.splashscreen.height);
return;
// width and height are set explicitly
return startWindow(manifestJsonFile.splashscreen.width, manifestJsonFile.splashscreen.height);
}
if (isHtml) {
// we cannot compute width and height => use default
return startWindow(800, 600);
}
// it's an image, so we can compute the desired splash screen size
imageSize(imageFile, (error, dimensions) => {
if (error) {
console.log(`load splashscreen error:`);

View File

@@ -15,7 +15,7 @@
}
</style>
<img draggable="false" alt="splashscreen" style="width: 100%; height: 100%;">
<img draggable="false" alt="splashscreen" style="width: 100%; height: 100%; margin: 0">
<script>
(() => {

View File

@@ -475,9 +475,10 @@
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -796,26 +797,6 @@
"node": ">=10.0.0"
}
},
"node_modules/engine.io/node_modules/ws": {
"version": "8.17.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": ">=5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
},
"node_modules/es6-promise": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz",
@@ -1819,11 +1800,13 @@
}
},
"node_modules/socket.io-adapter": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz",
"integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==",
"version": "2.5.5",
"resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz",
"integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==",
"license": "MIT",
"dependencies": {
"ws": "~8.11.0"
"debug": "~4.3.4",
"ws": "~8.17.1"
}
},
"node_modules/socket.io-parser": {
@@ -2040,15 +2023,16 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
"node_modules/ws": {
"version": "8.11.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
"version": "8.17.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
"utf-8-validate": ">=5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
@@ -2427,9 +2411,9 @@
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -2678,14 +2662,6 @@
"debug": "~4.3.1",
"engine.io-parser": "~5.2.1",
"ws": "~8.17.1"
},
"dependencies": {
"ws": {
"version": "8.17.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"requires": {}
}
}
},
"engine.io-parser": {
@@ -3466,11 +3442,12 @@
}
},
"socket.io-adapter": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz",
"integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==",
"version": "2.5.5",
"resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz",
"integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==",
"requires": {
"ws": "~8.11.0"
"debug": "~4.3.4",
"ws": "~8.17.1"
}
},
"socket.io-parser": {
@@ -3646,9 +3623,9 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
"ws": {
"version": "8.11.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
"version": "8.17.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
"requires": {}
},
"yocto-queue": {

View File

@@ -71,8 +71,8 @@
<ProjectReference Include="..\ElectronNET.AspNet\ElectronNET.AspNet.csproj" Condition="$(ElectronNetDevMode)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ElectronNET.Core" Version="0.0.18" Condition="'$(ElectronNetDevMode)' != 'True'" />
<PackageReference Include="ElectronNET.Core.AspNet" Version="0.0.18" Condition="'$(ElectronNetDevMode)' != 'True'" />
<PackageReference Include="ElectronNET.Core" Version="0.1.0" Condition="'$(ElectronNetDevMode)' != 'True'" />
<PackageReference Include="ElectronNET.Core.AspNet" Version="0.1.0" Condition="'$(ElectronNetDevMode)' != 'True'" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.9.3" />
</ItemGroup>

View File

@@ -13,6 +13,7 @@
</PropertyGroup>
<ItemGroup>
<None Include="PackageIcon.png" Pack="true" PackagePath="\" />
<None Include="../../README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<Folder Include=".electron\" />

View File

@@ -151,14 +151,14 @@
BeforeTargets="AssignTargetPaths"
DependsOnTargets="ElectronResolvePaths">
<PropertyGroup Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'">
<PropertyGroup Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'">
<_NonIntermediatePublishDir>$(PublishDir)</_NonIntermediatePublishDir>
<PublishUrl>$(PublishDir)</PublishUrl>
<PublishDir>$(IntermediateOutputPath)PubTmp\</PublishDir>
</PropertyGroup>
<RemoveDir Directories="$(PublishDir);$(PublishUrl)" Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'" />
<MakeDir Directories="$(PublishDir);$(PublishUrl)" Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'" />
<RemoveDir Directories="$(PublishDir);$(PublishUrl)" Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'" />
<MakeDir Directories="$(PublishDir);$(PublishUrl)" Condition="'$(UsingMicrosoftNETSdkWeb)' != 'true'" />
</Target>
@@ -345,6 +345,7 @@
<PropertyGroup>
<_OriginalPublishDir>$(PublishDir)</_OriginalPublishDir>
<PublishDir>$(_OriginalPublishDir)bin\</PublishDir>
<PublishUrl>$(PublishDir)</PublishUrl>
<DeleteExistingFiles>true</DeleteExistingFiles>
</PropertyGroup>
@@ -460,13 +461,10 @@
</PropertyGroup>
<PropertyGroup>
<_NpxCmd>npx electron-builder --config=./$(ElectronBuilderJson) --$(ElectronPlatform) --$(ElectronArch) -c.electronVersion=$(ElectronVersion) -c.directories.output &quot;$(ElectronPublishUrlFullPath)&quot; $(ElectronPaParams)</_NpxCmd>
<_NpxCmd>npx electron-builder --config=./$(ElectronBuilderJson) --$(ElectronPlatform) --$(ElectronArch) -c.electronVersion=$(ElectronVersion) $(ElectronPaParams)</_NpxCmd>
<_NpxCmd Condition="'$(IsLinuxWsl)' == 'true'">wsl bash -ic '$(_NpxCmd)'</_NpxCmd>
</PropertyGroup>
<!--<Message Importance="High" Text="ElectronDumpInfo: ElectronPublishUrlFullPath: $(ElectronPublishUrlFullPath)" />-->
<!--<Message Importance="High" Text="ElectronDumpInfo: _NpxCmd: $(_NpxCmd)" />-->
<Exec Command="$(_NpxCmd)" WorkingDirectory="$(ElectronPublishDirFullPath)" Timeout="900000" StandardOutputImportance="High" StandardErrorImportance="High" ContinueOnError="false" Condition="@(CopiedFiles->Count()) > 0">
<Output TaskParameter="ExitCode" PropertyName="ExecExitCode"/>
</Exec>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.0.18.0</Version>
<Version>0.1.0.0</Version>
<PackageNamePrefix>ElectronNET.Core</PackageNamePrefix>
<Authors>Gregor Biswanger, Florian Rappl, softworkz</Authors>
<Product>Electron.NET</Product>
@@ -10,6 +10,7 @@
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageTags>electron aspnetcore</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>Changelog: https://github.com/ElectronNET/Electron.NET/blob/main/Changelog.md</PackageReleaseNotes>
<PackageIcon>PackageIcon.png</PackageIcon>
<DescriptionFirstPart>Building cross platform electron based desktop apps with .NET Core and - optionally - ASP.NET Core.</DescriptionFirstPart>