-
Notifications
You must be signed in to change notification settings - Fork 0
Version info
Each binary has a Windows version information resource, as any well behaved application should have. Various standard items are encoded along with some other useful items related to the build.
This is done through compiling in a specific type of Windows resource from a textual script file.
A template is in source control thus:
The file format is clever enough to support #include, which allow shared boilerplate to be extracted out to a shared file resource. If we were using SVN, then TortoiseSVN has a simple tool to allow textual substitution that will allow builds to always encode some properties of the working copy code used for the build.
As in this case, I haven't found a substitute, we have to generate the info using a build step. Further, as in this case, I haven't factored out the binaries in separate folders, the version scripts needs to embed the binary name as a a pair of keys generated in the build step. Hence the pre and post segments and the actions for exe and dll generating ad-hoc scripts.
VS_VERSION_INFO VERSIONINFO
#include "vs_ffi.rcinc"
#include "build_ffi.rcinc"
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0x0L
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
#include "appkeys.rcinc"
#include "buildkeys.rcinc"
VALUE "OriginalFilename", "Template.exe\0"
VALUE "InternalName", "Template\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END
The BCB IDE has typically managed the version info, by creating the output version info resource, ready to be linked in, and allowing edits to the data via an editor. This behaviour can be turned off, allowing a custom resource to be linked in, however, the editor still shows and ostensibly allows edits. These will be over-written in the first CLI build, however.
Currently only the target name is built into the version info. It would be useful to specify other application facts in a text file, keyed by target name. A bit of text processing could do the job.