From: Niki Roo Date: Sun, 23 Mar 2025 21:34:06 +0000 (+0100) Subject: fix dos and win31 order problem X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=127ffbec29652832956140df4bcb22ce628ad717;p=gamiki.git fix dos and win31 order problem --- diff --git a/gamiki/builder.py b/gamiki/builder.py index b63bc2c..5eabd8e 100644 --- a/gamiki/builder.py +++ b/gamiki/builder.py @@ -10,12 +10,12 @@ class Builder: self.libraries : list[Library] = [] self.games : list[Game] = [] - supports = [] # be careful about the order - supports.append(SupportGog()) - supports.append(SupportWin()) - supports.append(SupportWin31()) - supports.append(SupportDos()) - supports.append(SupportExt()) + supports = [] + supports.append(SupportGog()) # gameinfo + supports.append(SupportWin()) # wine.bat + supports.append(SupportWin31()) # start.conf + C/WINDOWS + supports.append(SupportDos()) # start.conf + no C/WINDOWS + supports.append(SupportExt()) # start.sh targets = [] config = Path("~/.games.cfg").expanduser() diff --git a/gamiki/support/commands.py b/gamiki/support/commands.py index 5f4b58f..9b4f987 100644 --- a/gamiki/support/commands.py +++ b/gamiki/support/commands.py @@ -42,7 +42,6 @@ def start_sh(start: PurePath) -> int: else: cmd = [ start.as_posix() ] - return run(cmd, cwd=start.parent, env=env).returncode def wine(dir: PurePath) -> int: @@ -59,6 +58,5 @@ def wine(dir: PurePath) -> int: else: raise RuntimeError("wine not found") - return run(cmd, cwd=dir, env=env).returncode diff --git a/gamiki/support/support_dos.py b/gamiki/support/support_dos.py index 3e96334..05da421 100644 --- a/gamiki/support/support_dos.py +++ b/gamiki/support/support_dos.py @@ -6,7 +6,10 @@ class SupportDos(Support): """Supports DOS games via DosBox.""" def supports(self, game: Game): - return game.dir.joinpath("start.conf").exists() + return ( + game.dir.joinpath("start.conf").exists() + and not game.dir.joinpath("C", "WINDOWS").exists() + ) def start(self, game: Game, params: list[str] = []): self.running(game) diff --git a/gamiki/support/support_win31.py b/gamiki/support/support_win31.py index 45350db..a4a6751 100644 --- a/gamiki/support/support_win31.py +++ b/gamiki/support/support_win31.py @@ -8,7 +8,7 @@ class SupportWin31(Support): def supports(self, game: Game): return ( game.dir.joinpath("start.conf").exists() - and game.dir.joinpath("C", "WINDOWS").exists() + and game.dir.joinpath("C", "WINDOWS").exists() ) def start(self, game: Game, params: list[str] = []):