Skip to content

Commit 67a7bb2

Browse files
pjmageeclaude
andcommitted
fix(overlay): single-file .exe wouldn't launch (Silk/GLFW platform not found)
The single-file overlay exited with "Couldn't find a suitable window platform": Silk.NET discovers backends by reflection (broken in single-file) and looks for glfw3.dll in AppContext.BaseDirectory (the exe dir, not the native self-extract temp dir). Two fixes: - Program.cs: explicitly GlfwWindowing.RegisterPlatform() + GlfwInput.RegisterPlatform(). - release.yml: publish with IncludeAllContentForSelfExtract=true (extracts managed + native together so BaseDirectory has glfw3.dll). Verified: the single-file exe now launches. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5de6614 commit 67a7bb2

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ jobs:
3030
# The overlay isn't AOT-able (Silk.NET/OpenGL + Dear ImGui + GLFW), so it's a self-contained
3131
# single-file .exe: the .NET runtime is bundled and the native GLFW/ImGui libraries self-extract
3232
# at launch. One file, runs without any install (larger than the AOT CLI — it carries the runtime).
33+
# IncludeAllContentForSelfExtract (not just native libs) is required for Silk.NET/GLFW: it extracts
34+
# everything to one dir so AppContext.BaseDirectory points where Silk looks for glfw3.dll — otherwise
35+
# the app exits with "Couldn't find a suitable window platform". (Code also calls RegisterPlatform.)
3336
- name: Publish Overlay (single-file self-contained)
3437
run: >-
3538
dotnet publish SwtorLogParser.Overlay.ImGui -c Release -r win-x64 --self-contained
36-
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
39+
-p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true
3740
-p:EnableCompressionInSingleFile=true -p:DebugType=none -o publish/overlay
3841
3942
- name: Package artifacts

SwtorLogParser.Overlay.ImGui/Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ private Program()
6565

6666
private void Run()
6767
{
68+
// Single-file (and trimmed/AOT) deployments can't auto-discover the Silk.NET windowing/input
69+
// backends by reflection, which fails with "Couldn't find a suitable window platform". Register
70+
// the GLFW platform explicitly so the published single-file .exe runs.
71+
Silk.NET.Windowing.Glfw.GlfwWindowing.RegisterPlatform();
72+
Silk.NET.Input.Glfw.GlfwInput.RegisterPlatform();
73+
6874
var options = WindowOptions.Default with
6975
{
7076
Title = "SWTOR Overlay",

0 commit comments

Comments
 (0)