我想從腳本構建一個mac包安裝程序,我想運行postinstall和postflight腳本。我爲建設包裝腳本是這樣的:在Mac上安裝包時運行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
我放在腳本安裝後腳本,它被成功執行。儘管運行postflight腳本,但我遇到了問題。它被放置在Resources目錄下,不會被執行。這不足以指定它的路徑嗎?我找不到這個問題的答案,如果我錯過了,我很抱歉。
PS:我的飛行後的劇本確實沒有什麼特別的 - 現在它試圖創建的主目錄的文件:爲什麼你有一個包都postinstall
和postflight
#!/bin/sh
touch ~/file
exit 0
這怎麼可能與錯字「Scirpts」?? – dsjoerg