简体   繁体   English

如何为Mac OS的PackageMaker编写预安装脚本

[英]How to write preinstall script for packagemaker for Mac os

Hi I am using package-maker of Mac OS to create installer package for Mac OS. 嗨,我正在使用Mac OS的软件包制造商来创建Mac OS的安装程序软件包。 I gave created a simple installer package it worked fine. 我给创建了一个简单的安装程序包,它工作正常。 But I want to create a new folder under /Applications directory under which myApplication.app file will be installed. 但是我想在/ Applications目录下创建一个新文件夹,将在该文件夹下安装myApplication.app文件。 So I need to create a pre-install script which will create folder before my application is installed. 因此,我需要创建一个预安装脚本,该脚本将在安装应用程序之前创建文件夹。 then install the application in that directory. 然后将应用程序安装在该目录中。 But I do not know how to write pre-install script to create a folder under /Applications directory. 但是我不知道如何编写预安装脚本来在/ Applications目录下创建一个文件夹。 please help me. 请帮我。

I need all of your help to create pre-install script to create a folder under /Applications directory 我需要所有您的帮助来创建预安装脚本,以在/ Applications目录下创建一个文件夹

Thanks Sunil Kumar Sahoo 感谢Sunil Kumar Sahoo

To create a directory, you could have the following preflight or preinstall script: 要创建目录,您可以具有以下预检或预安装脚本:

#!/bin/sh
mkdir "/Applications/My Directory"

Put that into a file (named preflight or preinstall ) and then make it executable by typing in the terminal: chmod a+x preflight (or preinstall ). 将其放入文件(名为preflightpreinstall ),然后通过在终端中键入以下命令使其可执行: chmod a+x preflight (或preinstall )。

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

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