macos:Installation

出自UXGuide.net

跳转到:导航, 搜索

请帮助我们修订和更新本文的中文部分

本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划

安装
Installation

目录


You should ensure that installing your software is a quick and painless experience. This section provides guidelines on how to handle the installation of your software. For more information on how to implement different installation mechanisms, see Software Delivery Guide.

您应该确保您的软件安装过程是快速的和平滑的。本小节将介绍怎样处理软件的安装。关于怎样实现不同的安装机制的更多信息,请参考软件发布指南。

Whichever installation method you choose, be sure to avoid creating application-specific subfolders in the user’s Downloads folder (which is accessible as a stack in the Dock). If you do so you degrade the utility of the Downloads stack, because clicking the stack in the Dock will no longer accurately represent the contents of the Downloads folder.

无论您选择了哪个安装方式,不要在用户的下载目录(可以通过Dock上的堆栈访问)下创建程序相关的子文件夹。如果您这样做了的话会降低下载堆栈的功效,因为点击Dock上堆栈将不再能准确的显示下载文件夹的内容。

使用互联网的安装镜像
Use Internet-Enabled Disk Images

If you provide users with a downloadable version of your application on the Internet, you can simplify the installation process by packaging your software in an Internet-enabled disk image. Disk images eliminate the need to compress your files, because the disk image itself can compress the enclosed data. After the disk image is downloaded, Mac OS X automatically opens it and mounts it on the user’s desktop. All the user has to do is copy over the desired files or run the installer.

如果您在互联网上向用户提供了可下载的程序版本,您可以通过将程序打包成一个镜像来简化安装过程。安装镜像无须您来进行文件压缩,因为其本身就能压缩包含的数据。当安装镜像下载完成后,Mac OS X会自动的打开并将它挂载到用户的桌面上。用户需要做的就是拷贝相应的文件或者运行安装包。

For information on how to create an Internet-enabled disk image, see Software Delivery Guide.

关于怎样创建一个安装镜像的更多信息,请参考软件发布指南

拖拽式安装
Drag-and-Drop Installation

Bundles make it possible to provide drag-and-drop installation for applications (for more information on application bundles, see Bundle Programming Guide). Using bundles is the preferred way to install an application for the following reasons:

程序包使得支持拖拽式安装成为可能(关于程序包的更多信息,请参考程序包编程指南)。使用程序包是安装软件的首选方式,有如下原因:

对于用户来说易于安装和卸载。
安装的时间大大减少(仅需要拷贝的时间)。
无须花时间开发安装包。

Providing drag-and-drop installation does not preclude you from placing files in specific places on the system. When your application is first run, it can copy any needed support files to appropriate places on the system. However, you should avoid using this technique to install additional executable code and should instead use it to install preference files, document templates, or other resources that can be regenerated as needed and are not required for the application to run.

拖拽式安装并不意味着您不能将文件安装到别的地方。当程序第一次运行时,程序可以将所需要的支持文件拷贝到合适的位置。然而,您应该避免使用这项技术来安装额外的执行文件,而是仅用来安装配置文件,文档模版以及一些可以按需生成的资源文件,这些文件都不是程序运行所必须得。

Note: If you install additional files when your application is first run, be sure to install them in obvious places, such as in the Application Support directory. Place your resources in a directory named for your application to make it easy for the user to find these files if they ever need to uninstall your application.

注意:如果您在程序第一次运行时安装了一些额外的文件,确保它们安装在一些明显的位置,例如Application Support目录。将资源文件放在一个以您的程序名命名的目录内,从而使得用户需要卸载您的程序时,可以很方便的删除它们。

安装包
Installation Packages

You should support drag-and-drop installation if your application bundle contains everything needed for the application to run. However, you might need to create an installation package if any of the following conditions is true:

如果您的程序包已经包含了程序运行所需要的一切资源,那么您应该支持拖拽式安装。然而,在下列情况下您可能仍然需要一个安装包:

您需要将框架或者其他的文件安装在特定的位置。
您需要将软件安装在需要管理权限才能访问的位置。

If you are developing software other than an application, the need for an installation package depends on the type of software and where it is installed. For example, you might want to use an installer to install a screen saver, because it involves placing files in either the user’s Library directory or the local Library directory.

如果您在开发的是软件而不是一个应用程序,则是否需要安装包取决于软件的类型和它需要安装的地方。例如,一个屏幕保护软件可能需要一个安装包,因为它涉及到将文件安装在用户的Library目录下还是根卷的Library目录下。

You can create an installation package with Package Maker, which is available with the Xcode Tools. For information on installers and packaging, see Software Delivery Guide.

您可以使用随着Xcode工具提供Package Maker来创建安装包。关于安装和打包的更多信息,请参考软件发布指南

通用安装准则
General Installer Guidelines

When designing your product’s installation package, keep the following guidelines in mind:

当设计您的产品的安装包时,请谨记如下准则:

在安装之前,安装包应该检查目标卷是否已经安装了程序组件。
总是提供给用户一个简单默认的安装方式(“轻松安装”)。大部分产品应该同时提供一个定制的安装方式。例如,如果用户偶然误删除了一个文件,用户应该能够恢复这个文件而不用安装整个应用程序(您的程序也可以再每次运行时检查需要的文件并在在它们缺失时自动安装这些文件)。
提供安装选项并解释这些选项的影响。例如,某个安装选项可能会提高程序的性能,但是会占用更多的程序控件。另外一个选项占用更少的空间但是会导致性能的降低。确保用户能够清楚地了解这些选项的意义。
总是允许用户选择特定的安装目录。不要要求程序必须装在指定的位置。
在推荐的位置安装特定的文件。(关于系统目录列表以及它们推荐的安装内容,请参考文件系统概述。)如果用户需要删除您的程序,它们只需要简单的将程序图标拖到回收站中。避免残余文件充斥着用户的硬盘。如果您的产品提供了安装包,那么应该也提供一个卸载方式从而让用户能够删除所有相关的文件。
通知用户数据可能会在安装过程中被覆盖,并且提供备份的方式。不要覆盖以前的用户配置,而是在在用户第一次运行程序时处理版本和格式的异同问题。
在合适的时候提供帮助。例如,在一个定制的安装面板上,点击更多信息按钮应该能够解释为什么用户可能想安装这个组件以及不安装的结果。
不要卸载/System中任何Apple系统软件。
如果用户可能已经安装了您的软件产品,确保您现在提供的版本比已安装的更新。让用户很清楚地知道他们已经安装了哪些版本,以及您的程序需要什么版本,并且提供一个选项能够跳过这些软件的安装。
提供安装的进度,例如现在的状态和剩下的时间。相关信息请参考 “反馈和交互” 。
提供取消按钮让用户可以取消安装。在取消安装可能会导致系统的稳定性的时候将取消按钮变灰。如果用户取消了安装,保证目标磁盘和安装前一样(换句话说,在进程结束前删除任何已安装的文件)。
在用户第一次启动您的程序时考虑安装一些支持文件,以免用户误删了一些文件而需要重新安装。
考虑一下您的程序的使用者。例如,孩子通常将游戏安装在他们的用户目录中,所以调整您的安装说明(不要使用令人混淆的技术术语)并且使得安装尽可能的简单。
导航
工具箱