NSIS 安装程序

Wails 支持使用 NSIS 安装程序 生成 Windows 安装程序。
安装 NSIS
Windows
安装程序可在 NSIS 下载页面 上找到。
You can install with Scoop (which will automatically add it to your PATH):
scoop bucket add extras
scoop install nsis
Or, you can use Winget (on Windows 10+):
winget install NSIS.NSIS --silent
如果您使用 chocolatey 包管理器,请运行以下脚本:
choco install nsis
NOTE: If you install NSIS manually, you need to add the Bin folder, which contains makensis.exe, in your NSIS installation to your path. 这是 一个关于如何在 Windows 上添加到 PATH 的好教程。
Linux
应该可以通过您的发行版的软件包管理器获得 nsis 包。
MacOS
NSIS 可通 homebrew 安装:brew install nsis。
生成安装程序
创建新项目时,Wails 会在 build/windows/installer 中生成 NSIS 配置文件。 从 installer/info.json 读取配置数据,并配置为使用项目的 wails.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 目录中。