PackageMaker 3.0
Yesterday I switched to PackageMaker 3.0 to generate packages. My Plug-in OMiC is build separate for Mac OS X 10.3 and 10.4 to support the different features.
So the simplest solution maybe offer two downloads and give user the choice which version he needs. But thanks to Metapackages and Distribution Packages the installer choice which version is needed.
So let us start PackageMaker (/Developer/Applications/Utilities/PackageMaker) …
Add the two releases for my project build folder:

Enter the name and description in each Choice:

Now the interesting part, the Requirements for each Choice. Add the two the requirements “is greater than or equal to ‘10.3′” and “is less than ‘10.4′” for the Panther Choice and just “is greater than or equal to ‘10.4′” for Tiger:

In Package Configuration is one important thing, the Package Identifier. The two packages must have a different identifier, I first try it with the same and PackageMaker gave me no error. But when you save and reopen it with the same identifier, PackageMaker is confused because it can’t make the relation between choices and packages.

So when you now build the package you get this warnings:
-
Warning: Requirement "System OS Version (e.g. 10.x.x)" of choice "OMiC for Mac OS X v10.3 (Panther)" is not supported prior to Mac OS X v10.4.
To support Panther we need some tricks, we need a InstallationCheck script. Here as example my script:
-
#!/bin/sh
-
-
MAJOR=`sw_vers -productVersion | awk -F "." ‘{ print $2 }’`
-
if [ "${MAJOR}" = "3" ];
-
then
-
exit 0
-
else
-
exit 64
-
fi
You need to copy the InstallationCheck scripts into the Resources folder of each package. Copy this by hand is very error-prone, so I use a script for building and copying:
-
#!/bin/sh
-
PACKAGEMAKER="/Developer/usr/bin/packagemaker"
-
-
$PACKAGEMAKER –doc PackageMaker/OMiC.pmdoc –out ./build/OMiC.mpkg
-
-
echo "Patch OMiC.mpkg with InstallationCheck"
-
cp PackageMaker/10.3/Resources/InstallationCheck build/OMiC.mpkg/Contents/Packages/omic.pkg/Contents/Resources
-
cp PackageMaker/10.4/Resources/InstallationCheck build/OMiC.mpkg/Contents/Packages/omic-1.pkg/Contents/Resources
That’s it, overall I like the improvements of new PackageMaker.

