Hotfix Win10 (Closes #1529) and installer (Closes #1528) (#1260)

This commit is contained in:
2026-01-11 15:43:28 +01:00
parent 4c29a5617b
commit 33f8f73066
2 changed files with 30 additions and 12 deletions
+5 -5
View File
@@ -311,11 +311,11 @@ var mode = args.Length > 1
var workingDirectory = args.Length > 2
? args[1] : Path.GetFullPath("..", AppContext.BaseDirectory);
if (args.Length > 1 && args[1] is "update")
{
await PerformUpdate(workingDirectory);
}
else
if (mode is "install")
{
await PerformFreshInstall(workingDirectory);
}
else
{
await PerformUpdate(workingDirectory);
}
+25 -7
View File
@@ -8,6 +8,7 @@ using Photino.Blazor;
using Serilog;
using Serilog.Events;
using Serilog.Sinks.SystemConsole.Themes;
using System.Extensions.Core;
using System.Runtime.InteropServices;
namespace Daybreak.Launch;
@@ -73,13 +74,30 @@ public partial class Launcher
private static void SetupRoundedWindows(PhotinoBlazorApp app)
{
var hwnd = app.MainWindow.WindowHandle;
var preference = NativeMethods.DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND;
NativeMethods.DwmSetWindowAttribute(
hwnd,
NativeMethods.DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE,
ref preference,
sizeof(uint));
var scopedLogger = app.Services.GetRequiredService<ILogger<Launcher>>().CreateScopedLogger();
try
{
// DWMWA_WINDOW_CORNER_PREFERENCE is only supported on Windows 11 (Build 22000+)
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
{
scopedLogger.LogWarning("Rounded corners are not supported on this version of Windows.");
return;
}
var hwnd = app.MainWindow.WindowHandle;
var preference = NativeMethods.DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND;
NativeMethods.DwmSetWindowAttribute(
hwnd,
NativeMethods.DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE,
ref preference,
sizeof(uint));
scopedLogger.LogDebug("Setup rounded corners");
}
catch (Exception ex)
{
scopedLogger.LogError(ex, "Failed to set rounded corners on window.");
}
}
private static void SetupBorderless(PhotinoBlazorApp app)