Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"File version" in Windows properties value is FILEVERSION not "FileVersion"

So Product Management have decreed that our software should have version numbers with 3 sets of digits rather than the usual 4 (e.g. 1.2.3 rather than 1.2.3.4)

This is easily accomplished in the "About" dialogs and elsewhere in UI, but I'm having issues with Windows properties.

When I change the values in VERSIONINFO block to:

FILEVERSION 1,2,3
PRODUCTVERSION 1,2,3

VALUE "FileVersion", "1.2.3"
VALUE "ProductVersion", "1.2.3"

I end up with the following in Windows 7's Properties > Details tab for the exe:

File version: 1.2.3.0 Product version: 1.2.3

Changing the values to all be different indicates that "File version" is taken from FILEVERSION and so always formatted as a 4-digit group value, but "Product version" is taken from "ProductVersion".

Is there any way to specify that "File version" should be taken from the "FileVersion" string value? If I remove the FILEVERSION block I just end up with a "File version" of 0.0.0.0.

I have reproduced this behaviour in VS2010 by creating an empty Win32 console application, then adding a default version resource:

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,1
 PRODUCTVERSION 1,0,2
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x40004L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "080904b0"
        BEGIN
            VALUE "CompanyName", "TODO: <Company name>"
            VALUE "FileDescription", "TODO: <File description>"
            VALUE "FileVersion", "1.0.3"
            VALUE "InternalName", "VersionT.exe"
            VALUE "LegalCopyright", "Copyright (C) 2012"
            VALUE "OriginalFilename", "VersionT.exe"
            VALUE "ProductName", "TODO: <Product name>"
            VALUE "ProductVersion", "1.0.4"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x809, 1200
    END
END

Resulting in the same issue: properties http://media.use.com/images/s_1/4ba4e5b1b235179b1c9a.jpg

This image may come out small, so I'll just confirm that it says File version 1.0.1.0 Product version 1.0.4

Before I tell Product Management that this is the best we can do, is there any way to get Windows to show the "FileVersion" string value instead? I've read through the VERSIONINFO documentation on MSDN, and can't see any flags that I can set to do this.

like image 468
Chris Avatar asked Nov 13 '22 04:11

Chris


1 Answers

After building and installing this shell extension I found at CodeProject, it seems that this is due to Windows 7 displaying only a subset of the versioninfo properties, and there's nothing I can do to change it. The FileVersion string is present in the exe, it just isn't displayed in the default properties dialog.

like image 190
Chris Avatar answered Dec 22 '22 08:12

Chris