Re: Installer plug-ins and /tmp issues
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Am 29.03.2007 um 21:04 schrieb Atticus O Gifford <atticus@MIT.EDU>: Have you checked if this might be a permissions problem? Basically I'm using this code in my didExitPane: method: strlcpy(nnnProductPath, tmpPath, sizeof(nnnProductPath)); strlcat(nnnProductPath, nnnProductFileName, sizeof(nnnProductPath)); int nnnChoiceFile = open(nnnProductPath, O_WRONLY | O_CREAT | O_TRUNC, 0660); // ... write to the file... close(nnnChoiceFile); (plus error handling of course) 1) Should I be using /private/tmp rather than /tmp? I'm not sure which is the more appropriate location. See above. HTH Mike -- Mike Fischer Softwareentwicklung, EDV-Beratung Schulung, Vertrieb Web: <http://homepage.mac.com/mike_fischer/index.html> Note: I read this list in digest mode! Send me a private copy for faster responses. _______________________________________________ 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 brings me to the main issue I'm having (sorry for all the description): I need a way to pass the information gathered in the plug-in phase to a package later in the installation process that does all the actual file- writing (this is a distribution package). I'm doing something similar in an Installer package written for a customer of mine. I'm currently using /tmp as a well-known location to pass messages in text files, but I'm not sure that's the best solution here. Additionally, the package that does the writing at the end seems to have trouble installing files to /tmp (I get generic errors, and the installer quits with no other information). My Installer package needs admin/root permissions anyway so for me this is not an issue. I write a file using a UUID name (to avoid conflicts with a very high probablity) to /tmp from my Installer Plugin. In the postflight script I then read that file, process its contents and then delete it. This works fine for me. (During my initial testing last year I found no other way to pass information from an Installer Plugin to a postflight script. If anybody has a better way, I'd be delighted to hear about it.) // A UUID generated using uuidgen(1). The following is just a placeholder of course. // You should generate your own UUID: const char nnnProductFileName[] = "12345678-1234-1234-1234-123456789ABCD", tmpPath[] = "/tmp/"; char nnnProductPath[PATH_MAX]; In the postflight script I reference the file using the same UUID as above: NNN_PRODUCT_CHOICE="/tmp/12345678-1234-1234-1234-123456789ABCD" As others have mentioned it shouldn't make any difference because / tmp is a symlink to /private/tmp. 2) Am I approaching this all wrong? What are other people doing? 3) why won't files install into /tmp from the package I'm using? Permissions on original files? Should it matter for /tmp? On my 10.4.9 system /private/tmp has drwxrwxrwt root:wheel permissions. That means anyone should be able to create a file there and write to it. I would expect this to be similar for other versions of Mac OS X. What errors are you seeing in your Installer Plugin when you are creating the file? Maybe it already exists (from an earlier test) and your opening mode doesn't allow for that? This email sent to site_archiver@lists.apple.com
participants (1)
-
Mike Fischer