0

How can I include files needed by preinstall/postinstall scripts when creating .pkg in mac osx?

I have performed this command in the terminal and have generated .pkg; however, nothing happens when I double click the generated .pkg file.

pkgbuild --root ./files --scripts ./scripts --identifier com.example.myapp --version 1 --install-location /Applications mypackage.pkg

where: /files (contains necessary files for preinstall/postinstall scripts) and /scripts (contains preinstall/postinstall scripts)

newbieMACuser
  • 847
  • 1
  • 11
  • 19

1 Answers1

0

Add the files to a folder in the build, which gets copied to the user's machine. If you don't want to leave the files after installation, your post install script can delete them.

I currently use the following command: -

pkgbuild --identifier com.company.product --version 0.1 --scripts scripts/ --root ProductNameInstall/ "mypackage.pkg"

The source files to be copied reside in the folder ProductNameInstall.

TheDarkKnight
  • 27,181
  • 6
  • 55
  • 85