overwrite icon when creating shortcut

This commit is contained in:
Lightczx
2023-09-11 09:05:03 +08:00
parent 87f7e22022
commit ab2d38b142

View File

@@ -19,7 +19,7 @@ internal sealed partial class ShellLinkInterop : IShellLinkInterop
{ {
string sourceLogoPath = Path.Combine(runtimeOptions.InstalledLocation, "Assets/Logo.ico"); string sourceLogoPath = Path.Combine(runtimeOptions.InstalledLocation, "Assets/Logo.ico");
string targetLogoPath = Path.Combine(runtimeOptions.DataFolder, "ShellLinkLogo.ico"); string targetLogoPath = Path.Combine(runtimeOptions.DataFolder, "ShellLinkLogo.ico");
File.Copy(sourceLogoPath, targetLogoPath); File.Copy(sourceLogoPath, targetLogoPath, true);
IShellLinkW shellLink = (IShellLinkW)new ShellLink(); IShellLinkW shellLink = (IShellLinkW)new ShellLink();
shellLink.SetPath("powershell"); shellLink.SetPath("powershell");