From 1a862bc318be071655dead699839e7685dcbb675 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 9 Oct 2026 22:57:15 +0200 Subject: [PATCH] fix: retrobat defaults to its installer directory --- platforms/_registry.yml | 4 ++++ tests/test_extract_targets.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/platforms/_registry.yml b/platforms/_registry.yml index 0ad0d19f..95dbfd57 100644 --- a/platforms/_registry.yml +++ b/platforms/_registry.yml @@ -805,6 +805,10 @@ platforms: target_source: null install: detect: + # installer.iss: DefaultDirName=C:\RetroBat, the first place to look. + - os: windows + method: path_exists + path: 'C:\RetroBat\bios' - os: windows method: path_exists path: '%USERPROFILE%\RetroBat\bios' diff --git a/tests/test_extract_targets.py b/tests/test_extract_targets.py index 37a78089..ac08f36c 100644 --- a/tests/test_extract_targets.py +++ b/tests/test_extract_targets.py @@ -56,5 +56,21 @@ class ExtractTargets(unittest.TestCase): self.assertNotIn('" | RetroDECK | `~/retrodeck/` |"', site) +class ThePackGuideNamesTheInstallerDefault(unittest.TestCase): + """The pack README, the registry and install.py each wrote RetroBat's + default folder by hand, and two of the three said the home directory + where the installer (installer.iss) says C:\\RetroBat.""" + + def test_retrobat_guide_matches_the_registry(self): + registry = load_platform_registry(PLATFORMS) + first = next( + rule["path"] for rule in registry["retrobat"]["install"]["detect"] + if rule["os"] == "windows" and rule["method"] == "path_exists" + ) + guide = (REPO_ROOT / "scripts" / "packreadme.py").read_text(encoding="utf-8") + self.assertEqual(first, "C:\\RetroBat\\bios") + self.assertIn("(default: C:\\\\RetroBat\\\\bios\\\\)", guide) + + if __name__ == "__main__": unittest.main()