Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 2.99 KB

README.md

File metadata and controls

68 lines (52 loc) · 2.99 KB

GoVersionInfo

Build Status Coverage Status GoDoc

Microsoft Windows File Properties/Version Info and Icon Resource Generator for the Go Language

Package creates a syso file which contains Microsoft Windows Version Information and an optional icon. When you run "go build", Go will embed the version information and icon in the executable. Go will automatically use the syso file if it's in the same directory as the main() function.

Example of the file properties you can set using this package: Image of File Properties

Usage

To install, run the following command:

go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo

Copy versioninfo.json into your working directory and then modify the file with your own settings.

Add a similar text to the top of your Go source code:

//go:generate goversioninfo -icon=icon.ico

Run the Go commands in this order so goversioninfo will create a file called resource.syso in the same directory as the Go source code.

go generate
go build

Command-Line Flags

Complete list of the flags for goversioninfo:

  -charset=0: charset ID
  -comment="": StringFileInfo.Comments
  -company="": StringFileInfo.CompanyName
  -copyright="": StringFileInfo.LegalCopyright
  -description="": StringFileInfo.FileDescription
  -example=false: just dump out an example versioninfo.json to stdout
  -file-version="": StringFileInfo.FileVersion
  -icon="": icon file name
  -internal-name="": StringFileInfo.InternalName
  -o="resource.syso": output file name
  -original-name="": StringFileInfo.OriginalFilename
  -private-build="": StringFileInfo.PrivateBuild
  -product-name="": StringFileInfo.ProductName
  -product-version="": StringFileInfo.ProductVersion
  -special-build="": StringFileInfo.SpecialBuild
  -trademark="": StringFileInfo.LegalTrademarks
  -translation=0: translation ID
  -ver-build=-1: FileVersion.Build
  -ver-major=-1: FileVersion.Major
  -ver-minor=-1: FileVersion.Minor
  -ver-patch=-1: FileVersion.Patch

You can look over the Microsoft Resource Information: VERSIONINFO resource

You can look through the Microsoft Version Information structures: Version Information Structures

Major Contributions

Thanks to Tamás Gulácsi for his superb code additions, refactoring, optimization to make this a solid package.

Thanks to Mateusz Czaplinski for his embedded binary resource package.