fix(build): the game's exe has Longshot's icon, in every build #1680

Merged
HumanBean merged 3 commits from dyst/Longshot:fix/exe-icon into main 2026-11-19 01:54:56 +00:00
Member

Type: fix · Risk: low · Tested on: Windows 11 (game-free checks only; not yet run in the game) · Needs: Windows, any GPU: a build with it, its window and taskbar icon

TL;DR

The game's own window and taskbar entry on Windows showed Windows' blank program icon, while the launcher and the builder show Longshot's. A release's game was built with no icon at all. This PR gives the game Longshot's icon in every build, releases included. A new game-free test checks the icon that is linked; it has not been run in the game yet, so it stays WIP until it has.

Breakdown

  • Who it helps: every Windows player: the game's window, taskbar entry and Task Manager row show Longshot's icon.
  • What was wrong: the game's exe only got an icon from the game's own .nup or a developer's picture, and a release is built with neither.
  • What changes: the exe always links Longshot's icon (the one the builder and the launcher already use).
  • What does not change: the name Windows shows for the exe when the builder read the game's name from its .nup; Linux; saves and settings.
  • How it was checked: tests/test_exe_icon.py (new) reads the linked icon back; the icon resource was linked into a small program with llvm-mingw and is there.
  • What is still open: a build with this PR run in the game, its window and taskbar icon looked at.
  • Risk: low: a resource in the exe; at worst a build has no icon, as before.

Why

The game's window on Windows has no icon of its own: the taskbar and the window's corner show Windows' blank program icon. nx2/build.py linked an icon only when the builder had made one from the game's .nup (work/longshot_game.res) or a developer had made one from a picture (work/longshot.res). The release builds have neither, and the .nup a player builds from may hold no icon either (the one this was found with holds neither a name nor an icon). Longshot's own icon, builder/setup/longshot.ico, was used only by the builder's setup.

What changed

The exe links Longshot's icon in every build, beside the game's name when the builder read one.

  • build: exe_resources() in nx2/build.py makes work/longshot_brand.res from builder/setup/longshot.ico (icon 1, which host/display.c loads for the window) and links it always, with work/longshot_game.res beside it when there is one. A developer's work/longshot.res is no longer linked.
  • icon: images_of_ico() in nx2/make_icon.py reads an .ico's PNG images as they are, so the builders that make releases need no Pillow.
  • name: game_title.write_res() in nx2/game_title.py writes the game's name alone (version strings), no longer its icon, so the two resources never clash.
  • test: tests/test_exe_icon.py.

Measurements

Nothing to measure: a resource linked into the exe.

Flags and settings

None.

Testing

Tested: on Windows 11, without the game: tests/test_exe_icon.py passes (every size of longshot.ico in the resource, icon group 1, the same resource each build, the game's name resource with no icon of its own, both linked when the game has a name). The resource linked into a small program with the Builder's llvm-mingw gives its ICON and GROUP_ICON (llvm-readobj --coff-resources). The checks near it pass; test_build_long_paths fails here as it does on main. The whole of tests/run_all.py has not been run on this branch yet.

Not tested: a build with this PR in the game: the window's and the taskbar's icon.

Must be tested:

  • Windows, any GPU: build this PR (a pack over a base is enough), start the game, expecting Longshot's icon in the window's corner, the taskbar and Task Manager (by hand, the author: before this leaves WIP).

Risks

What could break: a build whose builder/setup/longshot.ico can't be read links no icon, as before; nothing else reads these resources.

Turning it off: revert the commits.

Compatibility: Nothing changes for a player but the icon.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched: none for the exe's icon).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says. (Not yet: a build with it run in the game is the next step.)
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). (The checks near it pass; the whole suite is still to run.)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (With the in-game run.)
  • A game-free test added for the fix, failing on main and passing here.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Windows 11 (game-free checks only; not yet run in the game) · **Needs:** Windows, any GPU: a build with it, its window and taskbar icon ## TL;DR The game's own window and taskbar entry on Windows showed Windows' blank program icon, while the launcher and the builder show Longshot's. A release's game was built with no icon at all. This PR gives the game Longshot's icon in every build, releases included. A new game-free test checks the icon that is linked; it has not been run in the game yet, so it stays WIP until it has. ## Breakdown - **Who it helps:** every Windows player: the game's window, taskbar entry and Task Manager row show Longshot's icon. - **What was wrong:** the game's exe only got an icon from the game's own .nup or a developer's picture, and a release is built with neither. - **What changes:** the exe always links Longshot's icon (the one the builder and the launcher already use). - **What does not change:** the name Windows shows for the exe when the builder read the game's name from its .nup; Linux; saves and settings. - **How it was checked:** `tests/test_exe_icon.py` (new) reads the linked icon back; the icon resource was linked into a small program with llvm-mingw and is there. - **What is still open:** a build with this PR run in the game, its window and taskbar icon looked at. - **Risk:** low: a resource in the exe; at worst a build has no icon, as before. ## Why The game's window on Windows has no icon of its own: the taskbar and the window's corner show Windows' blank program icon. `nx2/build.py` linked an icon only when the builder had made one from the game's .nup (`work/longshot_game.res`) or a developer had made one from a picture (`work/longshot.res`). The release builds have neither, and the .nup a player builds from may hold no icon either (the one this was found with holds neither a name nor an icon). Longshot's own icon, `builder/setup/longshot.ico`, was used only by the builder's setup. ## What changed The exe links Longshot's icon in every build, beside the game's name when the builder read one. - build: `exe_resources()` in `nx2/build.py` makes `work/longshot_brand.res` from `builder/setup/longshot.ico` (icon 1, which `host/display.c` loads for the window) and links it always, with `work/longshot_game.res` beside it when there is one. A developer's `work/longshot.res` is no longer linked. - icon: `images_of_ico()` in `nx2/make_icon.py` reads an .ico's PNG images as they are, so the builders that make releases need no Pillow. - name: `game_title.write_res()` in `nx2/game_title.py` writes the game's name alone (version strings), no longer its icon, so the two resources never clash. - test: `tests/test_exe_icon.py`. ## Measurements Nothing to measure: a resource linked into the exe. ### Flags and settings None. ## Testing **Tested:** on Windows 11, without the game: `tests/test_exe_icon.py` passes (every size of `longshot.ico` in the resource, icon group 1, the same resource each build, the game's name resource with no icon of its own, both linked when the game has a name). The resource linked into a small program with the Builder's llvm-mingw gives its ICON and GROUP_ICON (`llvm-readobj --coff-resources`). The checks near it pass; `test_build_long_paths` fails here as it does on `main`. The whole of `tests/run_all.py` has not been run on this branch yet. **Not tested:** a build with this PR in the game: the window's and the taskbar's icon. **Must be tested:** - Windows, any GPU: build this PR (a pack over a base is enough), start the game, expecting Longshot's icon in the window's corner, the taskbar and Task Manager (by hand, the author: before this leaves WIP). ## Risks **What could break:** a build whose `builder/setup/longshot.ico` can't be read links no icon, as before; nothing else reads these resources. **Turning it off:** revert the commits. **Compatibility:** Nothing changes for a player but the icon. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched: none for the exe's icon). - [ ] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says. (Not yet: a build with it run in the game is the next step.) - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). (The checks near it pass; the whole suite is still to run.) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [ ] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (With the in-game run.) - [x] A game-free test added for the fix, failing on `main` and passing here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A release's exe is built where there is no .nup and no developer's picture, so it linked no icon: the game's window
(host/display.c loads icon 1) and its taskbar entry showed Windows' blank one, while the launcher and the builder show
Longshot's.

exe_resources links, as before, the game's own icon (work/longshot_game.res, from its .nup) or a developer's picture
(work/longshot.res), and else now Longshot's own, builder/setup/longshot.ico (the builder's setup and the launcher's), made
into work/longshot_brand.res. nx2/make_icon.py images_of_ico reads the .ico's PNG images as they are, so the builders that
make releases need no Pillow.

tests/test_exe_icon.py: the .ico read back as it is (every size), the .res icon group 1 with each of its images, made the
same each build, and the game's and a developer's .res still first. Linked into a program by llvm-mingw, the .res gives its
ICON and GROUP_ICON. Not yet built into the game or run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(build): the exe's icon is always Longshot's, the game's .res only its name
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 12s
c9b69e76e9
Longshot's own icon (builder/setup/longshot.ico) is the game exe's in every build now, not a fallback: exe_resources links
work/longshot_brand.res always, and beside it the name Windows shows for the exe when the builder read the game's from its
.nup (work/longshot_game.res). game_title.write_res writes that name alone (version strings), no longer the game's icon, so
the two never clash; a developer's work/longshot.res (nx2/make_icon.py) is no longer linked.

tests/test_exe_icon.py: Longshot's icon whatever else is in the work folder, the game's .res its version strings alone, and
both linked when the game has a name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #857 feat(builder): the game's own name and icon for its exe and window, from the .nup — Merged earlier support for game-provided exe/window icons; this PR supplies branding when that icon is absent.
Possibly related, for context: - PR #857 feat(builder): the game's own name and icon for its exe and window, from the .nup — Merged earlier support for game-provided exe/window icons; this PR supplies branding when that icon is absent.
Merge branch 'main' into fix/exe-icon
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 13s
PR description / Description follows the template (pull_request_target) Failing after 4s
7d8ef7f644
HumanBean changed title from WIP: fix(build): the game's exe has Longshot's icon, in every build to fix(build): the game's exe has Longshot's icon, in every build 2026-11-19 01:54:33 +00:00
HumanBean deleted branch fix/exe-icon 2026-11-19 01:54:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1680
No description provided.