Sergey Konkin
Sergey Konkin

Reputation: 95

How to manualy change Version Info in Delphi project

I want to manualy set an Version of program in Delphi project, without IDE. When I change a *.dproj file like this:

  <VersionInfo>
    <VersionInfo Name="IncludeVerInfo">True</VersionInfo>
    <VersionInfo Name="AutoIncBuild">False</VersionInfo>
    <VersionInfo Name="MajorVer">1</VersionInfo>
    <VersionInfo Name="MinorVer">2</VersionInfo>
    <VersionInfo Name="Release">3</VersionInfo>
    <VersionInfo Name="Build">456</VersionInfo>
    <VersionInfo Name="Debug">False</VersionInfo>
    <VersionInfo Name="PreRelease">False</VersionInfo>
    <VersionInfo Name="Special">False</VersionInfo>
    <VersionInfo Name="Private">False</VersionInfo>
    <VersionInfo Name="DLL">False</VersionInfo>
    <VersionInfo Name="Locale">1049</VersionInfo>
    <VersionInfo Name="CodePage">1251</VersionInfo>
  </VersionInfo>
  <VersionInfoKeys>
    ...
    <VersionInfoKeys Name="FileVersion">1.2.3.456</VersionInfoKeys>
    ...
    <VersionInfoKeys Name="ProductVersion">1.2.3.456</VersionInfoKeys>
  </VersionInfoKeys>

and then build project through CMD with MSBuild:

call rsvars.bat
MSBuild.exe blabla.dproj /p:configuration=release

I get the *.exe file with empty Version Info in file properties

But when I set the version in the IDE and build using the same MSBuild calling, everything works fine. *.exe have the Version Info

QUESTION: Why do I get different resuslt with the SAME *.dproj file?

Upvotes: 2

Views: 4045

Answers (1)

Stijn Sanders
Stijn Sanders

Reputation: 36840

Normally when you delete the MyProject.res file, normally Delphi should be able to reconstruct it again from the other project data.

I know the IDE does, check if the command line compiler does also. In the little work I did with Delphi XE2 I've seen a cgrb.exe (Code Gear Resource Builder) that does just that.

So when updating the version numbers in the .dproj, delete the .res and have the build process re-create it.

Upvotes: 1

Related Questions