文章目录
- 1 更改配置里打包标识符identifier
- [附] 相关资源网盘链接(适配tauri v1.5.9)
- 2 wix的下载
- 3 nsis下载
1 更改配置里打包标识符identifier
// tauri.config.json
// 默认env -> build
"bundle": {
...
"identifier": "com.tauri.build",
...
}
p.s 我用的是npm
npm run tauri build
受局域网原因,打包需要的工具wix, nsis会无法正常下载,这些工具通常只需下载一遍即可(部分可能会因版本变更问题,需要同步更新再次下载)
[附] 相关资源网盘链接(适配tauri v1.5.9)
链接:https://pan.baidu.com/s/1Z79ByftwCA0_80cJIM5aNA
提取码:g560
2 wix的下载
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.
3 nsis下载
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
至此,wix和nsis打包都能正常进行了
相关文章:https://github.com/tauri-apps/tauri/issues/7338