スクリプトから Mac パッケージ インストーラーをビルドしようとしていて、postinstall および postflight スクリプトを実行したいと考えています。パッケージをビルドするスクリプトは次のようになります。
pkgbuild --root MyRoot/MyApp.app --identifier com.myapp.MyApp --scripts Scripts --install-location /Applications/MyApp.app MyApp.pkg
productbuild --synthesize --package MyApp.pkg Distribution.xml
productbuild --distribution Distribution.xml --resources Resources --package-path . CompleteInstaller.pkg
postinstall スクリプトを Scripts に配置しましたが、正常に実行されています。ただし、postflight スクリプトの実行に問題があります。これは Resources ディレクトリに配置され、実行されません。これはパスを指定するのに十分ではありませんか? この質問に対する答えが見つかりませんでした。見逃していたらすみません。
PS: 私の postflight スクリプトは特別なことは何もしません。今のところ、ホーム ディレクトリにファイルを作成しようとします。
#!/bin/sh
touch ~/file
exit 0