diff --git a/fclauncher/InstanceManager.go b/fclauncher/InstanceManager.go index 92b8d7d..9968e3e 100644 --- a/fclauncher/InstanceManager.go +++ b/fclauncher/InstanceManager.go @@ -12,6 +12,8 @@ import ( "runtime" "strconv" "strings" + + wruntime "github.com/wailsapp/wails/v2/pkg/runtime" ) type Instance struct { @@ -275,7 +277,9 @@ func (i *InstanceManager)LaunchInstance(instance string) { } fmt.Printf("Args: %+v", 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() + wruntime.WindowShow(i.app.Ctx) fmt.Printf("Command Output: %s\n", data) } diff --git a/fclauncher/app.go b/fclauncher/app.go index 9cbc181..ee8d3f1 100644 --- a/fclauncher/app.go +++ b/fclauncher/app.go @@ -28,7 +28,6 @@ type App struct { // NewApp creates a new App application struct func NewApp() *App { a := &App{} - a.PrismLauncher = Prism{app: a} a.Java = JavaManager{app: a} a.Instance = InstanceManager{app: a} a.Modpacks = ModpackManager{app: a} @@ -49,26 +48,6 @@ func (a *App) CheckPrerequisites() { a.Instance.SearchInstances() a.Status("Pulling Modpacks") 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") dir, _ := os.UserConfigDir() authenticated := false diff --git a/fclauncher/frontend/src/Instances.svelte b/fclauncher/frontend/src/Instances.svelte index 8c1238b..e944e81 100644 --- a/fclauncher/frontend/src/Instances.svelte +++ b/fclauncher/frontend/src/Instances.svelte @@ -33,7 +33,6 @@ $loading = true LaunchInstance(instance).then(() => { $loading = false - window.runtime.Quit() }) } diff --git a/fclauncher/level.dat b/fclauncher/level.dat new file mode 100644 index 0000000..8cb5b99 Binary files /dev/null and b/fclauncher/level.dat differ diff --git a/fclauncher/logs/2024-10-30-1.log.gz b/fclauncher/logs/2024-10-30-1.log.gz new file mode 100644 index 0000000..9e0802e Binary files /dev/null and b/fclauncher/logs/2024-10-30-1.log.gz differ diff --git a/fclauncher/logs/2024-10-30-2.log.gz b/fclauncher/logs/2024-10-30-2.log.gz new file mode 100644 index 0000000..e924fb0 Binary files /dev/null and b/fclauncher/logs/2024-10-30-2.log.gz differ diff --git a/fclauncher/logs/2024-10-30-3.log.gz b/fclauncher/logs/2024-10-30-3.log.gz new file mode 100644 index 0000000..9b68e40 Binary files /dev/null and b/fclauncher/logs/2024-10-30-3.log.gz differ diff --git a/fclauncher/logs/2024-10-30-4.log.gz b/fclauncher/logs/2024-10-30-4.log.gz new file mode 100644 index 0000000..3bc388d Binary files /dev/null and b/fclauncher/logs/2024-10-30-4.log.gz differ diff --git a/fclauncher/logs/2024-10-30-5.log.gz b/fclauncher/logs/2024-10-30-5.log.gz new file mode 100644 index 0000000..4bb71ce Binary files /dev/null and b/fclauncher/logs/2024-10-30-5.log.gz differ diff --git a/fclauncher/logs/2024-10-30-6.log.gz b/fclauncher/logs/2024-10-30-6.log.gz new file mode 100644 index 0000000..deb0ba4 Binary files /dev/null and b/fclauncher/logs/2024-10-30-6.log.gz differ diff --git a/fclauncher/minecraft.go b/fclauncher/minecraft.go index 595f6c5..df1c1ac 100644 --- a/fclauncher/minecraft.go +++ b/fclauncher/minecraft.go @@ -451,6 +451,7 @@ func DownloadLoggingConfig(mcVersion string, gameDir string){ resp, err := http.Get(metadata.Logging.Client.File.Url) if err != nil { fmt.Printf("Error downloading logging config: %s\n", err) + return } defer resp.Body.Close() 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, "-Dorg.lwjgl.system.SharedLibraryExtractpath="+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, "-Xmx1024m") args = append(args, "-cp") arg := "" + separater := ":" + if runtime.GOOS == "windows" { + separater = ";" + } 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") args = append(args, arg) @@ -566,7 +574,7 @@ func GetBaseLaunchArgs(mcVersion string, libDir string, binDir string, assetDir case "${assets_index_name}": args = append(args, metadata.Assets) case "${user_properties}": - args = append(args, "null") + args = append(args, "{}") default: args = append(args, val) }