• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Permissions for User and /Library install
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Permissions for User and /Library install


  • Subject: Re: Permissions for User and /Library install
  • From: Stéphane Sudre <email@hidden>
  • Date: Mon, 6 Aug 2007 20:53:11 +0200


On lundi, août 6, 2007, at 08:36 PM, Bryan Hansen wrote:

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).

My $0.02


_______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Permissions for User and /Library install (From: Bryan Hansen <email@hidden>)

  • Prev by Date: Permissions for User and /Library install
  • Next by Date: Re: Permissions for User and /Library install
  • Previous by thread: Permissions for User and /Library install
  • Next by thread: Re: Permissions for User and /Library install
  • Index(es):
    • Date
    • Thread