0

I added some new environment variables in the IDE setup:

Tools > Options > Environment Options > Environment Variables > User Overrides

Those are just some paths like: $(MYPROJ_ROOT)\Source.

How can I retrieve one of them using the OpenTools API?

The IDE that I'm using is Delphi 10.2 Tokyo.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Ali Dehban
  • 88
  • 1
  • 8
  • 3
    You can use [`GetEnvironmentStrings`](https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-getenvironmentstrings?redirectedfrom=MSDN) as described [here](https://stackoverflow.com/a/6870985/11480). – Ondrej Kelle Feb 11 '20 at 15:25

1 Answers1

6

The IOTAServices interface offers a function ExpandRootMacro just for this purpose.

Uwe Raabe
  • 45,288
  • 3
  • 82
  • 130