我正在从命令行构建Delphi项目,并使用brcc32.exe
构建.res
文件。
我在.RC
添加了一些自定义字符串,所以它看起来像这样。 (有一个小的Delphi5应用程序可以从模板中准备这个.RC)
1 VERSIONINFO
FILEVERSION 999,0,0,339
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904E4"
BEGIN
VALUE "FileDescription","Debug Build"
VALUE "FileVersion","999.0.0.339"
VALUE "LegalCopyright", "HuwCorp Finance Ltd"
VALUE "Revision","339"
VALUE "LastChangeRevision","335"
VALUE "LastChangeDate","2013-06-07"
VALUE "LastChangeTime","13:17:14"
VALUE "LastChangeAuthor","foo1234"
VALUE "BuildDate","12/06/2013"
VALUE "BuildTime","10:36:59"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 2057, 1252
END
END
到目前为止一切顺利,但是BRCC32
步骤会产生一个看起来像这样的错误.res
文件(通过资源构建器查看)
VALUE "LastChangeDate", "2013-06-074\x08\x01LastChangeTime"
VALUE "LastChangeTime", "13:17:146\x07\x01LastChangeAuthor"
VALUE "LastChangeAuthor", "foo1234"
VALUE "BuildDate", "12/06/2013,\x08\x01BuildTime"
VALUE "BuildTime", "10:36:59D"
确实在构建的.exe
上点击属性/版本会显示垃圾字符,例如BuildTime显示为10:36:59D
任何人都可以建议为什么?
答案 0 :(得分:8)
StringTable资源需要以C风格的空终止(即使使用Borland资源编译器)。
请改为尝试:
VALUE "FileDescription","Debug Build\0"
VALUE "FileVersion","999.0.0.339\0"
VALUE "LegalCopyright", "HuwCorp Finance Ltd\0"
VALUE "Revision","339\0"
VALUE "LastChangeRevision","335\0"
VALUE "LastChangeDate","2013-06-07\0"
VALUE "LastChangeTime","13:17:14\0"
VALUE "LastChangeAuthor","foo1234\0"
VALUE "BuildDate","12/06/2013\0"
VALUE "BuildTime","10:36:59\0"