When writing the Delphi expert using ToolsAPI, we may use GetEnvironmentVariable to retrieve the environment variables available to the current Delphi IDE process. However, this only works if the variables are define in your current user account setting or in Delphi's environment variables setting under
Tools | Options | Environment Options | Environment Variables.
Some variables like $(Config) in Delphi 2010 / XE are available for used but it doesn't appear as environment variables. We may get a list of variables by turn on "Diagnostic" in Verbosity setting. The $(Config) variable appears in Diagnostic output when compiling a project in Delphi IDE.
Is there a way to retrieve the value of $(Config) in ToolsAPI?