Skip to content

fix: set Windows binary subsystem to GUI - #176

Merged
Strobotti merged 1 commit into
mainfrom
fix/windows-gui-subsystem
Jul 29, 2026
Merged

fix: set Windows binary subsystem to GUI#176
Strobotti merged 1 commit into
mainfrom
fix/windows-gui-subsystem

Conversation

@Strobotti

Copy link
Copy Markdown
Owner

Summary

The Windows installer produces a binary that fails to launch with a "this is a command-line application" error when opened from shortcuts, URL handlers, or double-click.

Root cause

The Windows build was missing the -H windowsgui linker flag, so the Go compiler produced a PE binary with IMAGE_SUBSYSTEM_WINDOWS_CUI (console subsystem) instead of IMAGE_SUBSYSTEM_WINDOWS_GUI.

Changes

  • Added an EXTRA_LDFLAGS variable to the binary task in Taskfile.build.yml (defaults to empty, no impact on other platforms)
  • Set EXTRA_LDFLAGS: "-H windowsgui" for the windows-amd64 target

Testing

  • CLI subcommands still work (output goes to debugger/is discarded when no console is attached, which is expected for a GUI app)
  • The binary should now launch correctly from the Start Menu shortcut, URL handler invocation, and double-click

The Windows build was missing the `-H windowsgui` linker flag, causing the
PE binary to use the console subsystem (IMAGE_SUBSYSTEM_WINDOWS_CUI).
This made Windows display a "this is a command-line application" error
when launched from shortcuts, URL handlers, or double-click.

Add an EXTRA_LDFLAGS variable to the binary task and pass `-H windowsgui`
for the windows-amd64 target, setting the correct GUI subsystem.
@Strobotti
Strobotti merged commit 9be1251 into main Jul 29, 2026
7 checks passed
@Strobotti
Strobotti deleted the fix/windows-gui-subsystem branch July 29, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant