How do I determine the Delphi version which created a Delphi project

Today I find this topic googlin about Delphi edition (Standard, Professional, Enterprise).

Anyway I checked some .dof files spread in mine machine and there is facts related to ancient delphi versions:

if a .dof file exists -> read [Directories]/Packages

Delphi 3

[Directories]
OutputDir=
UnitOutputDir=
SearchPath=
Packages=VCLX30;VCL30;INETDB30;INET30;

Delphi 5

[Directories]
OutputDir=.
UnitOutputDir=.
PackageDLLOutputDir=.
PackageDCPOutputDir=.
SearchPath=
Packages=Vcl50;Inet50;Inetdb50;Vclx50;Indy50;

Additional info can be finded near end of dof file:

D3:

[Excluded Packages]
C:\Program Files\Borland\Delphi 3\Bin\DCLDSS30.dpl=Delphi Decision Cube Components
C:\PROGRAM FILES\BORLAND\DELPHI 3\BIN\DCLTEE30.DPL=Delphi TeeChart Components

D5:

[Excluded Packages]
$(DELPHI)\Bin\CorIde50.bpl=Borland Core IDE Package
$(DELPHI)\Bin\direct50.bpl=Borland Direct IDE Package

The version numbers in the *PROJ files are not bound to releases or updates and not all versions hit the streets.

  • Delphi XE RTM used version 12.2
  • Delphi XE Update #1 uses version 12.3
  • Delphi XE2 (RTM till Update #4) uses 13.4

I have now compared the .bdsproj files of Delphi 2005 and 2006 and there is no difference. Also, there is no difference between the .dproj files created by Delphi 2009 and 2010.

So the answer is:

  • if a .dproj file exists -> read \project\PropertyGroup\ProjectVersion
    • empty -> Delphi 2007
    • 12.0 -> Delphi 2009 or 2010
    • 12.2 or 12.3 -> Delphi XE1 (according to Uwe Schuster)
    • 13.4 -> Delphi XE2
  • if a .bdsproj file exists -> Delphi 2005 or 2006
  • if a .dof file exists -> read [FileVersion]\version
    • empty -> Delphi 5 (or possibly older)
    • 6.0 -> Delphi 6
    • 7.0 -> Delphi 7

Unfortunately this does not allow me to write a program that automatically starts the correct Delphi version for a given project.

Maybe I will let the program ask the user if there are two possibilities and store his answer in a .ini file so the next time the program knows which Delphi version to start.

btw: The reason I was looking into this is that I have several times accidentally opened Delphi 2007 projects with a later Delphi version which upgraded it and I had to reverse these changes by hand. This has become so annoying that I wanted to prevent it by registering my own program as handler for .dpr files.


Just installed XE3 (RTM). 14.3 XE3 (C++ & Delphi)

Tags:

Delphi