Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed ElectronNET-API-Demos/Assets/electron.ico
Binary file not shown.
Binary file removed ElectronNET-API-Demos/Assets/electron_32x32.png
Binary file not shown.
8 changes: 0 additions & 8 deletions ElectronNET-API-Demos/ElectronNET-API-Demos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.15" />
</ItemGroup>
<ItemGroup>
<None Update="Assets\electron.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\electron_32x32.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Update="ElectronHostHook\**\*.*">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
Expand Down
9 changes: 9 additions & 0 deletions ElectronNET-API-Demos/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.IO;
using System.Runtime.InteropServices;

namespace ElectronNET.WebApp
{
Expand Down Expand Up @@ -51,8 +54,14 @@ public async void ElectronBootstrap()
{
//AddDevelopmentTests();

var iconFile =
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "win/app.ico" :
RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "mac/app.icns" :
"png/128.png";

var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
{
Icon = Path.Join(AppContext.BaseDirectory, $"wwwroot/assets/app-icon/{iconFile}"),
Width = 1152,
Height = 940,
Show = false
Expand Down
2 changes: 1 addition & 1 deletion ElectronNET-API-Demos/electron.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"buildVersion": "23.6.1",
"compression": "maximum",
"win": {
"icon": "Assets/electron.ico",
"icon": "bin/wwwroot/assets/app-icon/win/app.ico",
"publish": [
{
"provider": "github",
Expand Down