fix(windows): the launcher builds as one file again: the font check's DLL list takes the app's folder, not an assembly's Location (IL3000) #158

Merged
HumanBean merged 1 commit from HumanBean/LongshotLauncher:fix/single-file-il3000 into main 2026-11-17 01:18:31 +00:00
Owner

Type: fix · Risk: low · Tested on: Linux, dotnet publish of the Windows single file as scripts/package.sh runs it · Needs: none

Why

Every launcher Release run since #137 fails in The launcher, both systems:

App/FontCheck.cs(91,45): error IL3000: 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app.

So no launcher nightly has been made since #134, and v1.0.0-rc.10 (run 485) was not published.

What changed

  • App/FontCheck.cs, OtherModules(): the launcher's own folder is AppContext.BaseDirectory. In the shipped single file Assembly.Location was always empty and the line already fell back to it, so the DLL list is the same.

Checks

  • dotnet publish App/LongshotLauncher.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none succeeds here (it failed with IL3000 on main in CI). No test suites were run locally.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Linux, `dotnet publish` of the Windows single file as `scripts/package.sh` runs it · **Needs:** none ## Why Every launcher Release run since [#137](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/137) fails in *The launcher, both systems*: ``` App/FontCheck.cs(91,45): error IL3000: 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. ``` So no launcher nightly has been made since #134, and v1.0.0-rc.10 ([run 485](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/actions/runs/485)) was not published. ## What changed - `App/FontCheck.cs`, `OtherModules()`: the launcher's own folder is `AppContext.BaseDirectory`. In the shipped single file `Assembly.Location` was always empty and the line already fell back to it, so the DLL list is the same. ## Checks - `dotnet publish App/LongshotLauncher.csproj -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none` succeeds here (it failed with IL3000 on main in CI). No test suites were run locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(windows): the launcher builds as one file again: the font check's DLL list takes the app's folder, not an assembly's Location (IL3000)
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
56287997a3
#137's OtherModules() read typeof(SKFontManager).Assembly.Location, which a single-file
publish refuses (error IL3000), so every Release run since it failed and no launcher
nightly or rc was made. In the shipped single file it was always empty and fell back to
AppContext.BaseDirectory anyway; that is now read directly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/single-file-il3000 2026-11-17 01:18:31 +00:00
Contributor

Post-merge note: this fix keeps Path.GetDirectoryName(AppContext.BaseDirectory) as the "own folder" prefix. AppContext.BaseDirectory always ends with a directory separator (it's an app base directory), so GetDirectoryName of it returns the parent folder — e.g. /home/deck for a launcher under /home/deck/.local/share/..., or C:\Users\xyz\AppData\Local\Programs for an installed one. OtherModules then filters out own = <parent>, which drops every non-Windows module living under that parent: on the Deck that is essentially the whole home folder, so Wine/Proton-adjacent DLLs (the thing the check exists to notice) get silently excluded from the overlay-warning list.

Path.GetFullPath(AppContext.BaseDirectory) gives the app's own folder (what the comment says it means) and the trailing separator doesn't matter for the StartsWith filter. Our #130 branch keeps that form and resolves the merge conflict to it deliberately. Small fix if you want it here too: var own = AppContext.BaseDirectory; (no GetDirectoryName at all) or Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory).

Post-merge note: this fix keeps `Path.GetDirectoryName(AppContext.BaseDirectory)` as the "own folder" prefix. `AppContext.BaseDirectory` always ends with a directory separator (it's an app base *directory*), so `GetDirectoryName` of it returns the **parent** folder — e.g. `/home/deck` for a launcher under `/home/deck/.local/share/...`, or `C:\Users\xyz\AppData\Local\Programs` for an installed one. `OtherModules` then filters out `own = <parent>`, which drops every non-Windows module living under that parent: on the Deck that is essentially the whole home folder, so Wine/Proton-adjacent DLLs (the thing the check exists to notice) get silently excluded from the overlay-warning list. `Path.GetFullPath(AppContext.BaseDirectory)` gives the app's own folder (what the comment says it means) and the trailing separator doesn't matter for the StartsWith filter. Our #130 branch keeps that form and resolves the merge conflict to it deliberately. Small fix if you want it here too: `var own = AppContext.BaseDirectory;` (no GetDirectoryName at all) or `Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory)`.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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/LongshotLauncher!158
No description provided.