diff --git a/portprotonqt/custom_data/ExoTanksMOBA_Launcher/cover.png b/portprotonqt/custom_data/ExoTanksMOBA_LauncherUpdater/cover.png similarity index 100% rename from portprotonqt/custom_data/ExoTanksMOBA_Launcher/cover.png rename to portprotonqt/custom_data/ExoTanksMOBA_LauncherUpdater/cover.png diff --git a/portprotonqt/custom_data/ExoTanksMOBA_Launcher/metadata.txt b/portprotonqt/custom_data/ExoTanksMOBA_LauncherUpdater/metadata.txt similarity index 100% rename from portprotonqt/custom_data/ExoTanksMOBA_Launcher/metadata.txt rename to portprotonqt/custom_data/ExoTanksMOBA_LauncherUpdater/metadata.txt diff --git a/portprotonqt/custom_data/CALIBER/cover.png b/portprotonqt/custom_data/caliber_launcher_pp/cover.png similarity index 100% rename from portprotonqt/custom_data/CALIBER/cover.png rename to portprotonqt/custom_data/caliber_launcher_pp/cover.png diff --git a/portprotonqt/custom_data/CALIBER/metadata.txt b/portprotonqt/custom_data/caliber_launcher_pp/metadata.txt similarity index 100% rename from portprotonqt/custom_data/CALIBER/metadata.txt rename to portprotonqt/custom_data/caliber_launcher_pp/metadata.txt diff --git a/portprotonqt/custom_data/Crossout/cover.png b/portprotonqt/custom_data/crossout_launcher_pp/cover.png similarity index 100% rename from portprotonqt/custom_data/Crossout/cover.png rename to portprotonqt/custom_data/crossout_launcher_pp/cover.png diff --git a/portprotonqt/custom_data/Crossout/metadata.txt b/portprotonqt/custom_data/crossout_launcher_pp/metadata.txt similarity index 100% rename from portprotonqt/custom_data/Crossout/metadata.txt rename to portprotonqt/custom_data/crossout_launcher_pp/metadata.txt diff --git a/portprotonqt/custom_data/HoYoPlay/cover.png b/portprotonqt/custom_data/hoyoplay_launcher_pp/cover.png similarity index 100% rename from portprotonqt/custom_data/HoYoPlay/cover.png rename to portprotonqt/custom_data/hoyoplay_launcher_pp/cover.png diff --git a/portprotonqt/custom_data/HoYoPlay/metadata.txt b/portprotonqt/custom_data/hoyoplay_launcher_pp/metadata.txt similarity index 100% rename from portprotonqt/custom_data/HoYoPlay/metadata.txt rename to portprotonqt/custom_data/hoyoplay_launcher_pp/metadata.txt diff --git a/portprotonqt/custom_data/Lost Light/cover.png b/portprotonqt/custom_data/lostlight_launcher_pp/cover.png similarity index 100% rename from portprotonqt/custom_data/Lost Light/cover.png rename to portprotonqt/custom_data/lostlight_launcher_pp/cover.png diff --git a/portprotonqt/custom_data/Lost Light/metadata.txt b/portprotonqt/custom_data/lostlight_launcher_pp/metadata.txt similarity index 100% rename from portprotonqt/custom_data/Lost Light/metadata.txt rename to portprotonqt/custom_data/lostlight_launcher_pp/metadata.txt diff --git a/portprotonqt/custom_data/Modern Warships/cover.png b/portprotonqt/custom_data/modern_warships_pp/cover.png similarity index 100% rename from portprotonqt/custom_data/Modern Warships/cover.png rename to portprotonqt/custom_data/modern_warships_pp/cover.png diff --git a/portprotonqt/custom_data/Modern Warships/metadata.txt b/portprotonqt/custom_data/modern_warships_pp/metadata.txt similarity index 100% rename from portprotonqt/custom_data/Modern Warships/metadata.txt rename to portprotonqt/custom_data/modern_warships_pp/metadata.txt diff --git a/portprotonqt/custom_data/Warframe/cover.png b/portprotonqt/custom_data/warframe_launcher_pp/cover.png similarity index 100% rename from portprotonqt/custom_data/Warframe/cover.png rename to portprotonqt/custom_data/warframe_launcher_pp/cover.png diff --git a/portprotonqt/custom_data/Warframe/metadata.txt b/portprotonqt/custom_data/warframe_launcher_pp/metadata.txt similarity index 100% rename from portprotonqt/custom_data/Warframe/metadata.txt rename to portprotonqt/custom_data/warframe_launcher_pp/metadata.txt diff --git a/portprotonqt/portproton_api.py b/portprotonqt/portproton_api.py index 28275b4..59561a3 100644 --- a/portprotonqt/portproton_api.py +++ b/portprotonqt/portproton_api.py @@ -209,21 +209,24 @@ class PortProtonAPI: exe_name = f"{export_match.group(1).strip()}.exe" else: - # --- portwine_exe= --- (многострочный, сложный вариант) - portwine_match = re.search( - r'portwine_exe\s*=\s*(?:["\']?\$\(.+?\)[\'"]?|["\'].*?\.exe["\']|[^\n]+)', - content, - re.DOTALL, - ) - if portwine_match: - exe_expr = portwine_match.group(0).split("=", 1)[1].strip() - exe_expr = exe_expr.strip("'\" ") + portwine_match = None + for line in content.splitlines(): + stripped = line.strip() + # Игнорируем закомментированные строки + if stripped.startswith("#"): + continue + # Ищем portwine_exe только в активных строках + if "portwine_exe" in stripped and "=" in stripped: + portwine_match = stripped + break - # --- Найти .exe внутри выражения (разрешаем точки в имени) --- + if portwine_match: + exe_expr = portwine_match.split("=", 1)[1].strip().strip("'\" ") exe_candidates = re.findall(r'[-\w\s/\\\.]+\.exe', exe_expr) if exe_candidates: exe_name = os.path.basename(exe_candidates[-1].strip()) + # Fallback if not display_name and exe_name: display_name = exe_name