3
votes

I have been upgrading my old Delphi 2007 code to Delphi XE8 where I observed very strange behavior on version information of the program.

Following is the Version.rc file I used to compile with test project.

1 VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,3
FILEOS 0x4
FILETYPE 0x2
{
BLOCK "StringFileInfo"
{
    BLOCK "080904E4"
    {
        VALUE "CompanyName", "ABC Inc\000"
        VALUE "FileDescription", "Version Testing\000"
        VALUE "FileVersion", "0.0.0.0\000"
        VALUE "ProductName", "VERT001\000"
        VALUE "ProductVersion", "A003\000"
    }
}

BLOCK "VarFileInfo"
{
    VALUE "Translation", 0x0809 0x04E4
}
}

When I look version info from Windows 8.1 machine, I get this detail:

enter image description here

And When I look version info from Windows Server 2012, I get this detail:

enter image description here

Initially I though that it may be issue of FILEOS parameter and I changed it to VOS_NT_WINDOWS32 or even VOS_NT however It did not changed anything.

The same test project when compiled with Delphi 2007 shows version details correctly on both the OS.

Did anyone face similar issue in recent past ?

1
Are you 100% sure that the IDE is not overriding your resource? Use a resource editor to check the resource that is compiled into your application.David Heffernan
It seems that IDE always try to override the flag [Include version information in project]. Even when I unchecked it and save/build project. IDE seems to be auto selecting it before each build. Let me see if there is some work around to it.DivX
I don't have such a problem. You may need to clear out the .dproj file manually. I also, in the .dpr file, replace {$R *.res} with {$R MyProjectName.res} which I suspect is important.David Heffernan
If I edit the dproj file in notepad and change <VerInfo_IncludeVerInfo>false</VerInfo_IncludeVerInfo>, IDE does not auto select the version info. Now EXE generated is showing correct version info on both the OS. Thanks David for showing the path towards the issue.DivX
@DavidHeffernan Nice finding! It took me several hours hunting down the issue! In addition to this cause, another reason is that my dpr file includes an outdated .res file. Everything was fine under Win7 but not Win10.Edwin Yip

1 Answers

4
votes

After help from David I found that issue was of dproj file. When I specified <VerInfo_IncludeVerInfo>false</VerInfo_IncludeVerInfo>, VersionTest.exe started showing correct versions on both the OS.