Re: Fed up with PackageMaker, any advice?
Re: Fed up with PackageMaker, any advice?
- Subject: Re: Fed up with PackageMaker, any advice?
- From: Iceberg-Dev <email@hidden>
- Date: Sat, 10 Oct 2009 01:22:00 +0200
On Oct 9, 2009, at 12:45 AM, Sidney San Martín wrote:
I have been poking around inside installer packages for years. They
always looked simple and straightforward: *Check scripts run,
plugins run, pre* scripts run, files are copied and permissions are
set, then post* scripts run. Simple. So I thought it would be
painless to put together an installer package for a product of my
own. The process turning out to be surprisingly headachy. Can any
of you give some advice on taming this beast?
Here's what I want to do:
1. Run a plugin to collect some setup information from the user
(it's built)
2. Copy some files to a company-specific folder in Application Support
3. Copy a launchd.plist to /Library/LaunchDaemons
4. If running on >=10.5, copy a launchd.plist to /Library/LaunchAgents
5. Run a postflight script to do initialization (including
launching a helper executable to add a global login item if running
on <10.5)
I also want to be able to build the installer from an XCode project
(which will depend on its components' products) so I can build the
product in full, in debug or release config, with one click and
spit out an installer package (or, eventually, a disk image with a
package inside it).
Right now, I'm not at all close to that goal. I started out
thinking that a simple package with a root of / containing the
desired hierarchy was the most straightforward design, but saw a
stern warning against that in the docs. It looks like the only
option is a package containing subpackages (four of 'em) for each
component, with appropriate roots.
Apple does not follow this recommendation so just don't follow it if
you don't want to. Just don't overwrite permissions and you will be
fine.
Yet, considering 4., I would recommend using 2 packages. one for the
common components and another for the ones that need to be install
only when specific requirements are met.
I have no idea where to put my pre/postflight scripts, though.
Apparently they can only be set for the subpackages, and there's a
note in the docs stating "In Mac OS X v10.5 clients, the only
install operations available are preinstall and postinstall." What
the heck does that mean? What about preflight, postflight,
preupgrade, and postupgrade? If only preinstall and postinstall are
available, does that mean they'll be run every time? Either way, I
don't NEED any of those advanced options, just a postflight
guaranteed to run at the very end. PackageMaker itself seems to be
able to create pre and postflight scripts (Actions tab), but
there's no way to specify my own.
If the OS target is 10.5, postinstall and preinstall are the same as
postflight and preflight.
_______________________________________________
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