Set gsettings schemas correctly

This commit is contained in:
Xpl0itU 2023-07-20 13:18:57 +02:00
parent 4bb0066714
commit 9eafa39eeb

View file

@ -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()