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

Viewed 21802

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 me to have to understand how to get at various Delphi variables such as Known Packages, the registry RootDir value etc.

I see that within Delphi there are a number of variables that you can use (within a search path for example) such as $(BDS) etc. When I look into my machine environment variables I dont see these, either in system or current user.

My questions are:

  1. Is Delphi doing something internal to expand $(BDS) etc itself? Or can I use these externally in some way (eg looked up in the registry).
  2. Why is the notation $(xxxx) within a search path and not %xxxx% as with an envirnment variable? Thanks
5 Answers

Thanks, I thought I would add that when I created a new environment variable - (to be used in my DCC_UnitSearchPath as $(VISEMS) ), I observed that it was placed into the registry.

For a specific example I found it in: Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\17.0\Environment Variable

The "accepted answer" above needs to be updated to reflect the there are version numbers in the registry path, since in my case, the "accepted answer" is incorrect (when it says: HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\8.0\ ) as there is nothing at "BDS\8.0" since 8.0 is not installed on my computer.

Related