tauri-apps / nsis-tauri-utils

A collection of NSIS plugins written in rust.
Apache License 2.0
16 stars 8 forks source link

[bug] NSIS installer error "Could not load: nsis_tauri_utils.dll" #16

Closed barribarrier closed 1 year ago

barribarrier commented 1 year ago

Describe the bug

When running the NSIS installer, it throws the following error: Could not load: C:\Users\barri\AppData\Local\Temp\nsuF46A.tmp\nsis_tauri_utils.dll

Calls to nsis_tauri_utils::FindProcess in installer.nsi doesn't work as a result

image image

Reproduction

  1. Create sample app with npm create tauri-app@latest
  2. Build
    npm install
    npm run tauri build
  3. Run the generated NSIS installer
  4. Installer shows the error Could not load: C:\Users\barri\AppData\Local\Temp\nsuF46A.tmp\nsis_tauri_utils.dll
  5. Installer also falsely alerts that example-app is running. Which indicates nsis_tauri_utils::FindProcess command didn't work.

Expected behavior

Shouldn't throw any error

Platform and versions

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 115.0.1901.203
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Build Tools 2022
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.16.1
    - yarn: 1.22.19
    - npm: 9.5.1

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - bundler: Vite

Stack trace

No response

Additional context

No response

barribarrier commented 1 year ago

While the installer is still running, the temporary file C:\Users\barri\AppData\Local\Temp\nsuF46A.tmp\nsis_tauri_utils.dll does actually exist too.

barribarrier commented 1 year ago

I think this happens when the target system doesn't have VCRUNTIME140.dll available. Ran the nsis_tauri_utils.dll file through https://github.com/lucasg/Dependencies and it said I'm missing VCRUNTIME140.dll.

My currently installed redistributables: image

It would be awesome to have a statically linked nsis_tauri_utils.dll (if even possible)

FabianLars commented 1 year ago

hmm, iirc vcruntime140 should be part of that last one in the list in your screenshot. (still, it should be statically linked like in tauri itself too)

barribarrier commented 1 year ago

Installing the x86 version of the latest vc_redist fixed it. Even though I'm on x64 system.

FabianLars commented 1 year ago

oh right, that makes sense since nsis installers are 32bit. I totally forgot about that...