From 862b336556d7a814498109cbf51ad5c55261ddc1 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Tue, 22 Nov 2016 04:56:18 +0500 Subject: [PATCH] Windows-related build script and game launching fixes. Fixed Windows build script to install gcc in MSYS2, which is needed for some dependencies. Fixed game launching on Windows, now ioq3 will search for game data in proper directory. --- doc/installation/windows/make-dist.sh | 2 +- launcher/launcher_object.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/installation/windows/make-dist.sh b/doc/installation/windows/make-dist.sh index b0ca2d6..a97d653 100644 --- a/doc/installation/windows/make-dist.sh +++ b/doc/installation/windows/make-dist.sh @@ -36,7 +36,7 @@ check_msys() { # Check if we have neccessary MSYS packages installed. check_msys_packages() { echo "* Installing neccessary MSYS2 packages..." - pacman -S ${MINGW_PACKAGE_PREFIX}-tools-git ${MINGW_PACKAGE_PREFIX}-gtk2 ${MINGW_PACKAGE_PREFIX}-pkg-config ${MINGW_PACKAGE_PREFIX}-gtk-engines ${MINGW_PACKAGE_PREFIX}-gtk-engine-murrine --noconfirm --needed + pacman -S ${MINGW_PACKAGE_PREFIX}-tools-git ${MINGW_PACKAGE_PREFIX}-gtk2 ${MINGW_PACKAGE_PREFIX}-pkg-config ${MINGW_PACKAGE_PREFIX}-gtk-engines ${MINGW_PACKAGE_PREFIX}-gtk-engine-murrine ${MINGW_PACKAGE_PREFIX}-gcc --noconfirm --needed } # Build URTrator diff --git a/launcher/launcher_object.go b/launcher/launcher_object.go index 2806abe..94f5ab4 100644 --- a/launcher/launcher_object.go +++ b/launcher/launcher_object.go @@ -15,6 +15,7 @@ import ( "fmt" "os" "os/exec" + "path/filepath" "runtime" "strconv" "strings" @@ -114,6 +115,12 @@ func (l *Launcher) Launch(server_profile *datamodels.Server, user_profile *datam go func() { go func() { cmd := exec.Command(launch_bin, launch_params...) + // This workaround is required on Windows, otherwise ioq3 + // will not find game data. + if runtime.GOOS == "windows" { + dir := filepath.Dir(launch_bin) + cmd.Dir = dir + } out, err1 := cmd.Output() if err1 != nil { fmt.Println("Launch error: " + err1.Error())