From 6192bd8dce036299d8bb5f27a6402322498d7941 Mon Sep 17 00:00:00 2001 From: Zukero Date: Fri, 11 Aug 2017 21:31:34 +0200 Subject: [PATCH] Fixed issue with symlinks creatipon in windows for paths containing spaces. --- src/com/gpl/rpg/atcontentstudio/utils/FileUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/utils/FileUtils.java b/src/com/gpl/rpg/atcontentstudio/utils/FileUtils.java index 26ecdd1..643a413 100644 --- a/src/com/gpl/rpg/atcontentstudio/utils/FileUtils.java +++ b/src/com/gpl/rpg/atcontentstudio/utils/FileUtils.java @@ -128,13 +128,13 @@ public class FileUtils { case Windows: System.err.println("Trying the Windows way with mklink"); try { - Runtime.getRuntime().exec("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+linkFile.getAbsolutePath()+" "+targetFile.getAbsolutePath()); + Runtime.getRuntime().exec("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+"\""+linkFile.getAbsolutePath()+"\" \""+targetFile.getAbsolutePath()+"\""); } catch (IOException e1) { e1.printStackTrace(); } - System.err.println("Attempting UAC elevation through VBS script."); if (!linkFile.exists()) { - runWithUac("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+linkFile.getAbsolutePath()+" "+targetFile.getAbsolutePath(), 3, linkFile); + System.err.println("Attempting UAC elevation through VBS script."); + runWithUac("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+"\""+linkFile.getAbsolutePath()+"\" \""+targetFile.getAbsolutePath()+"\"", 3, linkFile); } break; case MacOS: