Re: Where do I start?
Re: Where do I start?
- Subject: Re: Where do I start?
- From: Bill Coderre <email@hidden>
- Date: Fri, 05 Mar 2010 10:48:46 -0800
On Mar 5, 2010, at 9:51 AM, Allan Marcus wrote:
> I would like to start to add some JavaScript as a requirements test to my installer. I cannot find any documentation on how to do this. I can find Installer JavaScript References on the Mac Dev web site, but nothing on how to do it.
>
> Where do I put my scripts?
> Are there examples?
> is there any documentation at all?
Did you see http://developer.apple.com/mac/library/navigation/index.html#section=Topics&topic=Distribution Tools ?
Most people seem to use PackageMaker, at least to get "the lay of the land." Another popular choice is to take apart existing packages and see what they do.
However, let me also give you a thumbnail sketch. Note that this is NOT complete or fully detailed. It's just to help you get your bearings.
(Also, with almost every major OS release, there are changes and improvements to package format, but older package formats are still supported and install almost "the same" in later OS revisions. I'll outline the 10.4-era flavor of packages, because 10.4-era packages are a LOT "better" and also much different than previous versions, and chances are you don't have to support 10.3.)
10.4-era installer packages are folders with a .pkg extension, a particular flavor of what Mac OS X calls "bundles."
The bundle has a layout that looks like this:
Foo.pkg
Contents
Archive.bom
Archive.pax.gz
Foo.dist
Info.plist
Resources
preflight
postflight
English.lproj
(other language lprojs)
The distribution is documented here: http://developer.apple.com/mac/library/documentation/DeveloperTools/Reference/DistributionDefinitionRef/000-Introduction/Introduction.html
preflight and postflight are unix executables (I use perl scripts, but you can use sh if you are a glutton for punishment). They need to have the exact name, NO hidden EXTENSIONS, and they have to have the unix executable bit set and the correct ownership and permissions.
Installation has a set of steps it goes through:
1) The distribution of the package is run, to see if the installation will be allowed.
2) User clicks install.
3) preflight runs
4) Archives are unpacked and copied into their destinations
5) postflight runs.
A very brief note on "metapackages": It is often a good idea to make an installer from several small packages, bunched together in what is called a "Metapackage." For instance, if you want to install an extension only on certain hardware, it's convenient to put that stuff in its own package. Then you have a "head" package containing a distribution and associated user-visible text, and the distribution of this metapackage determines which subpackages get installed.
You then put all the packages inside the metapackage, and give the metapackage the extension ".mpkg"
The installer runs ONLY the distribution of the head package. The distributions of the subpackages are ignored. However, each subpackage still runs its preflight and postflight scripts.
_______________________________________________
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