5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 00:41:59 +08:00
wails/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/guides/windows-installer.mdx
2022-08-29 20:19:43 +10:00

59 lines
2.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# NSIS 安装程序
<p style={{ "text-align": "center" }}>
<img
src={require("@site/static/img/nsis.webp").default}
style={{ "max-width": "50%" }}
/>
<br />
</p>
Wails 支持使用[NSIS 安装程序](https://nsis.sourceforge.io/)生成 Windows 安装程序。
## 安装 NSIS
### Windows
安装程序可在[NSIS 下载页面](https://nsis.sourceforge.io/Download)上找到。
如果您使用 chocolatey 包管理器,请运行以下脚本:
```
choco install nsis
```
如果手动安装 NSIS则需要将 NSIS 安装目录中包含`makensis.exe`的*Bin*目录添加到 PATH 中。 [这是](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/) 一个关于如何在 Windows 上添加到 PATH 的好教程。
### Linux
应该可以通过您的发行版的软件包管理器获得`nsis`包。
### MacOS
NSIS 可通 homebrew 安装:`brew install nsis`。
## 生成安装程序
创建新项目时Wails 从`installer/info.json`中读取配置数据并使用项目的`wails.json`的 Info 部分,在`build/windows/installer`中生成 NSIS 配置文件: 创建新项目时Wails 从`installer/info.json`中读取配置数据并使用项目的`wails.json`的 Info 部分,在`build/windows/installer`中生成 NSIS 配置文件: The config data is read from `installer/info.json` and that is configured to use the project's `wails.json` Info section: 创建新项目时Wails 从`installer/info.json`中读取配置数据并使用项目的`wails.json`的 Info 部分,在`build/windows/installer`中生成 NSIS 配置文件: The config data is read from `installer/info.json` and that is configured to use the project's `wails.json` Info section:
```json
// ...
// ...
// ...
"Info": {
"companyName": "My Company Name",
"productName": "Wails Vite",
"productVersion": "1.0.0",
"copyright": "Copyright.........",
"comments": "Built using Wails (https://wails.io)"
},
```
要为您的应用程序生成安装程序,请使用`wails build`的`-nsis`标志:
```
wails build -nsis
```
现在可用安装程序将生成在`build/bin`目录中。