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
1) They are simply environment variables which Delphi sets for its own process and you can retrieve them with GetEnvironmentStrings from a design package installed in the IDE; here's an example.
If your installer is a separate executable, you can still (more or less reliably) guess where to get some of the values:
BDS: RootDir value in the registry, e.g. HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\8.0\BDSCOMMONDIR: in older versions (Delphi 2007, I guess) this was a global environment variable, set by the Delphi installer. In later versions you can find it in rsvars.bat.Some others might probably be derived, e.g.:
BDSLIB: $(BDS)\libBDSINCLUDE: $(BDS)\includeUser-defined variables (defined in Delphi's Environment Options dialog) are stored in the Environment Variables registry subkey.
2) The $(...) notation is IMHO simply better because it has distinct opening and closing delimiters, it's easier to work with for search/replace operations and also more readable.