diff --git a/install.ps1 b/install.ps1 index 19035cf81..394040952 100644 --- a/install.ps1 +++ b/install.ps1 @@ -16,7 +16,7 @@ # and Invoke-WebRequest throws on a cut transfer before the hash is read: # the site's build rewrites this line there (scripts/sitebootstrap.py). $mismatchAdvice = "The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." - $defaultInstallSha256 = "0aacd5847f927fe058de40f34f09ba4676acafe9d3e3d6c4228e46a474ed8744" + $defaultInstallSha256 = "144f419239eaf12447b68b293d1c1d15294e45bca2344dea4a9da66fba7582cd" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index e9d697b78..96437450d 100644 --- a/install.py +++ b/install.py @@ -14156,6 +14156,12 @@ def _card_and_below(setup: CardSetup, path: Path) -> tuple[Path, bool]: name: an Onion card mounted as BIOS was read as a BIOS folder, its parent checked as the card and refused.""" below = setup.below + if (not below and setup.name in _GAMES_PART_CARDS and path.name.casefold() == "bios" + and not _is_dir(path / "bios") and _card_is(setup, path)[0] == "unknown" + and not _card_boundary(path)): + # Its list writes bios/ below the games part's root: its BIOS + # folder named got bios/bios, or was refused as inside the card. + return path.parent, True depth = len(PurePosixPath(below).parts) if (below and _ends_with(path, below) and _card_is(setup, path)[0] == "unknown" and not any(_card_boundary(folder) @@ -14312,7 +14318,8 @@ def card_choice(named: str, plat: str, root: Path) -> CardChoice: f"{setup.name} card, whose root is {shown_path(holder[2])}", short=f"That is inside {_a(setup.name)} card.", below=setup.below, root=holder[2]) - folder = root if inside or not setup.below else card / setup.below + folder = (card if inside and not setup.below + else root if inside or not setup.below else card / setup.below) if kind == "other": return _not_the_card(setup, root, card, what) if kind == "own": diff --git a/install.sh b/install.sh index d5eaaea86..ff6303641 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/ins # curl or wget stop on a cut transfer before the hash is read: the site's # build rewrites this line there (scripts/sitebootstrap.py). MISMATCH_ADVICE="The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." -DEFAULT_INSTALL_SHA256="0aacd5847f927fe058de40f34f09ba4676acafe9d3e3d6c4228e46a474ed8744" +DEFAULT_INSTALL_SHA256="144f419239eaf12447b68b293d1c1d15294e45bca2344dea4a9da66fba7582cd" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index 300728f9c..838151168 100644 --- a/install/launchers/index.json +++ b/install/launchers/index.json @@ -27,8 +27,8 @@ { "dest": "roms/ports/retrobios/install.py", "repo_path": "install.py", - "size": 1089259, - "sha256": "0aacd5847f927fe058de40f34f09ba4676acafe9d3e3d6c4228e46a474ed8744", + "size": 1089708, + "sha256": "144f419239eaf12447b68b293d1c1d15294e45bca2344dea4a9da66fba7582cd", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1142886, - "sha256": "4068768b8a88f1caa5238a8f9b5f0a0a34c1a6acab3577b54075c4163ca37ca6" + "size": 1143335, + "sha256": "9f312c89654b2e3d07fc9f741a3d714c6a14342b27b81fe08f281b159dfeff14" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1089259, - "sha256": "0aacd5847f927fe058de40f34f09ba4676acafe9d3e3d6c4228e46a474ed8744", + "size": 1089708, + "sha256": "144f419239eaf12447b68b293d1c1d15294e45bca2344dea4a9da66fba7582cd", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1089259, - "sha256": "0aacd5847f927fe058de40f34f09ba4676acafe9d3e3d6c4228e46a474ed8744", + "size": 1089708, + "sha256": "144f419239eaf12447b68b293d1c1d15294e45bca2344dea4a9da66fba7582cd", "executable": false }, { diff --git a/tests/test_install_tui.py b/tests/test_install_tui.py index 2d8b51fee..a9bcdef79 100644 --- a/tests/test_install_tui.py +++ b/tests/test_install_tui.py @@ -6077,6 +6077,26 @@ class EveryCardSetupGoesToItsCard(unittest.TestCase): self.assertNotIn(card, install.mounted_cards_of(setup.name, setup.plat)) + def test_a_games_part_named_by_its_bios_folder_is_its_card(self): + """AmberELEC and EmuELEC write bios/ below their games part, as + RetroDECK below its folder. Their BIOS folder named got bios/bios + on a card not started once, and was refused on one started.""" + for setup in self.setups: + if setup.name not in install._GAMES_PART_CARDS: + continue + started = _card_from_rules(self.root / setup.name / "started", setup) + blank = self.root / setup.name / "blank" + (blank / "bios").mkdir(parents=True) + for card in (started, blank): + with self.subTest(system=setup.name, card=card.name): + choice = install.card_choice(setup.name, setup.plat, card / "bios") + self.assertEqual((choice.refused, choice.folder), ("", card)) + # A folder named bios holding bios/ is a card's root, as named. + nested = self.root / setup.name / "bios" + (nested / "bios").mkdir(parents=True) + self.assertEqual(install.card_choice(setup.name, setup.plat, nested).folder, + nested) + def test_a_blank_drive_is_refused_where_the_card_always_names_its_system(self): blank = self.root / "BLANK" blank.mkdir() diff --git a/wiki/installer.md b/wiki/installer.md index 35bd85390..f7793f1a4 100644 --- a/wiki/installer.md +++ b/wiki/installer.md @@ -1256,7 +1256,9 @@ Under WSL a drive letter (`D:`, `D:\`) is that Windows drive, typed or given to `--dest`, `--from`, `--from-pack`, `--save-dir` and `--cores-dir`, and the screens write the folder `D:\BIOS`. Without questions (`--no-input`) the run stops with a `--dest` example. A `--dest` that is a folder inside a MinUI -card (its `Bios/`) is refused with the root to name instead. A refused +card (its `Bios/`) is refused with the root to name instead. AmberELEC +and EmuELEC write `bios/` below their games part: their `bios` folder named +with `--dest` stands for the games part, as RetroDECK's for its folder. A refused `--dest` ends with code 1 and an `error` event (`stage` `detect`). On Android a forced `--platform retroarch` falls back to `/RetroArch/system` instead, a home directory there belonging to Termux rather than to the frontend. Pass `--dest` to say where instead of