1

Already tried many ways: pkgbuild, productbuild, PackageMaker, Packages application...

The structure of the flat package that I want to build:

Distribution - xml script
MacBookPro2011EFIUpdate.pkg - flat package
Resources - resources folder, contains language localizations

Flat package information:

id="com.apple.pkg.MacBookPro2011EFIUpdate" version="2.7.0.0.1.1330468277"

For example, my failure with productbuild:

productbuild: error: Cannot copy package "MacBookPro2011EFIUpdate.pkg" into product.
(Bundle-style package "MacBookPro2011EFIUpdate.pkg" is not supported.)


Please, try to build the installer package from these files: Link
And, if you succeed, please tell how you did that!

Jake Badlands
  • 1,016
  • 3
  • 23
  • 46

1 Answers1

11

The correct command to use is indeed productbuild, but it does only work on Flat packages, as the error indicates. And your MacBookPro2011EFIUpdate.pkg is a Bundle-style package: easy to tell the difference in that Bundle-style packages are a directory, where as Flat packages are a xar archive.

To get what you want, first convert the Bundle-style package into a Flat package:
pkgutil --flatten MacBookPro2011EFIUpdate.pkg FlatMacBookPro2011EFIUpdate.pkg

Then generate a new distribution file that uses this new Flat package:
productbuild --package FlatMacBookPro2011EFIUpdate.pkg --synthesize newdist.dist

Copy your scripts and resource entries from your Distribution file into newdist.dist. Then build your final package:
productbuild --resources Resources/ --distribution newdist.dist MyCoolPackage.pkg

Mason Kidd
  • 111
  • 3
  • Hi, I have a mac app file and also created its package file using "productbuild" namely hello.app and hello.pkg. Now I wish to add a license agreement to that package. for this, I have created distribution.xml from my hello.app file now I wish to include this in package but get error as not allowed. – Swati Aug 25 '17 at 09:58
  • 1
    productbuild --synthesize --product "hello.app/Contents/Info.plist" --package hello.app distribution.xml – Swati Aug 25 '17 at 09:58
  • My Example Application … … – Swati Aug 25 '17 at 09:59
  • productbuild --distribution distribution.xml hello.pkg – Swati Aug 25 '17 at 10:00