6

I need to make Mac OS app installer, which also installs other third-party package.

When trying to add it via productbuild --synthesize, it tells "ThirdPartyPackage.pkg is a product archive, not a component package".

So, how should I correctly insert third-party product installer into my installer?

Nickolay Olshevsky
  • 13,706
  • 1
  • 34
  • 48
  • Were you able to include product package to your own installer? – voytek Sep 14 '15 at 10:29
  • 2
    It is not possible since final product packages cannot be included to other product packages. So I ended up with two solutions 1) unpack installer package and install lower-level packages in my installer 2) run the whole installer silently from the my application. – Nickolay Olshevsky Sep 17 '15 at 13:49

2 Answers2

2

You can actually split up a "product archive" into its component packages by using:

pkgutil --expand your_product_archive.pkg some_folder

This will create the some_folder directory with the contents of the product archive.

ereOn
  • 53,676
  • 39
  • 161
  • 238
  • Yeah, but actually the issue was that product package cannot be included to other product package. See my comment on question. – Nickolay Olshevsky Sep 17 '15 at 13:51
  • Pretty sure the meaning of this answer is that once the product archive is split into component packages, you can then add those packages together using `productbuild`. Of course the expansion may show complexities with the distribution and script which you will have to take into account in your installer. – user2793784 Jul 30 '22 at 15:55
0

If the third-party archive is reliably available for download, then you could have a post (or pre) install script use curl to fetch it (probably into /tmp) and installer to install it.

Error handling with curl is a little janky, since it tends to report no error for lots of errors: 404 not found, domain not resolved, etc. You could just assume it worked, and count on installer to error out if there's not an actual package where you tried to download it.