如何确定创建Delphi项目的Delphi版本 [英] How do I determine the Delphi version which created a Delphi project

查看:154
本文介绍了如何确定创建Delphi项目的Delphi版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想自动弄清楚Delphi版本(安装在我的电脑上的Delphi 5到XE2)用于打开给定的项目,而不会错误地升级该项目。



直到Delphi 7,每个项目都有.ini格式的.dof文件。
Delphi 5没有任何可能有帮助的条目,但是从Delphi 6开始,有一个[FileVersion]部分包含以下值:




  • Delphi 5:N / A

  • Delphi 6:6.0

  • Delphi 7:7.0



所以我想这样做,因为较老的Delphi版本不关心我。



对于Delphi 2005和2006有一个包含版本条目的XML格式的.bdsproj文件:
\BorlandProject\PersonalityInfo\Option\Option



在Delphi 2005中,它看起来像这样:



< Option Name =VersionType =String> 1.0< / Option>



在Delphi 2006中,如下所示:



< Option Name =版本> 1.0< / Option>



所以我可以看看属性Type是否存在, 2005或2006年。
有人可以看看他的Delphi 2005和2006 p检查这个差异? (或者你可能有更好的想法?)



编辑:我只是试图验证这一点,发现Delphi 2005不始终添加类型属性。所以现在我被卡住了。



编辑:可能存储在这里的GUID对Delphi版本是唯一的?




  • Delphi 2005:{87D03616-A4C7-4B5A-AF0F-0164EA60BC59}

  • Delphi 2006:{CFE1BEE6-6FDE-4241-8CA5 -D38D14EAA768}



不知怎的,我怀疑,GUID可能代表不同的SKU(Professional / Architect等)。但也许你可以验证这个?



从Delphi 2007开始,以不同的XML格式存在.dproj文件。 Delphi 2007格式不包含任何可以找到的版本条目,但是从Delphi 2009起,似乎有以下条目:



\ project \PropertyGroup\ProjectVersion



这些是我在.dproj文件中找到的值:


$ Delphi 2009:12.0
  • Delphi 2010:12.0

  • / li>
  • Delphi XE:12.3

  • Delphi XE2:13.4



  • 如果这些是正确的,我可以可靠地确定Delphi 2007,XE和XE2。但是如何区分德尔福2009和2010?



    此外,这些数字对我来说看起来很奇怪。有没有人知道Delphi的各种更新之间是否存在差异,例如原来的Delphi XE2版本可能是从13.0开始,每个更新增加点数后的数字?但是如果是这样,Delphi XE是如何得到12.3?



    (还有一个类似的问题我该如何知道用什么版本的Delphi创建一个项目,但是单身答案相当有限。)



    如果有人需要这样做,我刚加入了一个页面到Delphi Wiki ,它总结了所有的答案,并添加了更新的Delphi版本(目前是Delphi 10.1)的信息。

    解决方案

    * PROJ文件中的版本号不限于发布或更新,并不是所有版本都在街道上。




    • Delphi XE RTM使用版本12.2

    • Delphi XE Update#1使用版本12.3

    • Delphi XE2(RTM until Updat e#4)使用13.4


    I am trying to automatically figure out which Delphi version (of Delphi 5 to XE2 installed on my computer) to use to open a given project without upgrading that project by mistake.

    Up to Delphi 7 there is a .dof file in .ini format for each project. Delphi 5 does not have any entry which might help, but starting from Delphi 6 there is a [FileVersion] section which contains the following values:

    • Delphi 5: N/A
    • Delphi 6: 6.0
    • Delphi 7: 7.0

    So I guess that settles that, since older Delphi versions do not concern me.

    For Delphi 2005 and 2006 there is a .bdsproj file in XML format containing a version entry: \BorlandProject\PersonalityInfo\Option\Option

    In Delphi 2005 it looks like this:

    <Option Name="Version" Type="String">1.0</Option>

    In Delphi 2006 like this:

    <Option Name="Version">1.0</Option>

    So I could look whether the attribute "Type" exists and depending on that decide on Delphi 2005 or 2006. Could somebody please have a look at his Delphi 2005 and 2006 projects and verify this difference? (Or do you maybe have got a better idea?)

    edit: I just tried to verify this and found, that Delphi 2005 does not always add the Type-Attribute. So now I am stuck.

    edit: Maybe the GUID stored there is unique to the Delphi version?

    • Delphi 2005: {87D03616-A4C7-4B5A-AF0F-0164EA60BC59}
    • Delphi 2006: {CFE1BEE6-6FDE-4241-8CA5-D38D14EAA768}

    Somehow I doubt it, I am afraid that the GUID may represent different SKUs (Professional / Architect etc.). But maybe you could verify this?

    Starting with Delphi 2007 there is a .dproj file in a different XML format. The Delphi 2007 format does not contain any version entry I could find, but from Delphi 2009 on there seems to be the following entry:

    \project\PropertyGroup\ProjectVersion

    These are the values I found in my .dproj files:

    • Delphi 2007: N/A
    • Delphi 2009: 12.0
    • Delphi 2010: 12.0
    • Delphi XE: 12.3
    • Delphi XE2: 13.4

    If these are correct, I could reliably determine Delphi 2007, XE and XE2. But how do I distinguish between Delphi 2009 and 2010?

    Also, these numbers look odd to me. Does anybody know whether there are any differences between the various updates of Delphi, e.g. did the original Delphi XE2 release maybe start with 13.0 and with each update increment the number after the dot? But if that's the case, how did Delphi XE get 12.3?

    (There is a similar question How can I tell what version of Delphi was used to create a project but the single answer there is quite limited.)

    Just in case anybody else needs this: I have just added a page to the Delphi Wiki which summarizes all answers and adds information for newer Delphi versions (currently up to Delphi 10.1).

    解决方案

    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

    这篇关于如何确定创建Delphi项目的Delphi版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆