From db3cf68d191ac4fc23fa4ccfa0f2bd4aaabd2fca Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Sat, 17 Feb 2024 18:38:29 +0200 Subject: [PATCH] LaunchSettings: Work around path separator difference on Windows --- rare/components/tabs/games/game_info/game_settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rare/components/tabs/games/game_info/game_settings.py b/rare/components/tabs/games/game_info/game_settings.py index a74f5133..3461c764 100644 --- a/rare/components/tabs/games/game_info/game_settings.py +++ b/rare/components/tabs/games/game_info/game_settings.py @@ -108,7 +108,10 @@ class GameLaunchSettings(LaunchSettingsBase): return True, path, IndicatorReasonsCommon.VALID if not os.path.isabs(path): path = os.path.join(self.igame.install_path, path) - if self.igame.install_path not in path: + # lk: Compare paths through python's commonpath because in windows we + # cannot compare as strings + # antonia disapproves of this + if os.path.commonpath([self.igame.install_path, path]) != self.igame.install_path: return False, self.igame.install_path, IndicatorReasonsCommon.WRONG_PATH if not os.path.exists(path): return False, path, IndicatorReasonsCommon.WRONG_PATH