Skip to content

Switch 2 (2/8): Mac launcher builds a game from its folder - #604

Merged
v0lumehi merged 2 commits into
v0lumehi/switch2-wiringfrom
v0lumehi/switch2-folder-builds
Nov 3, 2026
Merged

v0lumehi merged 2 commits into
v0lumehi/switch2-wiringfrom
v0lumehi/switch2-folder-builds

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Fix or feature

  • Fix
  • Feature

Part of #445, closes the Mac part of #512. Stack PR 2 of 8, on #603.

What and why

Choosing or dropping a Switch 2 game folder showed "No NSP/XCI in this folder", and the build needed prod.keys. Now:

  • Choose game folder and a dropped folder check first whether the folder is a game folder (GameFolder.isCandidate: base/exefs/main.npdm, or exefs/main.npdm one level too high), before walking its tens of thousands of files.
  • The rows say what the folder holds: the title ID from main.npdm, the newest update (the one the script packs), the DLC folders. The keys row says no keys are needed and shows ready. Only the base row has Clear, which clears the whole folder. Choosing or dropping a package afterwards goes back to the package rows.
  • Refused before the build, on the base row with the reason: a missing piece of the layout, a package next to the folders, a bad DLC folder, an engine without scripts/pack_dump.py, or no profile for the game in the engine (the script packs a folder only for a game with a profile).
  • The build gives the script the folder as its input with no -k and no staging. The work folder and the app are named after the title ID (<folder>/040074A01BF12000_build, 040074A01BF12000.app), as the script's own default. The shared app gets the profile's name, since a folder has no control data.
  • The library keeps the folder as the game's input, so Build again reads it anew.

New strings in zh, en, sv, de, fr and it. The sv, de, fr and it texts are machine-translated. A native speaker should look.

Checked

  • Tests: cd frontend && swift test passes, frontend-qt unittest passes, tools/l10n_shell_catalogs.py --check passes. New: GameFolderStoreTests (the rows, no keys, the script's command with no -k, the refusals, a package after a folder, a folder of packages as before) and GameFolderCaptureTests.
  • Test for a fix: not a fix.
  • Visual QA: NX_LAUNCHER_CAPTURE_DIR=<dir> swift test --filter testRenderLauncherForVisualQAGameFolder, in English, German and Chinese, with a synthetic folder (an NPDM with only a program ID, empty RomFS folders) and a stand-in engine tree.
  • Run on a device or Mac: not run. No Switch 2 dump, no keys, no game here. Nothing was built from a real folder. What the script then does with the folder is the engine's (pack_dump.py), not checked here.

Screenshots

Builds page with Donkey Kong Bananza's folder chosen. Before:

before en

After, in English, German and Chinese:

after en
after de
after zh

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#..., or pending until that PR is open
  • A change to a launcher view has before and after screenshots above
  • No keys, game files or data extracted from a game in the change or the attachments

Choosing or dropping a folder with base/exefs/main.npdm reads it as one
game (GameFolder): the rows show the title ID, the newest update and the
DLC folders, the keys row says no keys are needed, and the script gets
the folder as its input with no -k. The launcher refuses the folder
before the build, with the reason, when the engine has no pack_dump.py
or no profile for the game, or when a piece of the layout is missing.
The library keeps the folder, so Build again reads it anew.
@v0lumehi
v0lumehi merged commit 52df32e into main Nov 3, 2026
18 of 32 checks passed
@v0lumehi
v0lumehi deleted the v0lumehi/switch2-folder-builds branch November 20, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request launcher The NX2Apple launcher app mac Mac windows Windows (the Qt front end)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant