Re: Dir creation from installer tool is always locked
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com User-agent: Thunderbird 2.0.0.12 (Macintosh/20080213) I was finally able to get it to work from the postinstall script itself: USER="$HOME" LIBRARY_RECEIPTS_DIR="/Library/Receipts/" USER_LIBRARY_RECEIPTS_DIR="${USER}${LIBRARY_RECEIPTS_DIR}" mkdir -m 777 "${USER_LIBRARY_RECEIPTS_DIR}" The issue is not with the tool AFAIK, it's in these APIs. Stéphane Sudre wrote: On Apr 19, 2008, at 12:46 AM, Mike wrote: Stéphane Sudre wrote: On Apr 19, 2008, at 12:09 AM, Mike wrote: No matter what I do, and no matter what permissions I give to subpackages in my metapackage, when I have my postinstall script run a CoreFoundation tool that I bundle in my installer, any directories created by my tool at postinstall time are created with 'system' as being the owner, and hence such directories are locked. How do I create a directory from within a postinstall tool that is unlocked? I had assumed that since the package was running with root permissions and since the installer has authorization, the directory would be created with unlocked permissions. Attempting to set the owner or group or permissions on any created dirs after they are created also fails. Stupid questions of the day: - Which API and methods do you use to create your directory? - Which API and methods do you use to to change the owner, group or permissions? I tried both the NSFileManager methods and Carbon methods such as FSCreateDirectoryUnicode and -fileAttributesAtPath:traverseLink: and -changeFileAttributes:atPath. Those all fail apparently because the tool I launch is running with the wrong owner or permissions. I was unaware of the -m option for mkdir. For some reason postinstall runs with adequate permissions, but any sub-binaries it launches don't. I've never been able to use the NSFileManager of FSCatalogInfo API to change the permissions or owners of a file/directory in 7 years. I will avoid the rant on NSFileManager and just say that I always use the chown and chmod BSD C methods because they just work. My guess is if I went to all the trouble writing a real helper tool, and jumped through all the Apple hoops for setting it up and executing it properly, the NSFileManager & Carbon calls would work. But who would want to go to all that trouble when one can just add a few lines to the postinstall and let the installer handle the rest. _______________________________________________ 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Mike