I would like to know if there is a way to get my application directory on macOS.
On Windows and Linux I can use ParamStr(0) and Application.ExeName but on macOS they don't work in the same way as in Windows and Linux (documented here:
https://www.freepascal.org/docs-html/rtl/system/paramstr.html).
Here two different tests.
On macOS if I add the path of my application to PATH:
export PATH=/Applications/myapp.app/Contents/MacOS:$PATH
If I use ParamStr(0) I get:
myapp
If I use Application.Exename I get:
/Applications/myapp.app/Contents/MacOS/myapp
If I create a link to myapp:
ln -s /Users/myname/Documents/myapp myapplnk
using ParmaStr(0) I get:
myapplnk
Using Application.Exename I get:
/Users/myname/Documents/myapplnk
Is there a way to get the full path of my exe even using macOS commands?