Re: Permissions for User and /Library install
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com On lundi, août 6, 2007, at 08:36 PM, Bryan Hansen wrote: My $0.02 _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... I am trying to write an installer which will install files into the /Library/Application support/ folder to be available to all users and some files which will be installed in the users home directory > Library. It seems that I will need to require admin or root privileges in the installer, but I'd like the files being installed into the users library to be owned by that user NOT root or admin. Is it possible to do this by adjusting settings in my Packagemaker project or through the use of a postscript installer. I already have some postscript functionality for moving the files into the User's home library from a temporary directory, but setting the permissions for these files to the users is proving harder. Is there a unix command to chown files to whatever the currently logged in user is? And how might that command be affected by running the installer as admin or root? Well, since you know where the user home folder is ($User), this means the only missing information is the group name. Depending on the OS version, it's either staff, admin or $User, or wheel. To do this more cleverly, you could run a ls command on the user home folder, it will provide you with the name of the group and with a little help from awk you should be able to retrieve the group name for the user. Of course, you can also write your own tool to do this. You could for instance get the information from Open Directory and use the BSD API (the Carbon APIs are not working correctly most of the time as are the Cocoa APIs). This email sent to site_archiver@lists.apple.com
participants (1)
-
Stéphane Sudre