How can i convert my Installer build from packagesbuild to productbuild?

1.7k Views Asked by At

I have built an Installer for mac os using packages. Now I want to upload it to app store. But apple complains saying the installer should be built either with Xcode or productbuild. I guess I won't be able to use Xcode since my codebase for the app is in python.

I have installer plugins (registration and 1 more plugin) as well which are developed in objective c. I also have pre and post install scripts to run after each component is copied to the user's machine.

Is there any way i can port the installer building from mac packages's packagesbuild to productbuild?

I came across this documentation for product build: https://www.unix.com/man-page/osx/1/productbuild/ but it does not talk about post install scripts for each component.

1

There are 1 best solutions below

0
On

Using pkgbuild, it's still possible to include preinstall and postinstall scripts for each of the component packages.

You can then use productbuild to build the installer out of the component packages. There are some options for including scripts in the product installer, though it doesn't use the same preinstall/postinstall setup. Instead, you'll need to use the product distribution file to include and call scripts.

I found this link to be extremely helpful in getting a handle on the whole process: https://matthew-brett.github.io/docosx/flat_packages.html