build: package haul.exe with an embedded icon
A plain `go build` links no icon resource, so Explorer and the Start menu draw the generic executable glyph. Inno's SetupIconFile only skins setup.exe, so the fix has to happen at build time: `fyne package` turns cmd/haul/Icon.png into a .syso and links it in, and adds -H=windowsgui itself. Documents the installer build alongside it, since the two steps are only useful together. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ GO ?= $(shell test -x $(HOME)/.local/go/bin/go && echo $(HOME)/.local/go/bin/go
|
||||
# FYNE=/path/to/fyne if you'd rather use an installed copy.
|
||||
FYNE ?= $(GO) run fyne.io/tools/cmd/fyne@v1.7.2
|
||||
|
||||
.PHONY: build install test vet check run run-xvfb dist package-darwin clean
|
||||
.PHONY: build install test vet check run run-xvfb dist package-darwin package-windows clean
|
||||
|
||||
build: ## Build a native binary into ./bin/haul
|
||||
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o bin/haul ./cmd/haul
|
||||
@@ -80,5 +80,25 @@ package-darwin: ## Package haul.app for macOS (run this on a Mac)
|
||||
$(FYNE) package --target darwin --src ./cmd/haul --release
|
||||
@echo "built ./haul.app — drag it into /Applications"
|
||||
|
||||
# A plain `go build` produces a haul.exe with no icon resource, so Explorer, the
|
||||
# taskbar and the Start menu all draw the generic executable icon. Nothing in
|
||||
# the installer can fix that — Inno's SetupIconFile only skins setup.exe itself.
|
||||
# `fyne package` generates a .syso from cmd/haul/Icon.png (it converts the PNG
|
||||
# itself; cmd/haul/Icon.ico is for Inno, not for this) and links it in, so the
|
||||
# icon travels with the binary. It also adds -H=windowsgui on its own, so this
|
||||
# needs none of the manual linker flags the README's build command does.
|
||||
#
|
||||
# Run this ON Windows, from the MSYS2 UCRT64 shell if you installed make there:
|
||||
# haul is cgo, so it needs the host MinGW-w64 toolchain. Like package-darwin it
|
||||
# rewrites cmd/haul/FyneApp.toml in place, bumping Build.
|
||||
#
|
||||
# fyne writes the binary beside the source, as cmd/haul/haul.exe. Move it into
|
||||
# bin/, which is where Inno-compile.iss looks for it.
|
||||
package-windows: ## Package haul.exe with an embedded icon (run this on Windows)
|
||||
$(FYNE) package --target windows --src ./cmd/haul --release
|
||||
@mkdir -p bin
|
||||
mv ./cmd/haul/haul.exe ./bin/haul.exe
|
||||
@echo "built ./bin/haul.exe — compile Inno-compile.iss to wrap it in an installer"
|
||||
|
||||
clean: ## Remove build artifacts
|
||||
rm -rf bin dist haul.app
|
||||
rm -rf bin dist haul.app Output
|
||||
|
||||
Reference in New Issue
Block a user