[Pythonmac-SIG] buildpkg.py

Dan Grassi Dan@Grassi.org
Thu, 12 Sep 2002 09:07:13 -0400


On Thursday, September 12, 2002, at 02:51  AM, Dinu Gherman wrote:

> Yep, like building multi-packages (.mpkg)... Feel free to send
> patches including pointers to where some "undocumented" feature is
> mentioned.

The "InstallationCheck" is mentioned in some 10.0.x Apple docs and I 
now have 10.2 installed so that will not be easy.  It was not easy to 
find back a year ago.  It is a good place to pre-flight, I use it to 
verify minimum requirements such as available disk space, RAM and OS 
version allowing an early exit if minimums are not met.

Also:
preflight Is a combo of <pkg>.pre_install and <pkg>.pre_upgrade
postflight Is a combo of <pkg>.post_install and  <pkg>.post_upgrade
postinstall
preinstall

The first three are used in the 10.2 Info.plist in DevTools.pkg and I 
suspect that the last is also still supported, these are in various 
Apple  pre 10.2 docs.  These are handy because they work for both 
install and upgrade.

The "rootVolumeOnly" is not documented in 10.0.x of 10.1.x but is used 
by Apple in their pre-10.2 developer tools installers.  In the 10.2 
installer it is mentioned but that installer uses XML 
(IFPkgFlagRootVolumeOnly) and it currently does work in the 10.2 
format, see 10.2 Info.plist in DevTools.pkg.  "rootVolumeOnly" does 
work on 10.2 in the pre-10.2 format.  I am using it in  a new 
commercial product at the moment.  At the very least it does no harm 
and is ignored.  In my case I am installing a driver and that needs to 
go on the root volume.

I came up with both of these over a year ago when I was doing the IBM 
ViaVoice installer.  At that time there was little documentation and I 
was looking at all of Apple's .pkg and .mpkg files to figure things out.

> BTW, it is perfectly possible to use Python for the pre/post instal-
> lation/upgrade scripts run by Installer.app. They just must not have
> a .py extension! Apple seems to use Perl scripts sometimes, like in
> iCal.pkg/Contents/Resources/InstallationCheck .

But that pre-supposes that Python is already installed, something that 
is only guaranteed on 10.2 and forward and the installer package you 
wrote generates pre-10.2 format. :-)

Dan.