0

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.

0

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. – Dan Apr 19 '16 at 17:17
  • Unless you include an uninstaller to reverse the process : ) – D Schlachter Apr 19 '16 at 17:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.