I'm using an external file (verinfo.rc
) to generated the details of the compiled EXE file. Here is an example of how my file looks like:
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Company Soft"
VALUE "CompanyName", "Company2"
VALUE "FileDescription", "Company Soft"
VALUE "FileVersion", "x.x.x.x"
VALUE "InternalName", "Company Soft"
VALUE "LegalCopyright", "Company2"
VALUE "OriginalFilename", "abrev.exe"
VALUE "ProductName", "Company Soft"
VALUE "ProductVersion", "x.x.x.x"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409,1200
END
END
Looking into the compiled EXE's details using the Explorer I note that some data get wrecked and crazy symbols appears. What is happening?
CodePudding user response:
try terminating your string values with a null terminator \0
, eg:
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Company Soft\0"
VALUE "CompanyName", "Company2\0"
VALUE "FileDescription", "Company Soft\0"
VALUE "FileVersion", "x.x.x.x\0"
VALUE "InternalName", "Company Soft\0"
VALUE "LegalCopyright", "Company2\0"
VALUE "OriginalFilename", "abrev.exe\0"
VALUE "ProductName", "Company Soft\0"
VALUE "ProductVersion", "x.x.x.x\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409,1200
END
END
CodePudding user response: