gpt4 book ai didi

macos - 使用 PackageMaker 在安装时运行脚本

转载 作者:行者123 更新时间:2023-12-03 14:41:58 25 4
gpt4 key购买 nike

我有一个应用程序,我需要为其创建安装程序,并且安装程序需要做的所有事情(除了复制应用程序)都是运行一个不属于应用程序本身的脚本(或可执行文件)。关于我如何做到这一点的任何帮助?我在 中看到需求选项卡上有一个 脚本结果行动,还有预安装操作 行动 带有 的选项卡打开文件 行动。这些中的任何一个都可以完成工作还是我应该寻找其他地方?

最佳答案

Here是一个很好的方法

There are 7 types of scripts than can be launched during the Installation Process:

InstallationCheck: This script is launched at the beginning of the installation process (even before the Authentication step). It can be used to check that the Package can be installed on this computer.

VolumeCheck: This script is launched in the "Select Destination" step. It is used to determine on which volume the Package can be installed.

preflight: This script is launched just after the user clicked on the "Install" button.

preinstall / preupgrade: This script is launched after the preflight script if there's one (in the case of a single package installation); otherwise just after the user clicked on the "Install" button.

As you see, there's 2 types of scripts here. The preinstall one is launched when the Package has never been installed (from an Installer.app point of view), the preupgrade one is launched when the Package has already been installed. To determine whether a Package has already been installed or not, Installer.app is having a look at the content of the following directory: /Library/Receipts. If there's a file named PackageName.pkg within it, then the Package has already been installed, otherwise it's the first install.

postinstall / postupgrade: This script is launched after the files in the package have been installed. See (preinstall / preupgrade) to see which one is launched.

postflight: This script is launched after the postinstall / postupgrade script or when the package has been installed.

关于macos - 使用 PackageMaker 在安装时运行脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/640701/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com