rust+tauri开发web桌面应用并打包exe且生成安装包

xingyun86 1月前 225

rust+tauri开发web桌面应用并打包exe且生成安装包

1.下载Rust

2.配置环境变量

本帖有隐藏内容,请您回复后查看。

3.创建tauri应用

PS E:\RustDebugProject> cargo install tauri-cli
PS E:\RustDebugProject> cargo install create-tauri-app
PS E:\RustDebugProject> cargo create-tauri-app 
✔ Project name · aaa
✔ Choose which language to use for your frontend · Rust - (cargo)
✔ Choose your UI template · Vanilla
Template created! To get started run:
  cd aaa
  cargo tauri dev

4.查看运行效果

5.修改tauri.conf.json

          tauri.bundle.identifier: "com.tauri.dev" -> "com.tauri.build"

6.手动下载依赖工具(根据网络情况可选)

本帖有隐藏内容,请您回复后查看。

7.执行打包命令即可

cargo tauri build
    Finished release [optimized] target(s) in 0.39s
        Info Target: x64
     Running candle for "main.wxs"
     Running light to produce E:\RustDebugProject\aaa\src-tauri\target\release\bundle\msi\aaa_0.0.0_x64_en-US.msi
        Warn NSIS directory contains mis-hashed files. Redownloading them.
 Downloading https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.2/nsis_tauri_utils.dll
PS E:\RustDebugProject> cargo tauri build
    Finished release [optimized] target(s) in 0.38s
        Info Target: x64
     Running candle for "main.wxs"
     Running light to produce E:\RustDebugProject\aaa\src-tauri\target\release\bundle\msi\aaa_0.0.0_x64_en-US.msi
        Info Target: x64
     Running makensis.exe to produce E:\RustDebugProject\aaa\src-tauri\target\release\bundle\nsis\aaa_0.0.0_x64-setup.exe
    Finished 2 bundles at:
        E:\RustDebugProject\aaa\src-tauri\target\release\bundle\msi\aaa_0.0.0_x64_en-US.msi
        E:\RustDebugProject\aaa\src-tauri\target\release\bundle\nsis\aaa_0.0.0_x64-setup.exe

在E:\RustDebugProject\aaa\src-tauri\target\release\可以看到可以执行的exe文件。

本帖有隐藏内容,请您回复后查看。


×
打赏作者
最新回复 (0)
只看楼主
全部楼主
返回