diff --git a/ElectronNET-API-Demos/Assets/electron.ico b/ElectronNET-API-Demos/Assets/electron.ico deleted file mode 100644 index 3a10449..0000000 Binary files a/ElectronNET-API-Demos/Assets/electron.ico and /dev/null differ diff --git a/ElectronNET-API-Demos/Assets/electron_32x32.png b/ElectronNET-API-Demos/Assets/electron_32x32.png deleted file mode 100644 index 125dde6..0000000 Binary files a/ElectronNET-API-Demos/Assets/electron_32x32.png and /dev/null differ diff --git a/ElectronNET-API-Demos/ElectronNET-API-Demos.csproj b/ElectronNET-API-Demos/ElectronNET-API-Demos.csproj index 2adbad4..cfd9ca2 100644 --- a/ElectronNET-API-Demos/ElectronNET-API-Demos.csproj +++ b/ElectronNET-API-Demos/ElectronNET-API-Demos.csproj @@ -21,14 +21,6 @@ - - - PreserveNewest - - - PreserveNewest - - Never diff --git a/ElectronNET-API-Demos/Startup.cs b/ElectronNET-API-Demos/Startup.cs index f6c0c33..3d35d65 100644 --- a/ElectronNET-API-Demos/Startup.cs +++ b/ElectronNET-API-Demos/Startup.cs @@ -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 { @@ -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 diff --git a/ElectronNET-API-Demos/electron.manifest.json b/ElectronNET-API-Demos/electron.manifest.json index ad0f1e9..7929c91 100644 --- a/ElectronNET-API-Demos/electron.manifest.json +++ b/ElectronNET-API-Demos/electron.manifest.json @@ -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",