about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-07-05 12:36:37 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-07-05 12:36:37 +0300
commitc787b02b3c3fae9ed49c3dbd1d8d41ea017fefee (patch)
treec2c17a2037d0f0d86d6b7bf43966796acba87e3e
parent0b3ec5ad63dcdcb6481b7164e88430e5f617b518 (diff)
downloadfungus-launcher-c787b02b3c3fae9ed49c3dbd1d8d41ea017fefee.tar.gz
fungus-launcher-c787b02b3c3fae9ed49c3dbd1d8d41ea017fefee.tar.xz
add temporary hack for wingdk and explicitly set working directory for popen() to a dirname of game exe
-rw-r--r--fungus/game_launcher.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/fungus/game_launcher.py b/fungus/game_launcher.py
index b3b2fdc..1c2740f 100644
--- a/fungus/game_launcher.py
+++ b/fungus/game_launcher.py
@@ -361,6 +361,9 @@ class GameLauncher:
         self.start_time = time.time()
         os.environ["UMU_RUNTIME_UPDATE"] = "0"
 
+        # TODO make this customizable per-game
+        os.environ["WINEDLLOVERRIDES"] = "winmm=n,b;xgameruntime=n,b"
+
         if logging.root.level <= logging.DEBUG:
             os.environ["UMU_LOG"] = "debug"
             os.environ["PROTON_LOG"] = "1"
@@ -407,6 +410,10 @@ class GameLauncher:
 
         # Check whitelist
         exec_path = self.game.path
+
+        # We need this to set work directory for popen later
+        exec_dir = os.path.dirname(exec_path)
+
         log.debug("sandbox-check: exec_path=%r", exec_path)
         if exec_path and valid_dirs and not self._check_whitelist(exec_path, valid_dirs):
             if self._on_sandbox_warning:
@@ -433,6 +440,7 @@ class GameLauncher:
                 bufsize=8192,
                 text=True,
                 env=run_env,
+                cwd=exec_dir
             )
         except (FileNotFoundError, OSError) as exc:
             error_msg = (