# rust_tauri_win7 **Repository Path**: DengLibin/rust_tauri_win7 ## Basic Information - **Project Name**: rust_tauri_win7 - **Description**: rust_tauri_win7 - **Primary Language**: Rust - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-03 - **Last Updated**: 2026-03-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README npm install cargo install tauri-cli ### extractous 1.需要配置GRAALVM_HOME(将java版本的tika编译为本地库) 环境变量 GRAALVM_HOME = D:\program\graalvm-jdk-23_windows-x64_bin\graalvm-jdk-23.0.1+11.1 2.编译时会下载gradle, 开代理(虚拟网卡) 或: 修改用户目录的\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\extractous-0.2.0\tika-native\gradle\wrapper\gradle-wrapper.properties 中的distributionUrl这个配置,改成自己的可访问的地址 或修改项目目录的target目录下 如:target/debug/build/extractous-8600365d51045255/out/tika-native/gradle/wrapper/gradle-wrapper.properties cargo build --target x86_64-win7-windows-msvc -Zbuild-std --release win7环境构建,缺少windows.lib,在这个目录: C:\\Users\\denglibin\\.cargo\\registry\\src\\rsproxy.cn-e3de039b2554c837\\windows_x86_64_msvc-0.42.2\\lib\\windows.lib 拷贝到项目目录再构建 编译完成,tika的动态库在 build\extractous-0be3c56944cec5a6\out\libs ### win7 ### 1 pdfium-render 要 pdfium库 pdfium.dll(so) 下载地址:https://github.com/bblanchon/pdfium-binaries/releases/tag/chromium/6555 使用107版本 ### 2 webview离线包下载: https://github.com/westinyang/WebView2RuntimeArchive/releases?page=3 使用107版本兼容win7 解压后放到src-tauri目录, tauri.conf配置中指定webview2目录 ### 3 onnx运行环境下载地址 https://github.com/microsoft/onnxruntime win7版本 onnxruntime 1.20 https://github.com/yycmagic/onnxruntime-for-win7 编译时设置 ONNX Runtime 库文件的位置 (指向包含 .lib 文件的文件夹) ```sh $env:ORT_LIB_LOCATION = "D:\rust-projects\rust_tauri_win7\src-tauri" ``` win7需要安装sp1更新包和vc库,更新包在百度网盘 win7-update-sp1.zip ### rapidocr https://github.com/RapidAI/RapidOcrOnnx/releases 下载1.2.0版本 兼容win7 ### bundle示例 tauri 2.xx ```json "bundle": { "active": true, "targets": "all", "windows": { "webviewInstallMode": { "type": "fixedRuntime", "path": "Microsoft.WebView2.FixedVersionRuntime.107.0.1418.62.x86" } }, "bundle": { "active": true, "targets": "all", "windows": { "webviewInstallMode": { "type": "offlineInstaller", "silent": true } }, ``` # 使用nightly版本可以自建标准库 #rustup toolchain install nightly-i686-pc-windows-msvc # 用64位编译器(32位容易内存移除) rustup toolchain install nightly-x86_64-pc-windows-msvc rustup toolchain install nightly-i686-pc-windows-msvc # 切换 #rustup default nightly-i686-pc-windows-msvc rustup default nightly-x86_64-pc-windows-msvc rustup default nightly-i686-pc-windows-msvc # 添加源码 rustup component add rust-src ### 运行: cargo tauri dev -- --target x86_64-win7-windows-msvc -Zbuild-std ### 打包: ```sh #指定环境 cargo tauri build --bundles nsis -- --target x86_64-win7-windows-msvc -Zbuild-std 注意: -- --target x86_64-win7-windows-msvc -Zbuild-std 是内部rust的编译参数,编译后的文件在i686-win7-windows-msvc、 而 --bundles nsis 是tauri的参数,tauri不支持 i686-win7-windows-msvc -Zbuild-std, 所以打包后的bundle中的安装文件是那个的release的 #使用了YY_Thunks 兼容win7 直接构建也可以: cargo tauri build --bundles nsis ``` ## 只构建不打包 打包可以使用 nsis对 i686-win7-windows-msvc/release的文件单独打包,或者直接拷贝出来作为绿色版运行 ```sh # 指定环境 cargo tauri build --no-bundle -- --target x86_64-win7-windows-msvc -Zbuild-std #使用了YY_Thunks 兼容win7 直接构建也可以: cargo tauri build --no-bundle ``` linux下编译运行设置动态库目录(依赖libRapidOcrOnnx.so): export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH