From ab2d38b1425554f4205baa09ff20f2bbfd148319 Mon Sep 17 00:00:00 2001 From: Lightczx <1686188646@qq.com> Date: Mon, 11 Sep 2023 09:05:03 +0800 Subject: [PATCH] overwrite icon when creating shortcut --- src/Snap.Hutao/Snap.Hutao/Core/Shell/ShellLinkInterop.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Shell/ShellLinkInterop.cs b/src/Snap.Hutao/Snap.Hutao/Core/Shell/ShellLinkInterop.cs index 59d49527..796b94b8 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/Shell/ShellLinkInterop.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/Shell/ShellLinkInterop.cs @@ -19,7 +19,7 @@ internal sealed partial class ShellLinkInterop : IShellLinkInterop { string sourceLogoPath = Path.Combine(runtimeOptions.InstalledLocation, "Assets/Logo.ico"); string targetLogoPath = Path.Combine(runtimeOptions.DataFolder, "ShellLinkLogo.ico"); - File.Copy(sourceLogoPath, targetLogoPath); + File.Copy(sourceLogoPath, targetLogoPath, true); IShellLinkW shellLink = (IShellLinkW)new ShellLink(); shellLink.SetPath("powershell");