From 396f3f0a6403152fd584aa75594eef635ce2e1c8 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Tue, 10 May 2022 03:06:26 +0100 Subject: [PATCH] Shim and version info. --- cmd/zenity/build.sh | 9 +++++---- cmd/zenity/main.go | 2 +- cmd/zenity/versioninfo.json | 26 +++----------------------- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/cmd/zenity/build.sh b/cmd/zenity/build.sh index 95ad0b7..e8d3068 100755 --- a/cmd/zenity/build.sh +++ b/cmd/zenity/build.sh @@ -1,15 +1,16 @@ #!/bin/bash TAG=$(git tag --points-at HEAD) -echo 'package main; const tag = "'$TAG'"' | gofmt > tag.go +echo 'package main; const tag = "'$TAG'"' > tag.go -go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo +printf '#!/bin/sh\nexec zenity.exe --unixeol --cygpath "$@"' > zenity +go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo "-product-version=$TAG" GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath && -zip -9 zenity_win32.zip zenity.exe +zip -9 zenity_win32.zip zenity zenity.exe GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath && -zip -9 zenity_win64.zip zenity.exe +zip -9 zenity_win64.zip zenity zenity.exe rm resource.syso diff --git a/cmd/zenity/main.go b/cmd/zenity/main.go index d310331..a0944a7 100644 --- a/cmd/zenity/main.go +++ b/cmd/zenity/main.go @@ -410,7 +410,7 @@ func loadFlags() []zenity.Option { case "": ico = zenity.NoIcon default: - opts = append(opts, zenity.CustomIcon(icon)) + opts = append(opts, zenity.CustomIcon(ingestPath(icon))) } if ico != 0 { opts = append(opts, ico) diff --git a/cmd/zenity/versioninfo.json b/cmd/zenity/versioninfo.json index d043f1e..c944401 100644 --- a/cmd/zenity/versioninfo.json +++ b/cmd/zenity/versioninfo.json @@ -1,17 +1,5 @@ { "FixedFileInfo": { - "FileVersion": { - "Major": 0, - "Minor": 0, - "Patch": 0, - "Build": 0 - }, - "ProductVersion": { - "Major": 0, - "Minor": 0, - "Patch": 0, - "Build": 0 - }, "FileFlagsMask": "3f", "FileFlags ": "00", "FileOS": "040004", @@ -19,18 +7,10 @@ "FileSubType": "00" }, "StringFileInfo": { - "Comments": "zenity", - "CompanyName": "Nuno Cruces", - "FileDescription": "", - "FileVersion": "0.0.0.0", - "InternalName": "zenity", - "LegalCopyright": "© 2022 Nuno Cruces", - "LegalTrademarks": "", - "OriginalFilename": "zenity.exe", - "PrivateBuild": "", "ProductName": "zenity", - "ProductVersion": "0.0.0", - "SpecialBuild": "" + "CompanyName": "Nuno Cruces", + "LegalCopyright": "© 2022 Nuno Cruces", + "OriginalFilename": "zenity.exe" }, "VarFileInfo": { "Translation": {