Version info .EXE with gcc and windres

1.6k views Asked by At

I have a problem with version information into a console program. I use Code::Blocks and mingw/gcc, under Windows. I have two programs. The first (wxWidgets based) have no version problem, all is visible in information window. The second (console) is made following the same way (this), but no information is visible in the property window.

This is my resouce.rc file:

aaaa ICON "icon.ico"

#include "version.h"

VS_VERSION_INFO VERSIONINFO
    FILEVERSION    RC_FILEVERSION
    PRODUCTVERSION RC_FILEVERSION
{
    BLOCK "StringFileInfo"
    {
        BLOCK "040C04E4"
        {
            VALUE "CompanyName",        "Compagny\0"
            VALUE "FileDescription",    "Description\0"
            VALUE "FileVersion",        FULLVERSION_STRING
            VALUE "LegalCopyright",     "Copyright (C) 2017\0"
            VALUE "OriginalFilename",   "program.exe\0"
            VALUE "ProductName",        "Program\0"
            VALUE "ProductVersion",     FULLVERSION_STRING
        }
    }
    BLOCK "VarFileInfo"
    {
        VALUE "Translation", 0x40C, 0x4E4 // French, multilingual
    }
}

The icon of the EXE file is good, so the resource file is correctly read by the compiler. No error during windres compilation.

"version.h" is the one generated by Code::Blocks AutoVersioning addon.

What can I do to have this version information visible in property window?

Thanks in advance.

1

There are 1 answers

0
leaumonte On

You just have to add in the beginning of your .rc file the following header

#include "winver.h"

and it should work as expected.

Best regards