Skip to content

NSP script: a front end's stand-in icon for a Mac app without control data - #2099

Closed
v0lumehi wants to merge 1 commit into
seedds:mainfrom
v0lumehi:v0lumehi/nsp-fallback-icon
Closed

v0lumehi wants to merge 1 commit into
seedds:mainfrom
v0lumehi:v0lumehi/nsp-fallback-icon

Conversation

@v0lumehi

Copy link
Copy Markdown
Contributor

What and why

A NUP or a dump folder has no control data, so the NSP script packs its Mac app with no icon and the app shows a blank one. A front end can know a better icon than nothing. NX_FALLBACK_ICON now names a 256x256 JPEG. The Mac app takes it only when the game has no icon of its own. The iOS app and the shared shell never use it. Without the variable nothing changes.

Seen in NX2Apple: LNPANDY/NX2Apple#784.

Checked

  • Tests: test_nsp_nup.py has a new test for the variable (a file that exists, a missing file, an empty value) and it passes. Three older tests in that file stop at the free-space check on my Mac (under 4 GB free) and fail the same way without this change. lint_python.py reports the same 3 findings in dm/gfx/tools/dmsh_build.py with and without this change, none new.
  • Games run: none. The change only picks which icon file the Mac app gets.
  • Devices and OS: M2 Max, macOS 27.2.

Front ends

Front-ends: new: NX_FALLBACK_ICON names a stand-in icon for a Mac app whose game has no control data

Docs

  • The finding is in its game note or its docs/reference/<subsystem>.md entry, and python3 dm/tools/docs_symptoms.py was run (not a finding)
  • A chain tool changed (no)
  • No game files, keys or data extracted from a game in the change or the attachments

… data (NX_FALLBACK_ICON)

A NUP or a dump folder has no control data, so the Mac app is packed with no icon and shows a blank one. A front end may now name a 256x256 JPEG in NX_FALLBACK_ICON. The Mac app takes it only when the game has no icon of its own. The iOS app and the shared shell never use it.

Test: test_nsp_nup.py (the variable names a file that exists, a missing file or an empty value gives none).

Front-ends: new: NX_FALLBACK_ICON names a stand-in icon for a Mac app whose game has no control data
@github-actions github-actions Bot added packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts) labels Nov 10, 2026
seedds added a commit that referenced this pull request Nov 11, 2026
…ICON, used only when --icon / ICON is not given and the game has no icon of its own (a dump, a NUP without one), so a game that carries an icon keeps it and a front end can pass a stand-in without knowing what the game holds, where --icon always replaces the game's. It goes to the Mac app and the IPA alike, down the path --icon takes (pack_app.py --icon, DM_ICON), its path is checked before anything is extracted, the build says when it is used, and the game event's icon reports it. The choice is one function (app_icon), tested for its order: --icon, the packed version's icon, the base game's, the fallback. No app was packed with it (PR #2099)

Front-ends: new: --fallback-icon IMAGE (FALLBACK_ICON) gives an app an icon only when the game has none of its own; the game event's icon reports it

Co-authored-by: v0lumehi <34629096+v0lumehi@users.noreply.github.com>
@seedds

seedds commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Thanks @v0lumehi. The need is right: --icon always replaces the game's icon, and a front end cannot know before the build whether a NUP carries one. It is on main as 5714e32, with you as co-author, in a different shape:

  • --fallback-icon IMAGE (the FALLBACK_ICON setting in Spyder) instead of the NX_FALLBACK_ICON environment variable, since the script's inputs are settings with command-line options.
  • The order is --icon, the game's own icon, then the fallback, so a game that carries an icon keeps it.
  • It goes to the IPA as well as the Mac app, down the path --icon takes. build_ipa.sh does take an icon (DM_ICON), so an icon-less IPA no longer stays blank either.
  • A path that is not a file stops the build before anything is extracted, as for --icon. Any image sips reads will do, not only a 256x256 JPEG.
  • The build says when the fallback is used, and the game event's icon reports it.

For NX2Apple: pass the stand-in with --fallback-icon in place of setting NX_FALLBACK_ICON. The unit tests pass, but no app was packed with it here, so a word on whether the Mac app shows the stand-in for an icon-less NUP would be welcome. Closing this in favour of that commit.

@seedds seedds closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packing Building an IPA or a Mac app: the NSP script, extraction, the shader split, the packers tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants