I'm developer and I'm providing my application with pkg installer. Before El Capitan, my installer was putting binaries to /usr/bin
. With El Capitan I had to change it because of SIP, so now binaries go to /usr/local/bin
. According to some reports /usr/local/bin
is accessible only for sudoers, "regular" user can't access it. What should be the right location to install my application, so every user could access it?
-
1If it was in /usr/bin before you needed admin rights i.e. use sudo before - regular accounts should not have been able to modify /usr/bin– mmmmmmNov 11, 2015 at 13:21
1 Answer
For command line tools accessed by any user, /usr/local/bin
is the best location.
System Wide Requires Admin
That sudo
may also be required is also correct. An administrator should be required to make changes that affect other users of a computer. Ideally only users who are administrators can make system wide changes.
Practically this means your Installer package should require admin rights to be installed. Installer.app will take care of enforcement for you.
pkgbuild
Hopefully you are using pkgbuild
to create the Installer package.
If so, make sure you pass the destination path /usr/local/bin
using the --install-location
flag.
Avoid embedding standard parent folders in your package and installing to /
. No package should need to install directly to /
.
This will ensure any existing /usr/local/bin
folder path retains its permissions and your package does not damage any existing settings. If the destination path does not exist, Installer.app will create it for you.