Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Win32 resource file multiple translations

I want to use a resource script for my project. The project is compiled using MinGW.

resource.rc:

#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION     1,0,0,0
PRODUCTVERSION  1,0,0,0
//FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
//FILEFLAGS       VER_PRIVATEBUILD
FILEOS          VOS_NT_WINDOWS32
FILETYPE        VFT_APP
FILESUBTYPE     VFT2_UNKNOWN
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904E4"
        BEGIN
            //VALUE "Comments",         ""
            VALUE "CompanyName",      "Company"
            VALUE "FileDescription",  "Test for the resource.rc"
            VALUE "FileVersion",      "1.0"
            VALUE "InternalName",     "ResourceTest"
            //VALUE "LegalCopyright",   ""
            //VALUE "LegalTrademarks1", ""
            //VALUE "LegalTrademarks2", ""
            VALUE "OriginalFilename", "ResourceTest.exe"
            VALUE "PrivateBuild",     "Built by me." //With VS_FF_PRIVATEBUILD
            VALUE "ProductName",      "resource.rc Test"
            VALUE "ProductVersion",   "1.0"
        END
    END

    BLOCK "VarFileInfo"
    BEGIN
        /* The following line should only be modified for localized versions.     */
        /* It consists of any number of WORD,WORD pairs, with each pair           */
        /* describing a language,codepage combination supported by the file.      */
        /*                                                                        */
        /* For example, a file might have values "0x409,1252" indicating that it  */
        /* supports English language (0x409) in the Windows ANSI codepage (1252). */
        VALUE "Translation", 0x407, 1252 //German
        VALUE "Translation", 0x409, 1252 //U.S. English

    END
END

I compile it using windres -o Resource.o resource.rc and link it with gcc -mwindows -o Resourcetest.exe Launcher.o Resource.o. My console output:

windres -o Resource.o resource.rc
windres: resource.rc:39: syntax error
make: *** [Resource.o] Error 1

Line 39 is the second Translation line: VALUE "Translation", 0x409, 1252. But refering to MSDN this is currect. But what went wrong?

like image 668
das_j Avatar asked Jan 08 '13 18:01

das_j


Video Answer


1 Answers

You can't have multiple VALUE "Translation" lines in the VarFileInfo block. Instead, as the comment says, you must have a single line with one or more WORD,WORD pairs.

For example,

VALUE "Translation", 0x407, 1252, 0x409, 1252
like image 96
Jonathan Potter Avatar answered Oct 03 '22 16:10

Jonathan Potter