random tweaks
This commit is contained in:
parent
7c169ce4a7
commit
774b623f1d
@ -12,6 +12,8 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
wruntime "github.com/wailsapp/wails/v2/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Instance struct {
|
type Instance struct {
|
||||||
@ -275,7 +277,9 @@ func (i *InstanceManager)LaunchInstance(instance string) {
|
|||||||
}
|
}
|
||||||
fmt.Printf("Args: %+v", args)
|
fmt.Printf("Args: %+v", args)
|
||||||
child := exec.Command(filepath.Join(dir, "java", fmt.Sprintf("java-%d-%s", instanceObject.JavaVersion, suffix), "bin", execName), args...)
|
child := exec.Command(filepath.Join(dir, "java", fmt.Sprintf("java-%d-%s", instanceObject.JavaVersion, suffix), "bin", execName), args...)
|
||||||
|
wruntime.WindowHide(i.app.Ctx)
|
||||||
data, err := child.CombinedOutput()
|
data, err := child.CombinedOutput()
|
||||||
|
wruntime.WindowShow(i.app.Ctx)
|
||||||
fmt.Printf("Command Output: %s\n", data)
|
fmt.Printf("Command Output: %s\n", data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ type App struct {
|
|||||||
// NewApp creates a new App application struct
|
// NewApp creates a new App application struct
|
||||||
func NewApp() *App {
|
func NewApp() *App {
|
||||||
a := &App{}
|
a := &App{}
|
||||||
a.PrismLauncher = Prism{app: a}
|
|
||||||
a.Java = JavaManager{app: a}
|
a.Java = JavaManager{app: a}
|
||||||
a.Instance = InstanceManager{app: a}
|
a.Instance = InstanceManager{app: a}
|
||||||
a.Modpacks = ModpackManager{app: a}
|
a.Modpacks = ModpackManager{app: a}
|
||||||
@ -49,26 +48,6 @@ func (a *App) CheckPrerequisites() {
|
|||||||
a.Instance.SearchInstances()
|
a.Instance.SearchInstances()
|
||||||
a.Status("Pulling Modpacks")
|
a.Status("Pulling Modpacks")
|
||||||
a.Modpacks.QuerryModpacks()
|
a.Modpacks.QuerryModpacks()
|
||||||
a.Status("Checking Prism")
|
|
||||||
res := a.PrismLauncher.CheckInstalled()
|
|
||||||
if res {
|
|
||||||
a.Status("Prism OK")
|
|
||||||
} else {
|
|
||||||
a.Status("Prism MISSING")
|
|
||||||
a.Status("Installing Prism")
|
|
||||||
a.PrismLauncher.Install()
|
|
||||||
a.Status("Prism Installed")
|
|
||||||
}
|
|
||||||
a.Status("Checking Java 21")
|
|
||||||
res = a.Java.CheckJavaVer(21)
|
|
||||||
if res {
|
|
||||||
a.Status("Java 21 OK")
|
|
||||||
} else {
|
|
||||||
a.Status("Java 21 MISSING")
|
|
||||||
a.Status("Installing Java 21")
|
|
||||||
a.Java.InstallJavaVer(21)
|
|
||||||
a.Status("Java 21 Installed")
|
|
||||||
}
|
|
||||||
a.Status("Logging in with Microsoft")
|
a.Status("Logging in with Microsoft")
|
||||||
dir, _ := os.UserConfigDir()
|
dir, _ := os.UserConfigDir()
|
||||||
authenticated := false
|
authenticated := false
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
$loading = true
|
$loading = true
|
||||||
LaunchInstance(instance).then(() => {
|
LaunchInstance(instance).then(() => {
|
||||||
$loading = false
|
$loading = false
|
||||||
window.runtime.Quit()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
fclauncher/level.dat
Normal file
BIN
fclauncher/level.dat
Normal file
Binary file not shown.
BIN
fclauncher/logs/2024-10-30-1.log.gz
Normal file
BIN
fclauncher/logs/2024-10-30-1.log.gz
Normal file
Binary file not shown.
BIN
fclauncher/logs/2024-10-30-2.log.gz
Normal file
BIN
fclauncher/logs/2024-10-30-2.log.gz
Normal file
Binary file not shown.
BIN
fclauncher/logs/2024-10-30-3.log.gz
Normal file
BIN
fclauncher/logs/2024-10-30-3.log.gz
Normal file
Binary file not shown.
BIN
fclauncher/logs/2024-10-30-4.log.gz
Normal file
BIN
fclauncher/logs/2024-10-30-4.log.gz
Normal file
Binary file not shown.
BIN
fclauncher/logs/2024-10-30-5.log.gz
Normal file
BIN
fclauncher/logs/2024-10-30-5.log.gz
Normal file
Binary file not shown.
BIN
fclauncher/logs/2024-10-30-6.log.gz
Normal file
BIN
fclauncher/logs/2024-10-30-6.log.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -451,6 +451,7 @@ func DownloadLoggingConfig(mcVersion string, gameDir string){
|
|||||||
resp, err := http.Get(metadata.Logging.Client.File.Url)
|
resp, err := http.Get(metadata.Logging.Client.File.Url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error downloading logging config: %s\n", err)
|
fmt.Printf("Error downloading logging config: %s\n", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
os.MkdirAll(gameDir, 0755)
|
os.MkdirAll(gameDir, 0755)
|
||||||
@ -534,13 +535,20 @@ func GetBaseLaunchArgs(mcVersion string, libDir string, binDir string, assetDir
|
|||||||
args = append(args, "-Djna.tmpdir="+filepath.Join(gameDir, "natives"))
|
args = append(args, "-Djna.tmpdir="+filepath.Join(gameDir, "natives"))
|
||||||
args = append(args, "-Dorg.lwjgl.system.SharedLibraryExtractpath="+filepath.Join(gameDir, "natives"))
|
args = append(args, "-Dorg.lwjgl.system.SharedLibraryExtractpath="+filepath.Join(gameDir, "natives"))
|
||||||
args = append(args, "-Dio.netty.native.workdir="+filepath.Join(gameDir, "natives"))
|
args = append(args, "-Dio.netty.native.workdir="+filepath.Join(gameDir, "natives"))
|
||||||
args = append(args, strings.ReplaceAll(metadata.Logging.Client.Argument, "${path}", filepath.Join(gameDir, "log4j2.xml")))
|
loggingArg := strings.ReplaceAll(metadata.Logging.Client.Argument, "${path}", filepath.Join(gameDir, "log4j2.xml"))
|
||||||
|
if loggingArg != "" {
|
||||||
|
args = append(args, loggingArg)
|
||||||
|
}
|
||||||
args = append(args, "-Xms512m")
|
args = append(args, "-Xms512m")
|
||||||
args = append(args, "-Xmx1024m")
|
args = append(args, "-Xmx1024m")
|
||||||
args = append(args, "-cp")
|
args = append(args, "-cp")
|
||||||
arg := ""
|
arg := ""
|
||||||
|
separater := ":"
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
separater = ";"
|
||||||
|
}
|
||||||
for _, lib := range metadata.Libraries {
|
for _, lib := range metadata.Libraries {
|
||||||
arg += filepath.Join(libDir, lib.Downloads.Artifact.Path) + ":"
|
arg += filepath.Join(libDir, lib.Downloads.Artifact.Path) + separater
|
||||||
}
|
}
|
||||||
arg += filepath.Join(binDir, mcVersion, "client.jar")
|
arg += filepath.Join(binDir, mcVersion, "client.jar")
|
||||||
args = append(args, arg)
|
args = append(args, arg)
|
||||||
@ -566,7 +574,7 @@ func GetBaseLaunchArgs(mcVersion string, libDir string, binDir string, assetDir
|
|||||||
case "${assets_index_name}":
|
case "${assets_index_name}":
|
||||||
args = append(args, metadata.Assets)
|
args = append(args, metadata.Assets)
|
||||||
case "${user_properties}":
|
case "${user_properties}":
|
||||||
args = append(args, "null")
|
args = append(args, "{}")
|
||||||
default:
|
default:
|
||||||
args = append(args, val)
|
args = append(args, val)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user