Re: Installer plug-ins and /tmp issues
Re: Installer plug-ins and /tmp issues
- Subject: Re: Installer plug-ins and /tmp issues
- From: Mike Fischer <email@hidden>
- Date: Thu, 29 Mar 2007 22:10:16 +0200
Am 29.03.2007 um 21:04 schrieb Atticus O Gifford <email@hidden>:
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).
Have you checked if this might be a permissions problem?
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.)
Basically I'm using this code in my didExitPane: method:
// 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];
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)
In the postflight script I reference the file using the same UUID as
above:
NNN_PRODUCT_CHOICE="/tmp/12345678-1234-1234-1234-123456789ABCD"
1) Should I be using /private/tmp rather than /tmp? I'm not sure
which is the more appropriate location.
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?
See above.
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?
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden