Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VERSIONINFO resource not being shown in EXE properties

I'm using Delphi 10.0 Seattle on a machine with Windows 10.

We have a system that has several executables. We use the version information via .rc file:

1 VERSIONINFO
  FILEVERSION 18,2,0,1660
  PRODUCTVERSION 18,2,0,0
  FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
  FILEFLAGS (VS_FF_SPECIALBUILD|VS_FF_PRERELEASE)
  FILEOS VOS__WINDOWS32
  FILETYPE VFT_APP
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "041604E4"
        BEGIN
            VALUE "CompanyName", "BLA BLA BLA\0"
            VALUE "FileDescription", "BLA BLABLA - DESCRICAO\0"
            VALUE "FileVersion", "18.2.0.1660\0"
            VALUE "InternalName", "nomexecutavel.exe\0"
            VALUE "LegalCopyright", "Copyright 2018\0"
            VALUE "LegalTrademarks", "BLA BLA BLA é marca registrada\0"
            VALUE "OriginalFilename", "nomeexecutavel.exe\0"
            VALUE "ProductName", "nomedoproduto\0"
            VALUE "ProductVersion", "18.2.0\0"
            VALUE "SpecialBuild", "Para Homologação\0"
            VALUE "GitRevision", "790d79ee92af023d6beac953072c45b0385df17f\0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x0416, 1252
    END
END

This .rc file is compiled through brcc32.exe.

In the project file the .RES file information generated by brcc32 is loaded.

{$R VersionInfoFactor.res}

After I do the build and install on a Windows machine in Portuguese, I can view the version information by right-clicking on the executable, selecting Properties, then Details.

So far, this is nothing new, it shows the data that is informed in the .rc file.

Version Ok

Now, if I install this same executable on a Windows machine in another language, I can no longer view this information.

Would anyone know the cause?

Not Ok has an error of versioninfo

like image 572
Ricardo Avatar asked Feb 14 '18 14:02

Ricardo


1 Answers

Your resource script provides version info for ONLY Portuguese and no other language. So, of course, a non-Portuguese machine won't display anything meaningful.

You need to provide multiple StringFileInfo blocks, one for each language you want to support. And you should have a block for US English, which is the fallback when a block for a specific language is not provided.

You should organize the blocks in this order, per Hierarchical Organization of Resources for Localization:

  • US English
  • Neutral cultures
  • Specific cultures

On a side note, you don't need to invoke brcc32.exe manually. The Delphi compiler can do that for you, if you include the .rc filename in the {$R} directive:

{$R VersionInfoFactor.res VersionInfoFactor.rc}
like image 120
Remy Lebeau Avatar answered Oct 15 '22 13:10

Remy Lebeau