In Delphi 12 you can write:
TPath.GetAppPath();
https://docwiki.embarcadero.com/Libraries/Athens/en/System.IOUtils.TPath.GetAppPath