From a939ed5711ee9a203db6ba12ae7a1c0601b58648 Mon Sep 17 00:00:00 2001 From: dreamsyntax Date: Thu, 28 Nov 2024 18:18:23 -0700 Subject: [PATCH] Fix: Sanitize AppName in MakeShortcutCommand Resolves https://github.com/Reloaded-Project/Reloaded-II/issues/481 --- .../Commands/Application/MakeShortcutCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Reloaded.Mod.Launcher.Lib/Commands/Application/MakeShortcutCommand.cs b/source/Reloaded.Mod.Launcher.Lib/Commands/Application/MakeShortcutCommand.cs index ac1d1ccb..a6e231af 100644 --- a/source/Reloaded.Mod.Launcher.Lib/Commands/Application/MakeShortcutCommand.cs +++ b/source/Reloaded.Mod.Launcher.Lib/Commands/Application/MakeShortcutCommand.cs @@ -37,7 +37,7 @@ public void Execute(object? parameter) var shell = (IShellLink) new ShellLink(); var appLocation = ApplicationConfig.GetAbsoluteAppLocation(_config); - shell.SetDescription($"Launch {_config?.Config.AppName} via Reloaded II"); + shell.SetDescription($"Launch {_config?.Config.AppName.SanitizeFileName()} via Reloaded II"); shell.SetPath($"\"{loaderConfig.LauncherPath}\""); shell.SetArguments($"{Constants.ParameterLaunch} \"{appLocation}\""); shell.SetWorkingDirectory(Path.GetDirectoryName(loaderConfig.LauncherPath)!); @@ -62,7 +62,7 @@ public void Execute(object? parameter) // Save the shortcut. var file = (IPersistFile) shell; - var link = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), $"{_config?.Config.AppName} (Reloaded).lnk"); + var link = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), $"{_config?.Config.AppName.SanitizeFileName()} (Reloaded).lnk"); file.Save(link, false); Actions.DisplayMessagebox?.Invoke(Resources.AddAppShortcutCreatedTitle.Get(),