From 4e6ea6f22b026053cdd9fdcfa17ef76f354c397f Mon Sep 17 00:00:00 2001 From: Samuel Walker Date: Sat, 26 Oct 2024 22:33:33 -0600 Subject: [PATCH] fixed windows issues --- fclauncher/InstanceManager.go | 4 ++-- fclauncher/Prism.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fclauncher/InstanceManager.go b/fclauncher/InstanceManager.go index 2c79b15..bbb4ea0 100644 --- a/fclauncher/InstanceManager.go +++ b/fclauncher/InstanceManager.go @@ -115,13 +115,13 @@ func (i *InstanceManager)checkJavaVersion(instance Instance){ for sc.Scan() { line := sc.Text() if strings.HasPrefix(line, "JavaPath=") { - line = fmt.Sprintf("JavaPath=%s/FCLauncher/java/java-%d-%s/bin/%s", confDir, javaVer, plat, exe) + line = fmt.Sprintf("JavaPath=%s/FCLauncher/java/java-%d-%s/bin/%s", strings.ReplaceAll(confDir, "\\", "/"), javaVer, plat, exe) found = true } f.WriteString(line+"\n") } if !found { - line := fmt.Sprintf("JavaPath=%s/FCLauncher/java/java-%d-%s/bin/%s", confDir, javaVer, plat, exe) + line := fmt.Sprintf("JavaPath=%s/FCLauncher/java/java-%d-%s/bin/%s", strings.ReplaceAll(confDir, "\\", "/"), javaVer, plat, exe) f.WriteString(line+"\n") f.WriteString("OverrideJavaLocation=true\nOverrideJava=true\n") } diff --git a/fclauncher/Prism.go b/fclauncher/Prism.go index 425ed4b..1fdae9d 100644 --- a/fclauncher/Prism.go +++ b/fclauncher/Prism.go @@ -122,7 +122,7 @@ func (p *Prism) Install() { for scanner.Scan() { line := scanner.Text() if strings.HasPrefix(line, "JavaPath") { - line = fmt.Sprintf("JavaPath=%s/FCLauncher/java/java-21-%s", dir, shortSuffix) + line = fmt.Sprintf("JavaPath=%s/FCLauncher/java/java-21-%s", strings.ReplaceAll(dir, "\\", "/"), shortSuffix) } if strings.HasPrefix(line, "LastHostname") { host, _ := os.Hostname()