1

I am attempting to create an Mac OS X installer (tried both PackageMaker and Packages) which does two things on install:

  1. Check if a certain application is installed (by looking through the folder structure in the Applications directory) and set the component selections accordingly.
  2. Setting the destination folder of the package according to the folder found in 1. This is for a plugin that needs to go into a subdirectory of the application folder.

The former seems like it's relatively simple, I can just add a script as requirement for the choice associated with each package and let the result drive the state of the component checkbox.

The latter feels tricky. I already know how to figure out the location of the application from the first step, but I have no idea whatsoever of how to change the destination folder that's set in the package. Can I somehow access installer variables from a preflight script?

The only idea I currently have is installing to a temp directory and then moving stuff in a post flight script, but that seems really error prone and awkward. Also this would rule out the possibility to make the installation paths editable (in case the user has several instances of the software we're plugging into installed and we picked the wrong one).

4

0 回答 0