For a release pipeline I need to update the ProductVersion
field of a win32 exe. All the other fields are updated in the build pipeline of each application. The release pipeline covers multiple applications and bundling them into an archive, which should be tagged with a new version.
The property of the exe prior to release pipeline is shown below and the only field left to fill is ProductVersion
.
There are numerous exe's like such and I just need to update the Product version. I am able to update that field using a Resources.rc
file and the tool ResourceHacker
, but I need to include info on all the other fields too, which is not possible during a release build as the file version info is not known at the time. i.e
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,3,5
PRODUCTVERSION 1,2,3,5
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "CompanyName", "Tester.\0"
VALUE "FileDescription", "Test Application for release\0"
VALUE "FileVersion", "1.2.3.5\0"
VALUE "LegalCopyright", "2023 Copyright Notice. All rights reserved\0"
VALUE "ProductName", "TestRelease\0"
VALUE "ProductVersion", "2.2.2.2\0"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1200
}
}
I thought just including the productversion in the rc file would work and ignore updating the other fields but it just cleaned all the properties like below.
VS_VERSION_INFO VERSIONINFO
PRODUCTVERSION 2,2,2,2
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "ProductVersion", "2.2.2.2\0"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1200
}
}