// tauri.config.json
// 默认env -> build
"bundle": {
...
"identifier": "com.tauri.build",
...
}
p.s 我用的是npm
npm run tauri build
受局域网原因,打包需要的工具wix, nsis会无法正常下载,这些工具通常只需下载一遍即可(部分可能会因版本变更问题,需要同步更新再次下载)
链接:https://pan.baidu.com/s/1Z79ByftwCA0_80cJIM5aNA
提取码:g560
wix官方:
https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
将压缩包解压至 C:\Users\你的用户名\AppData\Local\tauri\WixTools
(AppData默认隐藏,tauri、WixTools文件夹自行创建)
注意!!!对于windows用户,如果不需要nsis打包的应用,可以修改配置里的targets; 这样在build时就不需要下载nsis了
// tauri.config.json
// 默认all -> msi
"bundle": {
...
"targets": "msi",
...
}
官网关于wix和nsis打包区别:
Tauri applications for Windows are either distributed as Microsoft Installers (.msi files) using the WiX Toolset v3 or starting with Tauri v1.3 as setup executables (-setup.exe files) using NSIS. The Tauri CLI bundles your application binary and additional resources. Please note that .msi installers can only be created on Windows as cross-compilation doesn’t work yet. Cross-compilation for NSIS installers is experimental and being worked on.
nsis官方:
- https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip
- https://github.com/tauri-apps/binary-releases/releases/download/nsis-plugins-v0/NSIS-ApplicationID.zip
- https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.1.1/nsis_tauri_utils.dll
(1) nsis-3.zip
解压至 C:\Users\你的用户名\AppData\Local\tauri\NSIS
(2) NSIS-ApplicationID.zip
解压至 C:\Users\你的用户名\AppData\Local\tauri\NSIS\Plugins
(3)把NSIS\Plugins\ReleaseUnicode\ApplicationID.dll
复制到NSIS\Plugins\x86-unicode\ApplicationID.dll
(4)把下载的nsis_tauri_utils.dll
复制到NSIS\Plugins\x86-unicode\nsis_tauri_utils.dll