I want to make an OSX application bundle that installs a command-line tool. Is this possible, and if so, how? The docs make it sound like the keys APInstallerURL
and APFiles
in info.plist
can be used for this, but they don't make it clear how.
1 Answer
I would just have the app:
- First, check if the executable is already installed (e.g. check the return code of
which yourExecutable
) - If not installed, copy the executable to
/usr/local/bin/
, or somewhere else (your pick) - If not copied to
/usr/local/bin/
, add the executable's location to the user's $PATH (add the following line to the end of their~/.bash_profile
:export PATH=$PATH:/path/to/executable
)
If the application bundle is exclusively for installing the tool, you could even do all this in AppleScript.
-
The problem is that this has the same downside as
.pkg
files; the file can't be uninstalled automatically.– DanApr 19, 2016 at 17:17 -