On Sep 4, 2007, at 10:24 AM, Nigel Kersten wrote: So currently I'm using the method of a preflight script that:
* retrieves the ruby sitelibdir parameter * removes /tmp/my-symlink * symlinks sitelibdir at /tmp/my-symlink * package destination is set to /tmp/my-symlink with follow symlinks on.
Is this really the best option for doing this?
This is a perfectly acceptable way to do it. ("Best" is such a contentious word.)
(ALSO: REMEMBER!!!! when the use clicks "Install", your installer is probably running as ROOT, so preflight and postflight need to be very security-conscious!!! SO DON'T ACCIDENTALLY SCRIBBLE ON THE KERNEL FILE, EH?)
It annoys me that I then don't get to observe the full paths with lsbom once the package is installed.
Your life will be MUCH MORE PLEASANT (and robust, hint hint) if you pretend that lsbom and package receipts DO NOT EXIST.
Here's three good reasons: 1) BOM files change format from time to time, and contain LOTS of stuff you don't want to care about.
2) Installation package receipts change format from time to time, and sometimes include destination paths that are supposed to be pre-pended onto the output of lsbom. Thus, lsbom does not always give you the whole story anyway.
3) It is not that much work to write your own preference file containing a list of files installed and a destination path.
Here's a sketch: a) during your installer build makfile, pipe ls $MYINSTALLATIONROOTDIRECTORY into FOO.PKG/Contents/Resources/MySpecialBomFile, then
b) during your installer's postflight, mv this into /Library/Preferences/com.myCompany.myGreatApp.BOM and prepend the custom location as line 1. (Or you can be all FANCY and use a plist file or something.)
|