I've created a SampleApp.app file from XCode 7.1 and converted it to pkg file and signed it using the product build command and it worked fine. But now the problem is, when I install the pkg the app does not start automatically after installation. Do I need to include any other arguments in my command to make this work? Below is the command that I use to create and sign the pkg.
productbuild --component SampleApp.app /Applications SampleApp.pkg
productsign --sign "Developer ID Installer: xxxxx" SampleApp.pkg SampleApp_signed.pkg
EDIT
I've also tried to add a postinstall script but that didnt seem to work, I'm not sure if its the problem with my script or command
pkgbuild --root SampleApp.app --identifier com.companyname.SampleApp --scripts startup.sh --install-location /Applications/SampleApp.app SampleApp.pkg
productsign --sign "Developer ID Installer: xxxxx" SampleApp.pkg SampleApp_signed.pkg
My startup.sh file
#!/bin/bash
open -a /Applications/SampleApp.app
exit 0
Usually you would create a
postinstall
script, and include it with the--scripts
option.--scripts scripts-path
So a (very) basic example of
postinstall
could launch an app by: