fixed windows issues
This commit is contained in:
parent
99a5934575
commit
4e6ea6f22b
@ -115,13 +115,13 @@ func (i *InstanceManager)checkJavaVersion(instance Instance){
|
|||||||
for sc.Scan() {
|
for sc.Scan() {
|
||||||
line := sc.Text()
|
line := sc.Text()
|
||||||
if strings.HasPrefix(line, "JavaPath=") {
|
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
|
found = true
|
||||||
}
|
}
|
||||||
f.WriteString(line+"\n")
|
f.WriteString(line+"\n")
|
||||||
}
|
}
|
||||||
if !found {
|
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(line+"\n")
|
||||||
f.WriteString("OverrideJavaLocation=true\nOverrideJava=true\n")
|
f.WriteString("OverrideJavaLocation=true\nOverrideJava=true\n")
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ func (p *Prism) Install() {
|
|||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
if strings.HasPrefix(line, "JavaPath") {
|
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") {
|
if strings.HasPrefix(line, "LastHostname") {
|
||||||
host, _ := os.Hostname()
|
host, _ := os.Hostname()
|
||||||
|
Loading…
Reference in New Issue
Block a user