How do I embed version information into a windows binary?

前端 未结 4 834
有刺的猬
有刺的猬 2021-01-19 04:31

You probably know that Windows has that option where you can view the properties of a binary and it will display information about the author, the version number, the compan

4条回答
  •  太阳男子
    2021-01-19 04:49

    Assuming windows PE binaries, the Version information is stored in the PE header, in the IMAGE_OPTIONAL_HEADER section under the locations:

    WORD MajorImageVersion
    WORD MinorImageVersion
    

    About which this documentation says:

    A user-definable field. This allows you to have different versions of an EXE or DLL. You set these fields via the linker /VERSION switch. For example, "LINK /VERSION:2.0 myobj.obj"

提交回复
热议问题