# 13.3.在 FreeBSD 上安装 WINE

## 13.3.1. WINE 安装前提条件

在安装 WINE 之前，建议先安装以下前提条件：

* **GUI**\
  大多数 Windows® 程序都期望能使用图形用户界面。如果没有图形界面安装 WINE，其依赖项将包括 Wayland 合成器，并且会与 WINE 一起安装 GUI。但在安装 WINE 之前，最好先安装、配置并确保所选 GUI 能正常工作。
* **wine-gecko**\
  Windows® 操作系统默认预装了一个网页浏览器——Internet Explorer。因此，某些应用程序会假设始终存在一个能够显示网页的工具。为了提供这种功能，WINE 层包括一个使用 Mozilla 项目 Gecko 引擎的浏览器组件。首次启动 WINE 时，它会提供下载并安装该组件的选项，用户可能会希望让它自动执行这一操作（将在后续章节中详细介绍）。但用户也可以在安装 WINE 之前或与 WINE 一起安装它。

安装此软件包：

```sh
# pkg install wine-gecko
```

或者，从源代码编译：

```sh
# cd /usr/ports/emulator/wine-gecko
# make install
```

* **wine-mono**\
  此 Port 安装了 MONO 框架，作为 Microsoft .NET 的开源实现。如果将其与 WINE 一起安装，它将使得任何编写于 .NET 的应用程序能够更容易地在系统上安装和运行。

安装此软件包：

```sh
# pkg install wine-mono
```

从 Ports 中编译：

```sh
# cd /usr/ports/emulator/wine-mono
# make install
```

## 13.3.2. 通过 FreeBSD 包仓库安装 WINE

在安装了上述前提条件之后，可以通过以下命令使用包安装 WINE：

```sh
# pkg install wine
```

或者，从源代码编译 WINE 子系统：

```sh
# cd /usr/ports/emulator/wine
# make install
```

## 13.3.3. 32 位与 64 位 WINE 安装的相关问题

像大多数软件一样，Windows® 应用程序也从旧的 32 位架构升级到了 64 位架构，并且大多数最新软件是为 64 位操作系统编写的，尽管现代操作系统有时仍能运行旧的 32 位程序。FreeBSD 也不例外，自 5.x 系列以来就支持 64 位。

然而，使用不再默认支持的旧软件是仿真器的常见用途，用户通常会使用 WINE 来运行在现代硬件上无法正常运行的游戏和其他程序。幸运的是，FreeBSD 可以支持以下三种情况：

* 在现代 64 位机器上运行 64 位 Windows® 软件，只需安装上述部分中提到的 Port，Ports 系统会自动安装 64 位版本。
* 或者，用户可能有一台较旧的 32 位机器，不希望使用其原始的、现在不再支持的软件。可以安装 32 位（i386）版本的 FreeBSD，然后安装上述部分中的 Port。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.bsdcn.org/di-13-zhang-wine/13.3.-zai-freebsd-shang-an-zhuang-wine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
