From 10a7834802caa3966f26d50a3666987b301de3ae Mon Sep 17 00:00:00 2001 From: Lars Herschke Date: Fri, 2 Aug 2019 12:24:31 +0200 Subject: [PATCH] backport of #288 --- netx/net/sourceforge/jnlp/util/WindowsDesktopEntry.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/netx/net/sourceforge/jnlp/util/WindowsDesktopEntry.java b/netx/net/sourceforge/jnlp/util/WindowsDesktopEntry.java index dda19cad2..50300104d 100644 --- a/netx/net/sourceforge/jnlp/util/WindowsDesktopEntry.java +++ b/netx/net/sourceforge/jnlp/util/WindowsDesktopEntry.java @@ -99,11 +99,12 @@ public void createWindowsMenu() throws IOException { sl.setIconLocation(iconLocation); ul.setIconLocation(iconLocation); } - sl.saveTo(path + "/" + file.getInformation().getTitle()+ ".lnk"); - ul.saveTo(path + "/Uninstall " + file.getInformation().getTitle() + ".lnk"); + final String link = FileUtils.sanitizeFileName(file.getInformation().getTitle() + ".lnk", '-'); + sl.saveTo(path + "/" + link); + ul.saveTo(path + "/Uninstall " + link); // write shortcuts to list - manageShortcutList(ManageMode.A, path + "/" + file.getInformation().getTitle() + ".lnk"); - manageShortcutList(ManageMode.A, path + "/Uninstall " + file.getInformation().getTitle() + ".lnk"); + manageShortcutList(ManageMode.A, path + "/" + link); + manageShortcutList(ManageMode.A, path + "/Uninstall " + link); } private void manageShortcutList(ManageMode mode, String path) throws IOException {