Skip to content

Commit

Permalink
Fix: Sanitize AppName in MakeShortcutCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamsyntax committed Nov 29, 2024
1 parent 0037b18 commit a939ed5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)!);
Expand All @@ -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(),
Expand Down

0 comments on commit a939ed5

Please sign in to comment.