Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac installer package - how to optionally install to multiple locations

I am trying to create a Mac installer package with pkgbuild and productbuild that installs 1 package to 4 locations optionally, depending on the result of the installer options laid out in the distribution definition xml file.

Unfortunately, I cannot find a way of customising the Distribution.xml to install a package more than once.

The only alternative I can see is bundling 4 identical packages, but with separate install locations; however this is undesirable as it would make my installer unnecessarily large.

Is there another way of achieving this custom behaviour?

like image 350
elSnape Avatar asked May 17 '13 09:05

elSnape


1 Answers

Instead of --component "/Applications/SomeApp.app"

use --root ./basefolder and have root-like structure (example: 'Applications','Library' folders)

 /usr/bin/pkgbuild --scripts ./scripts --info PackageInfo --identifier com.app.installer --root ./basefolder "Installer.pkg"

http://s.sudre.free.fr/Stuff/Ivanhoe/FLAT.html is helpful in creating PackageInfo file

like image 68
Dmytro Avatar answered Nov 15 '22 09:11

Dmytro