How are Delphi 'environment variables' such as $(BDS) evaluated?

前端 未结 5 2178
梦谈多话
梦谈多话 2020-12-06 01:17

I\'m making some tidy installers for our internal libraries (instead of just opening the DPK\'s and clicking \'install\' and getting in a mess later...) and this has caused

5条回答
  •  青春惊慌失措
    2020-12-06 01:36

    David is right that these variables are specific to Delphi (and C++ Builder), and they are not available as "normal" environment variables.

    However, they can be looked up in the registry. The key is: HKCU\Software\\BDS\\Environment Variables.

    Any custom "environment" variables that you add can be found here as well. For example I have a $(MVC) variable to point to the folder where all my components(' versions) can be found.

    At work we use the registry to look up the values in a script/app combination to convert dprojs to cfg files for our build server which uses the command line compiler. (As we don't use the IDE on the build machine, we have added our custom Delphi environment variables to the registry manually).

    Update

    Actually, the Environment Variables key is used for user defined environment variables and for overrides of the "standard" BDS environment variables. The default values of any $(BDS*) environment variable is nowhere to be found in the registry...

    So, current knowledge says, if you want to get your hands on the values for the $(BDS*) vars, you would have to override the default values and read the ones you specified from the Environment Variables key.

提交回复
热议问题