简体   繁体   English

打包程序运行shell脚本

[英]packagemaker run shell script

I'm using PackageMaker to install an app update and want to add a preinstall script to delete some files in the /Applications/ folder. 我正在使用PackageMaker安装应用程序更新,并希望添加预安装脚本以删除/Applications/文件夹中的某些文件。 The script is simply: 该脚本很简单:

#!/bin/bash
rm /Applications/...

etc. 等等

If I run this script with Terminal using 如果我使用终端运行此脚本

bash preinstall.sh

it works fine. 它工作正常。

However, when I add it to PackageMaker and run the .mpkg file the script opens in Text Edit but does not run. 但是,当我将其添加到PackageMaker并运行.mpkg文件时,该脚本会在“文本编辑”中打开,但不会运行。 How do I get it to run but not open? 如何使其运行但无法打开?

I think you are adding scripts in a wrong way. 我认为您以错误的方式添加了脚本。 You can go through this link which has detailed explanation about scripting in Packagemaker and a sample script as well. 您可以通过链接获得有关Packagemaker中的脚本的详细说明以及示例脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM