PackageMaker is the installing solution provided by Apple with its developer tools.
Contrary to other Installers' solution, PackageMaker does not create self-running installer (i.e. it does not build an application). Instead, PackageMaker is creating a Package:
Installer.app application will be launched and will guide your through the necessary steps of the installation.
The first question you must ask yourself is: "Do I need an installer to install my applications or documents?"
For instance, if you're distributing an application without any other files to install (Frameworks, StartupItems, Drivers, etc.),
you don't need to use an installer in 99.99% of cases. The 0.01% left is made of unusual cases like for instance if you want your application
to be installed in the Applications folder of the root home directory (but this is just an example). For the other 99.99%, just distribute
your application inside a Disk Image and inform the user in the Read Me file he/she just needs to move the file into the Applications folder to install it.
If you're distributing a solution that needs to put a Driver in /System/library/Extensions, an application in /Applications, a Framework in /Library/Frameworks, then you seriously need an installer.
Apple Remote Desktop (1.1 or later).Terminal (Mac OS X Server and recently Mac OS X client)The following list is not exhaustive, it's just including the 3 major commercial solutions.
Installer VISE has been one of the 2 legacy installing solutions on Mac OS. If you're a Shareware/Freeware developer, you may get qualified for a "free" license.
The(?) Cross-Platform Installation solution. Available on Mac OS X. If you like Java, it might be your cup of te... coffee.
The other legacy installing solution on Mac OS. I've never used it so I can't say a lot on it. If you're a Shareware/Freeware developer, you may get qualified for a "free" license.
| Name | Developer | Version | Price | Supports Uninstall | Ease of use | Scriptable |
|---|---|---|---|---|---|---|
| Install Anywhere | ZeroG Software | 5.0.7 | $1,995 | YES | ? | ? |
| Installer VISE | MindVision | 8.2.1 | Free to $1,500 a year | YES | ? | AppleScript |
| PackageMaker | Apple | 1.1a10 | Free | NO | 2/5 | Command line |
| StuffIt InstallerMaker | AladdinSys | 7.1.2 | Free to $1,000+ a year | YES | ? | ? |
PackageMaker is installed with the Developer Tools. So if you don't have installed the Developer Tools, you won't find it./Developer/Applications folder.
This may sound like a strange question but it's not that strange.
When Apple released Mac OS X 10.2 (Jaguar), a new PackageMaker application was released with the Jaguar Developer Tools.
This version of PackageMaker introduced new features but also a backward incompatibility.
The backward incompatibility is that Packages built with the Jaguar version of PackageMaker can't be installed on Mac OS X system prior to 10.2
(i.e. 10.0.x and 10.1.x). I don't know why the "official" documentation is stated the contrary.
So if you want to allow users to install your Package on Mac OS X 10.1 or prior, you will have to use the version of PackageMaker
provided with the Mac OS X 10.1 Developer Tools.
This document will mainly deal with the 10.2 version of PackageMaker.
PackageMaker needs to be installed on your machine (see Where I can find PackageMaker?)PackageMaker where the files of a Package should be installed, you need to create a relative file hierarchy describing where each file should be installed. For instance, if a Package needs to contain an application which has to be installed in the Applications folder, you need to create an Applications folder and put the application in this folder. If you need to install a driver in the Extensions folder, you need to create a System folder, then create a Library folder within the System folder, an Extensions folder within the Library folder and finally put your driver in the Extensions folder.
Disk Utility.app.| Owner | Group | Permissions | |
|---|---|---|---|
Applications | root | admin | rwxrwxr-x |
System | root | admin | rwxrwxr-x |
Library | root | admin | rwxrwxr-x |
Extensions | root | admin | rwxrwxr-x |
| Owner | Group | Permissions | |
|---|---|---|---|
MyApplication.app | root | admin | rwxrwxr-x |
MyDriver.kext | root | wheel | rwxr-xr-x |
.DS_Store file created by the Finder. While including this file in your package won't probably cause a security flaw on the system where the Package will be installed, this may lead to some unwanted behavior..DS_Store file within the Applications folder, this file will overwrite the .DS_Store
file in the Applications folder of the system where the Package is installed. Since the .DS_Store file contains information on the way
the Finder should display the content of a folder, when the user will display the content of the /Applications folder in the Finder, he/she may get a view with icons not located as they were before the Package was installed..DS_Store in the relative file hierarchy using the Terminal and a command like:
find $HOME/MyRoot/ -name ".DS_Store" -exec rm -f {} \;
PackageMaker to create the Package. To do this, you need to logout and login under the root
account (maybe it can be done directly from an admin account, but I haven't tested that yet).PackageMaker you're using, the User Interface might be different.
MyApplication
This title will be used during the Installation process for the Window title, the title of some steps, etc. If this Package is to be a part of a Meta-Package, this will also be the name displayed in the Custom section of the Meta-Package installer.
1.0
This piece of information is not used.
MyApplication is doing this and that.
Contrary to what the PackageMaker documentation states, this description is used. This will be the description displayed for the Package in the custom step of a Meta-Package installer.
N/A
This warning is not used currently since there is no Delete feature in the Apple's Installer solution.

/Users/MyAccount/MyRoot
This is the location of the Starting Point we built. It's usually a good idea to leave "Compress Archive" checked.

We will discuss this part later. Shortly, this is the location of the Welcome, Read Me, License, background image, and scripts files.

/
This is from where the Starting Point should be added. If we were just installing an application, we could have just put MyApplication.app inside the MyRoot folder and then selected /Applications as the Default location.
Required restart
This depends on whether you need a restart so that your application, drivers, daemons, etc. are properly launched or not. In this case, let's just say that the Driver can't be launched properly outside of the startup process.
Root Authorization
Since we're installing a Kernel Extensions and items inside /System, we need Root authorization.
We will discuss these flags later.
Create Package" in the "File" menu. Let's give it the following name: "MyPackage.pkg".PackageMaker, don't forget to save your Package settings via the "Save" command in the "File" menu.
This will avoid re-entering the same data later if the Package information is changed or updated with new versions of the files to install./Users/Shared folder and logout. Login under your account and go to the /Users/Shared folder.
This is the document that is displayed in the "Introduction" step (after the authentication step on Mac OS X 10.1 and 10.2 if any).
Tip: the real-estate for the Welcome document is limited to the size of the pane. It can't be scrolled.
This document is displayed after the Welcome document. It can be scrolled. The user can print the Read Me.
This document is displayed after the Read Me document. It can be scrolled and to go to the next step, the user will have to click on a button to confirm he agrees to the terms of the license. The user can print the License.
Welcome.rtf, Welcome.html, Welcome.rtfd, Welcome.txt.
ReadMe.rtf, ReadMe.html, ReadMe.rtfd, ReadMe.txt.
License.rtf, License.html, License.rtfd, License.txt.

PackageMaker, you can now set the location for the Resources folder and when you're building your Package, the documents will be added into the Package and they will be displayed when the Package is being installed.
This script is launched at the beginning of the installation process (even before the Authentication step). It can be used to check that the Package can be installed on this computer.
This script is launched in the "Select Destination" step. It is used to determine on which volume the Package can be installed.
This script is launched just after the user clicked on the "Install" button.
This script is launched after the preflight script if there's one (in the case of a single package installation);
otherwise just after the user clicked on the "Install" button.
As you see, there's 2 types of scripts here. The preinstall one is launched
when the Package has never been installed (from an Installer.app point of view), the preupgrade one is launched
when the Package has already been installed. To determine whether a Package has already been installed or not, Installer.app is having a look at the content of the following directory: /Library/Receipts. If there's a file named PackageName.pkg within it, then the Package has already been installed, otherwise it's the first install.
This script is launched after the files in the package have been installed. See (preinstall / preupgrade) to see which one is launched.
This script is launched after the postinstall / postupgrade script or when the package has been installed.
PackageMaker, the names of the scripts are a bit different.
| Language | Parameter | InstallationCheck | VolumeCheck | preflight | preinstall/upgrade | postinstall/upgrade | postflight |
|---|---|---|---|---|---|---|---|
| Shell | $0 | Script path | Script path | Script path | Script path | Script path | Script path |
$1 | Package path | Volume path [1] | Package path | Package path | Package path | Package path | |
$2 | Default location | Target location | Target location | Target location | Target location | ||
$3 | Target volume | Target volume | Target volume | Target volume | Target volume | ||
| Perl | $0 | Script path | Script path | Script path | Script path | Script path | Script path |
$ARGV[0] | Package path | Volume path [1] | Package path | Package path | Package path | Package path | |
$ARGV[1] | Default location | Target location | Target location | Target location | Target location | ||
$ARGV[2] | Target volume | Target volume | Target volume | Target volume | Target volume | ||
| Returned value |
0: Success |
0: Success |
0: Success |
0: Success
!=0:Failure |
0: Success
!=0:Failure |
0: Success
!=0:Failure |
|
| Authorization Action | InstallationCheck | VolumeCheck | preflight | preinstall/upgrade | postinstall/upgrade | postflight |
|---|---|---|---|---|---|---|
| No Authorization required | Login user | Login user | Login user | Login user | Login user | Login user |
| Admin Authorization | Login user | Login user | root | root | root | root |
| Root Authorization | Login user | Login user | root | root | root | root |
Resources folder. In our virtual example, we're adding a VolumeCheck script to prevent the user from installing the application on a system prior to Mac OS X 10.2 and we're adding a postFlight script to fix the file permissions of our Driver.
The installation allows to later install an earlier version of the package.
The installation install all the binaries for multiple platforms.
The user can choose the installation destination.
The package is a required component for the installation. This flag is only used when the package is a component of a metapackage.
This option will only allow the root volume (/) to be the target volume of the installation. This will prevent the user to select another volume in the "Select Destination" step.
This is an interesting option that will prevent the installation of localized Resources in case the localization was not already installed.
For instance, let's say the user has not installed the German localization of your application. Your updater is including updated German resources but not all the resources.
This means that if the user is installing the updater without this flag on, the German localization will only be partial and potentially crashy. With this flag on, the German files won't be installed and not cause any potential crash.
The permissions of directories in the installation overwrites the ones of the corresponding directories if they already exist in the destination volume.
InstallationCheck and VolumeCheck scripts. T
he others scripts are not supported.PackageMaker is easy as long as you know some information.
Description forthcoming
Description forthcoming
Description forthcoming
This warning is not used currently since there is no Delete feature in the Apple's Installer solution.

Same thing as for Packages. pre/postflight, pre/postinstall, pre/postupgrade scripts not supported.

To be completed.
Attribute:
PackageMaker 10.1, you must know that the Selected,
Required, Unselected option will not be taken into account. This has been fixed in the 10.2 version. So you can just specify whether a Package
is required or not. To do this, you have to check or not the Required flag when building the Package with PackageMaker 10.1.
Description forthcoming


This is absolutely possible. Since there are pre/postupgrade scripts, it means that updating/upgrading is possible.
Basically, an updater/upgrader is just an installer which just contains the files that have been modified or added.
Some suggestions to use a package as an updater/upgrader:
VolumeCheck script to determine if the updater/upgrader can be applied to a volume.
postupgrade script.
Note: There's a refresh bug in Installer.app which will display some volumes as potential candidates for the installation when they are not. Scrolling the list of volumes fix this.
Installer.app window can be customized by the Package.Resources folder called background.suffix
where 'suffix' may be:

PackageMaker, you can use this background picture too.
It won't be displayed when the installation is made on a Mac OS X version prior to 10.2, but it will for 10.2 and later.
Description forthcoming
Description forthcoming
Previous versions of Stuffit had issues with filenames bigger than 31 characters. If the name of the Package is a bit long and you have some scripts in it,
the name of one script might be bigger than 31 characters. So when it will get unarchived by Stuffit, the name will be screwed and the package won't install properly.
Yet, if all the names of the files in the Package are less than 31 characters, you can use Stuffit.
It's really a good idea to avoid changing the name of your package once it has been built. Because on Mac OS X 10.1, Installer.app is using the name of the package to find the file archive and scripts. If the name is not the original one, the installation is going to fail.
#!/bin/sh # Launch Preview.app open /Applications/Preview.app exit 0 |

Use package which is available in /usr/bin. To get information on the required parameters, type in Terminal.app:
thisistheprompt% package |
Use PackageMaker which is available in /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS. To get information on the required parameters, type in Terminal.app:
thisistheprompt% /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -help |
Installer.app:
Since during the installation process, you can have access to the list of files in the Package, one solution is to just launch the installation
of the Package.
Just before clicking on the Install/Upgrade button, select the command "Show Files" in the "File" menu.
A solution for the lovers of Terminal.app is to use the command line tool lsbom:
lsbom MyPackage.pkg/Contents/Archive.bom
This is the best solution. Pacifist is a $20 shareware which allows you to inspect Packages by displaying the hierarchy of files.
With Pacifist, you can even install only some files just by drag and dropping them.
Pacifist is available here: CharlesSoft.
Iceberg is an Integrated Packaging Environment. It's free and its source code is available.
Iceberg is available here: Iceberg.
| Author: Stéphane Sudre | Last revision: Draft (06/22/04) |