From 9eafa39eebd58c2944be87c6874435743149de0d Mon Sep 17 00:00:00 2001 From: Xpl0itU <24777100+Xpl0itU@users.noreply.github.com> Date: Thu, 20 Jul 2023 13:18:57 +0200 Subject: [PATCH] Set gsettings schemas correctly --- cmd/WiiUDownloader/main.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/cmd/WiiUDownloader/main.go b/cmd/WiiUDownloader/main.go index 7bae239..c9e5c78 100644 --- a/cmd/WiiUDownloader/main.go +++ b/cmd/WiiUDownloader/main.go @@ -1,8 +1,28 @@ package main -import wiiudownloader "github.com/Xpl0itU/WiiUDownloader" +import ( + "fmt" + "os" + "path/filepath" + + wiiudownloader "github.com/Xpl0itU/WiiUDownloader" +) func main() { + // Check if user is running macOS + if os.Getenv("GOOS") != "darwin" { + execPath, err := os.Executable() + if err != nil { + fmt.Println("Error:", err) + return + } + + bundlePath := filepath.Join(filepath.Dir(filepath.Dir(execPath))) + filePath := filepath.Join(bundlePath, "MacOS/lib/share/glib-2.0/schemas") + if _, err := os.Stat("/path/to/whatever"); os.IsExist(err) { + os.Setenv("GSETTINGS_SCHEMA_DIR", filePath) + } + } win := NewMainWindow(wiiudownloader.GetTitleEntries(wiiudownloader.TITLE_CATEGORY_GAME)) win.ShowAll()