如何将用户输入到PackageMaker包中? [英] How do I get user input into a PackageMaker package?

查看:192
本文介绍了如何将用户输入到PackageMaker包中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个安装包。我有我所有的组件,我认为我理解大部分的过程。我想要安装/设置脚本作为安装的一部分运行。我计划把它作为安装后的动作或安装后的脚本。

I'm trying to create an install package. I've got all my components, and I think I understand most of the process. I want to have an install/set-up script that is run as part of the install. I planned to put it either as a post-install action or a post-install script.

问题是我需要用户输入。我不知道如何将用户输入到脚本中,或者如何在安装UI中添加一个具有用户输入位置的页面,然后将其传递到脚本。

The problem is that I need user-input. I can't figure out how to either get user input into the script, or how to add a page in the install UI that has a place for user input and then pass that on to the script.

我猜,我可以用一个对话框来编写一个apple脚本来提出这个问题,然后将这些信息传递给我的shell脚本(或者把所有的东西写在应用程序中),但这似乎是不必要的复杂的...

I guess, I could write an apple-script with a dialog to ask the question, and then pass that information on to my shell script (or, write the whole thing in the applescript) but that seems unnecessarily complicated...

有正常的方法吗?

谢谢

推荐答案

您可以创建一个安装程序插件,该插件是可以包含您自己的用户界面和代码的Cocoa可加载软件包。当您将插件添加到安装程序包时,Installer应用程序将在安装过程中显示插件的UI作为附加步骤。

You can create an Installer Plug-in, which is a Cocoa loadable bundle that can contain your own user interface and code. When you add a plug-in to the Installer package, the Installer app will display your plug-in's UI as an additional step in the installation process.

Apple示例代码只有可用的文档是 here 。有关此处过程的详细说明。

The Apple sample code and only available documentation is here. There is a great explanation of the process here.

不幸的是,将插件包插入到安装包中变得不必要,因为PackageMaker 3.0及其扁平的包格式。

Unfortunately, inserting the plug-in bundle into your installer package has become needlessly difficult as of PackageMaker 3.0 and its flat package format.

创建插件包后,您首先需要正常构建安装程序包。一旦构建,您需要转到PackageMaker中的编辑菜单,然后打开平面包编辑器。打开您的安装程序包,并将插件插入相应的位置,就像在Finder中使用2.0安装程序包一样。也就是说,您需要创建一个插件文件夹,内部需要插入您的软件包以及 InstallerSections.plist 文件(上面的示例说明)。

Once you've created your plug-in bundle, you first need to build your installer package as normal. Once it's built, you need to go to the Edit menu in PackageMaker and open the Flat Package Editor. Open your installer bundle, and insert the plug-in in the appropriate location as you would in the Finder with a 2.0 installer bundle. That is, you need to create a Plugins folder and inside that you must insert your bundle plus the InstallerSections.plist file (which the sample above explains).

这篇关于如何将用户输入到PackageMaker包中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆