Where does Delphi get value the BDSCOMMONDIR from?

后端 未结 3 722
执笔经年
执笔经年 2021-01-13 14:35

One of my systems has a broken Delphi installation: it thinks BDSCOMMONDIR points to C:\\Windows\\system32\\9.0 whereas on a functioning system, it

相关标签:
3条回答
  • 2021-01-13 14:47

    You can go to

    Tools|Options|Environment Options|Environmental Variables

    double click on

    BDSCOMMONDIR

    and set it to whatever you want.

    Also get a look at Where are environment variables stored in registry?

    0 讨论(0)
  • 2021-01-13 14:50

    Question is rather old but here is the correct answer for future readers: RAD Studio/Delphi doesn't store the BDSCOMMONDIR (and others) in the registry but you can find it in a file named rsvars.bat, inside the \bin folder.

    Example extracted from my Delphi 10.3 Rio installation:

    @SET BDS=C:\Delphi\Embarcadero\Studio\20.0
    @SET BDSINCLUDE=C:\Delphi\Embarcadero\Studio\20.0\include
    @SET BDSCOMMONDIR=C:\Users\Public\Documents\Embarcadero\Studio\20.0
    

    unless you have manually overridden it through Environment Variables option. In that case, it will be under the registry key:

    HKEY_CURRENT_USER\Software\Embarcadero\BDS<VERSION NUMBER>\Environment Variables

    0 讨论(0)
  • 2021-01-13 14:55

    I now had access to a system with Delphi 2007 showing similar symptoms for which I used RegAlyzer to verify.

    By default, Delphi 2007 uses the SYSTEM setting of the environment variable from the registry:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
    

    It never gets the value from the USER environment variable key in the registry:

    HKEY_CURRENT_USER\Environment
    

    An override is stored by Delphi 2007 (which is BDS version 5.0) under this key:

    HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Environment Variables
    

    All three keys store regular REG_SZ name/value pairs (where name is BDSCOMMONDIR).

    My guess (I hope to eventually verify this) is that newer Delphi versions have similar behaviour because of backward compatibility.

    0 讨论(0)
提交回复
热议问题