PackageMaker 3.0

packagemakerIcon.png

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) …

pm1.png

Add the two releases for my project build folder:

pm2.pngpm3.png

Enter the name and description in each Choice:

pm4.png

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:

pm5.png

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.

pm6.png

So when you now build the package you get this warnings:

  1. 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:

  1. #!/bin/sh
  2.  
  3. MAJOR=`sw_vers -productVersion | awk -F "." ‘{ print $2 }’`
  4. if [ "${MAJOR}" = "3" ];
  5. then
  6.     exit 0
  7. else
  8.     exit 64
  9. 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:

  1. #!/bin/sh
  2. PACKAGEMAKER="/Developer/usr/bin/packagemaker"
  3.  
  4. $PACKAGEMAKER –doc PackageMaker/OMiC.pmdoc –out ./build/OMiC.mpkg
  5.  
  6. echo "Patch OMiC.mpkg with InstallationCheck"
  7. cp PackageMaker/10.3/Resources/InstallationCheck build/OMiC.mpkg/Contents/Packages/omic.pkg/Contents/Resources
  8. 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.

2
 
del.icio.us digg

Christopher,

Thanks for the overview of the new PackageMaker. Very helpful.

One question for you … Does the new version of PackageMaker automatically reference the InstallationCheck script? Or do I need to specify that, similar to the preinstall?

Jamie

ys Ja
   
Says Jamie on

Jamie,

PackageMaker don’t allow you to set the InstallationCheck script, similar to the preinstall. Because of this you need to copy the script by hand (or by script like I) in the *.pkg/Contents/Resources folders.

If you set a preinstall script in PackageMaker, it also just copy the script in the *.pkg/Contents/Resources folders. The Installer then look up which scripts are in the folder, and run them…

Christopher

   
Says Christopher Atlan on

Leave a Reply