Any way to set file properties for windows executables?

1,340 views
Skip to first unread message

Nate Finch

unread,
Jan 21, 2013, 7:26:34 PM1/21/13
to golan...@googlegroups.com
Windows has some standard file metadata that can be set on executables... I'd like to be able to set that in my projects... but I can't seem to google fu my way into how to do it (other than using a third party tool to retroactively set the properties after the build).

Nate Finch

unread,
Jan 21, 2013, 8:03:40 PM1/21/13
to golan...@googlegroups.com

I guess I didn't actually ask a question here - is there a way to set this stuff (file version,  copyright, etc) that can be defined as part of the Go build?

On Jan 21, 2013 7:26 PM, "Nate Finch" <nate....@gmail.com> wrote:
Windows has some standard file metadata that can be set on executables... I'd like to be able to set that in my projects... but I can't seem to google fu my way into how to do it (other than using a third party tool to retroactively set the properties after the build).

--
 
 

Ken Allen

unread,
Jan 21, 2013, 10:50:14 PM1/21/13
to golan...@googlegroups.com
I think if you make a .rc file with a VERSIONINFO resource in it you can use windres (from mingw) to compile it into a .syso file. Then you can just stick that in the directory with your main package and go build will link it. I've used this to put icons on my executables.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058(v=vs.85).aspx

Joseph Spurrier

unread,
Sep 1, 2015, 9:58:20 AM9/1/15
to golang-nuts
I know this is an old post, but for those still looking, you can use my package: https://github.com/josephspurrier/goversioninfo.
Reply all
Reply to author
Forward
0 new messages