fix dos and win31 order problem
authorNiki Roo <niki@nikiroo.be>
Sun, 23 Mar 2025 21:34:06 +0000 (22:34 +0100)
committerNiki Roo <niki@nikiroo.be>
Sun, 23 Mar 2025 21:34:06 +0000 (22:34 +0100)
gamiki/builder.py
gamiki/support/commands.py
gamiki/support/support_dos.py
gamiki/support/support_win31.py

index b63bc2c2caa04b997018f5af427ee76fcd08b2bf..5eabd8ec1fd0e77f4c90b62e5c05014e05b8657b 100644 (file)
@@ -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()
index 5f4b58f584560d222dcbc908386327e3a3eecfc2..9b4f98749bfa85d5050040831167c700b8c9c163 100644 (file)
@@ -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
 
index 3e963342e0560b0abdebaeee35ebead6b62cbc92..05da421240903fe46f57869819482bacd374e755 100644 (file)
@@ -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)
index 45350db709f67ce9ad46b1c548aa15cf2fc05547..a4a675195032503db211b8c525eb0e3e3ac73e6f 100644 (file)
@@ -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] = []):