my app installer uses the standard open DMG, drag to 'Applications' for installation, but I want to update $PATH
so my app can be used from the command line.
I think the right way to do this is to call a script on the first time my application runs that creates a file myapp
in /etc/paths.d
with the text /Applications/myapp/bin
followed by a newline(ascii 13):
rm /etc/paths.d/myapp
echo "/Applications/myapp/bin" > /etc/paths.d/myapp
currently I'm getting errors;
rm: /etc/paths.d/myapp: No such file or directory
./myapp.sh: line 2: /etc/paths.d/myapp: Permission denied
I need to trigger a request for the user to type the admin password but I'm not sure how to do that in a way this clearly inform the user what changes I am making to their system and why. (I can add it to the manual but who reads that)
Any suggestions?
PS I need to do the same on linux(hopefully similar) and Windows, but if I can get MacOS sorted hopefully I'll know where to start.