visual-studio-2010command-lineversioninfo

Command line defines for rc.exe ms resource compiler to set version values in VersionInfo


I'm trying to configure our resource build to take version info on the command line

rc.exe /DVERCSV=8,0,0,0 /DVERDOT="8.0.0.0"

I thought it was working to start with, but there seems some glitch.

I seem to be getting a corruption when viewing in explorer - shows rubbish in the ProductVersion string, however opening the exe or res file shows the string values properly

however explorer is able to show the desired value if storing the value directly in the rc, or editing it to the 'same' value (minor change to get it to save) in visualstudio reosurce editor (after compilation to .res)

VS_VERSION_INFO VERSIONINFO
 FILEVERSION VERCSV
 PRODUCTVERSION VERCSV
 FILEFLAGSMASK 0x17L
 FILEFLAGS 0x0L
 FILEOS     VOS_NT_WINDOWS32
 FILETYPE   VFT_APP
 FILESUBTYPE    VFT2_UNKNOWN
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "FileDescription", "XXX Application"
            VALUE "FileVersion", VERDOT
            VALUE "InternalName", "XXX"
            VALUE "LegalCopyright", "Copyright (C) 2010"
            VALUE "OriginalFilename", "XXX.exe"
            VALUE "ProductName", "XXX Application"
            VALUE "ProductVersion", VERDOT
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

I've tried a variety of other things to resolve


Solution

  • I saw corruption too, not so sure it matches your case since I used the IDE and you didn't describe what you saw. Post a screen shot next time. The number is embedded in binary instead of ASCII, producing a single character when viewed in the property sheet, a black rectangle with a white center circle. Character code 8.

    I fixed it by putting two pair of double-quotes around the string so the inner pair survives a trip through cmd.exe:

    /DVERDOT=""8.0.0.0""