Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
tutorial:program:install:zh [2023/10/23 08:22]
hfsr created
tutorial:program:install:zh [2023/10/23 09:31]
hfsr [Installing Additional Software]
Line 1: Line 1:
-Tutorial: The Install ​Program+教程:Install软件安装程序
 ============================================ ============================================
  
-`install` ​is an application that comes shipped with [[:​openos|OpenOS]]. For most users and in most computer configurations it is expected that the primary method of installing ​OpenOS ​is by using this very same `install` ​application. ​`install` ​is also designed to install the software, libraries, and help scripts that come bundled with all the craftable ​mod-provided ​[[item:​loot_disks|loot disks]].+`install`是一个随[[:openos:zh|OpenOS]]附送的软件。对于大多数用户以及大多数电脑而言,安装OpenOS的首选方法便是使用这个`install`应用。`install`的功能还包括安装软件、运行库以及本mod提供的所有[[item:​loot_disks:zh|奖励箱软盘]]的帮助脚本。
  
-To understand more about command line options for `install`, it is recommended to read its man pages by running ​`man install`, or by reading the man page online ​[[https://​raw.githubusercontent.com/​MightyPirates/​OpenComputers/​master-MC1.7.10/​src/​main/​resources/​assets/​opencomputers/​loot/​openos/​usr/​man/​install|here]].+要了解有关`install`的命令行选项的更多信息,我们推荐通过执行`man install`以阅读其man页面,也可以在[[https://​raw.githubusercontent.com/​MightyPirates/​OpenComputers/​master-MC1.7.10/​src/​main/​resources/​assets/​opencomputers/​loot/​openos/​usr/​man/​install|此处]]阅读在线版。
  
-`install` ​takes the following actions+`install`按以下步骤运行:
  
-Step One: Scan for Software to Install+第一步:扫描要安装的软件
  
-  ​First it scans for candidate source filesystems. These are filesystems,​ such as [[:​item:​loot disks|loot disks]],  that can be used as a software package for installation. If more than one candidate source filesystem is found, it prompts the user, asking+  ​首先它会扫描可供候选的安装来源文件系统,即可以被当作安装用软件包的文件系统,例如[[:​item:​loot disks:zh|奖励箱软盘]]。如果找到了多个候选安装来源,它将会提问用户:
  
   `What do you want to install?`   `What do you want to install?`
  
-  ​Followed by a list of disks it found that can be installed.+  ​下面跟着它找到的可供安装的软盘列表。
  
-Step Two: Scan for Hard Drives+第二步:扫描硬盘
  
-  ​The next step is a scan for candidate target filesystems. ​ These are filesystems,​ such as hard drives, that can be the target of an install. In the example of installing ​OpenOS ​from a loot disk to the hard drive, the hard drive is the target filesystem. Like candidate sources, if `install` ​finds multiple candidate targets, it asks the user to select one:+  ​下一步是扫描可供候选的安装目标文件系统,即可以作为安装的目标的文件系统,如硬盘。以从奖励箱软盘中向硬盘中安装OpenOS为例,此时的硬盘即为目标文件系统。就像候选安装来源一样,如果`install`找到了多个候选安装目标,它也会要求用户选择其中一个:
  
   `Where do you want to install to?`   `Where do you want to install to?`
  
-  ​Followed by a list of disks it found that can be installed ​**to**.+  ​下面跟着它找到的可以安装****的硬盘列表。
  
-Step Three: Installation+第三步:安装
  
-  ​Before continuing with the install, the user is asked for confirmation to install+  ​在继续安装之前,用户会被要求确认安装:
  
   `Install OpenOS to /mnt/e03/? [Y/n]`   `Install OpenOS to /mnt/e03/? [Y/n]`
  
-  ​Confirming this step will copy the files from the (e.g.) loot disk to the target filesystem. Software installs may have an optional ​`.prop` ​file which can tell `install` ​whether or not to set the default filesystem the computer should boot to, what label if any to set, and whether the system should reboot when installation is complete. +  ​在确认了此步骤后,程序会将奖励箱软盘(对于此样例)中的文件复制到目标文件系统中。要安装的软件中可能会有一个可选的`.prop`文件,此文件可以告知`install`是否要设定电脑的默认启动文件系统、将其设定为什么标签(若有)以及在安装完成后是否要重启系统。 
-  ​There is also the option for software disks to provide a fully custom install experience by creating an `.install` ​file at the root of the disk's filesystemAfter confirming the source and target, `install` ​will invoke ​`.install` ​if it exists in the source filesystem.+  ​软件安装软盘还可以提供完全自定义的安装过程,只需在软盘文件系统的根目录下创建一个`.install`文件。在确认安装来源与安装目标后,只要`.install`文件存在于安装来源文件系统,`install`程序就会唤起它。
  
-Optional Arguments+可选参数
  
-  ​It is recommend to review the `install` man page for greater details and a full list of supported arguments. But I considered it interesting to mention here that the label of the loot disk can be used as a command line argument for install ​-- which will refine the candidate search to disks matching that label.+  ​推荐你查看`install`man页面以获取更详细的细节以及支持参数的完整列表。但是我考虑到有一点最好在这里提一下,奖励箱软盘的标签可以被用于`install`的参数——这样可以让搜索候选软盘时仅搜索标签一致的软盘。
  
   `install openos`   `install openos`
  
-  ​Note that the argument is case insensitive. In a scenario where there would have been multiple software disks available to install, specifying the label in this manner may allow `install` ​to reduce the candidate selection without prompting the user.+  ​请注意,参数忽略大小写。在同时有多个软件安装软盘可用于安装时,以此方式指定标签可能会使得`install`在不询问用户的情况下减少候选项。
  
-Installing Additional Software+安装额外软件
 ------------ ------------
  
-Besides installing loot disks (such as openos), It is intended that users can take advantage of the `install` ​program for custom software disks. If you are providing software distributed on a portable filesystem, you can expect ​`install` ​to be a useful utility. For this documentation we'll assume you are distributing your software via floppy disk, though ​`install` ​does not distinguish between any filesystem component, floppy or hard disk or other.+在安装奖励箱软盘的软件(例如OpenOS)之外,用户还可以将`install`程序用于自制的软件安装软盘。如果你打算以可移动文件系统的形式提供软件,那么可以将`install`作为你的实用工具。在此文档中我们假设你以软盘的形式分发你的软件,尽管`install`不会区分文件系统组件的类型,不论是软盘、硬盘还是其他类型。
  
-The most basic and default way to use `install` ​with your software disk is to do nothing, and it'll just sort of work. `install` ​checks all available filesystems that have any files and considers them candidates for installation. The user is prompted to select what to install, and `install` ​does a very simple copy of all files in that disk to the selected destination. This is actually how OpenOS ​itself installs.+要将你的软件安装软盘与`install`配合使用,最基础也是默认的方式其实是什么也不做,安装过程会凑合着进行。`install`会检查所有装有文件的文件系统,将它们全部作为安装来源的候选项。程序会要求用户选择一个以进行安装,之后`install`程序会简单地将所选软盘中的所有文件复制到所选的安装位置。这也就是OpenOS自身的安装过程。
  
-You have some control over how install behaves by creating a custom .prop and/or a custom .install ​file at the root of your software distribution disk. The .prop file is expected to be a valid lua table that set optional flags for `install`. For example, the openos .prop file contents are: `{label = "​OpenOS",​ reboot=true,​ setlabel=true,​ setboot=true}`+你可以通过在你的软件发行软盘的根目录创建`custom.prop`和/或`custom.install`文件来控制`install`程序的行为。`.prop`文件应当为有效的Lua表,设定了可用于`install`的可选标记 。例如`openos .prop`文件的内容为:`{label = "​OpenOS",​ reboot=true,​ setlabel=true,​ setboot=true}`
  
-Note that `install`'s default copy action skips .prop (.prop is not copied).+请注意`install`的默认赋值操作将会跳过`.prop`文件(不复制`.prop`)。
  
-You can set a custom label+你可以设置自定义标签
  
 `install` can refer to and label installation options. By default, `install` uses the filesystem label (or the filesystem address if no label is set). This label can be helpful for `install` and the user experience. The user can actually tell `install` what to install from a command line argument before even being prompted about install options. For example, if you type `install openos`, and in the chance there were other installation options -- `install` will only give the openos option for install. It is a way for a user to specifically get what they want before being asked. In addition to this, `install` uses the same labelling logic when listing the install options. `install` can refer to and label installation options. By default, `install` uses the filesystem label (or the filesystem address if no label is set). This label can be helpful for `install` and the user experience. The user can actually tell `install` what to install from a command line argument before even being prompted about install options. For example, if you type `install openos`, and in the chance there were other installation options -- `install` will only give the openos option for install. It is a way for a user to specifically get what they want before being asked. In addition to this, `install` uses the same labelling logic when listing the install options.
Line 90: Line 90:
 The user could have also optionally used some command line args, such as: `install foo --noreboot --nosetlabel`. In which case I would see those values passed to my installer script. The user could have also optionally used some command line args, such as: `install foo --noreboot --nosetlabel`. In which case I would see those values passed to my installer script.
  
-Contents+目录
 ------------ ------------
-{{page>​tutorial:​contents&​noheader&​noeditbutton&​nouser&​nofooter}}+{{page>​tutorial:​contents:zh&​noheader&​noeditbutton&​nouser&​nofooter}}