From 23f023837b70f452bfe0cd7a948f377b5c388489 Mon Sep 17 00:00:00 2001 From: Alessio Date: Sun, 12 Jan 2025 20:26:48 -0800 Subject: [PATCH] Try to add an icon to the compiled application on Windows --- cmd/windows-compile.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/windows-compile.sh b/cmd/windows-compile.sh index a250a46..fe282a3 100755 --- a/cmd/windows-compile.sh +++ b/cmd/windows-compile.sh @@ -16,4 +16,10 @@ fi # Always use static build for windows FLAGS="-s -w -X gitlab.com/offline-twitter/twitter_offline_engine/internal/webserver.use_embedded=true" SPECIAL_FLAGS_FOR_STATIC_BUILD="-linkmode=external -extldflags=-static" + +# Add an application icon using `windres` and `.syso` +# The `.syso` should be picked up automatically, since it's in the same directory we run `go build` from` +echo '1 ICON "./internal/webserver/static/twitter.ico"' > /tmp/icon.rc +x86_64-w64-mingw32-windres /tmp/icon.rc -o icon.syso + go build -ldflags="$FLAGS $SPECIAL_FLAGS_FOR_STATIC_BUILD -X main.version_string=$1" -o twitter.exe ./twitter