tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.85k stars 2.46k forks source link

[bug] NSIS Installer not escaping resource paths correctly #9270

Closed lockieluke closed 5 months ago

lockieluke commented 5 months ago

Describe the bug

Additional resource files embedded in a subdirectory like resources/** don't have their paths escaped correctly for Windows when building on macOS

tauri.windows.conf.json:

{
  "tauri": {
    "bundle": {
      "resources": [
          "resources/blank_config.bin",
          "resources/rboot.bin",
          "resources/Sonoff_OFF.bin",
          "resources/Sonoff_ON.bin"
      ]
    }
  }
}

Installation, despite having a resources directory created, files aren't moved into it properly: image

Reproduction

https://github.com/lockieluke/sonoff-homekit-flasher

Follow README to build for Windows on macOS and install using the NSIS installer on a Windows machine

Expected behavior

Files should be placed within resources instead of having resources prepended to their filenames

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.2.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.78.0-nightly (766bdce74 2024-03-16)
    ✔ cargo: 1.78.0-nightly (2fe739fcf 2024-03-15)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: nightly-aarch64-apple-darwin (default)
    - node: 21.1.0
    - pnpm: 8.15.5
    - yarn: 4.0.2
    - npm: 9.1.2
    - bun: 1.0.33

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - tauri-cli [RUST]: 1.5.10
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

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


### Stack trace

_No response_

### Additional context

_No response_
lockieluke commented 5 months ago

This could be related: https://github.com/tauri-apps/tauri/blob/7898b601d14ed62053dd24011fabadf31ec1af45/tooling/bundler/src/bundle/windows/nsis.rs#L329

zuccha commented 5 months ago

I have the same exact issue

[✔] Environment
    - OS: Mac OS 14.2.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.77.0 (aedd173a2 2024-03-17)
    ✔ cargo: 1.77.0 (3fe68eabf 2024-02-29)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.5.1
    - npm: 9.8.0

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.8
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.11

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

My resources config looks like this

{
    "tauri": {
        "bundle": {
            "resources": ["resources/*"]
        }
    }
}