解决tauri打包失败

590 阅读1分钟

解决tauri打包失败,安装wix和nsis遇到的网络问题(本地安装)

1. 确保你使用的是Tauri 2.0,然后去 github 查看 Tauri 源码查看需要的工具地址,然后下载到本地

Wix:github.com/tauri-apps/…

// URLS for the WIX toolchain.  Can be used for cross-platform compilation.
pub const WIX_URL: &str =
  "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip";
pub const WIX_SHA256: &str = "6ac824e1642d6f7277d0ed7ea09411a508f6116ba6fae0aa5f2c7daa2ff43d31";

NSIS & nsis_tauri_utils:github.com/tauri-apps/…

// URLS for the NSIS toolchain.
#[cfg(target_os = "windows")]
const NSIS_URL: &str =
  "https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip";
#[cfg(target_os = "windows")]
const NSIS_SHA1: &str = "057e83c7d82462ec394af76c87d06733605543d4";
const NSIS_TAURI_UTILS_URL: &str =
  "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.4.1/nsis_tauri_utils.dll";
const NSIS_TAURI_UTILS_SHA1: &str = "F99A50209A345185A84D34D0E5F66D04C75FF52F";

2. 创建文件夹

1. Wix文件夹

C:\Users\你的用户名\AppData\Local\tauri\WixTools314 把下载的 Wix 丢进去,效果如图

image.png

2. NSIS文件夹

C:\Users\你的用户名\AppData\Local\tauri\NSIS 把下载的 NSIS 丢进去,效果如图

image.png

3. 把 nsis_tauri_utils 放到插件目录

插件目录地址:C:\Users\你的用户名\AppData\Local\tauri\NSIS\Plugins\x86-unicode

image.png

3. 结束

不需要其他插件,不要下载错工具版本就行了,结束