tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] SignTool Error: This file format cannot be signed because it is not recognized

Open dwosk opened this issue 7 months ago • 8 comments

Describe the bug

When bundle > resources contains a map where some of the resources are not binary files, attempting to sign on Windows results in the build failing:

SignTool Error: This file format cannot be signed because it is not recognized.

I believe this is a regression after I recently migrated to latest.

Reproduction

tauri.conf.json should have bundle > resources with something like:

    "resources": {
      "packaging/README.md": "README.md"
    },

bundle > windows should also be configured for proper signing, and for reference, I also am using msi as the bundle target.

Then build the project: npm run tauri build

Expected behavior

Previously, I don't think files listed under the resources map were signed at build time. I think it makes sense that Tauri now attempts to, but it should skip non-binary files.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 135.0.3179.98
    ✔ MSVC: Visual Studio Professional 2022
    ✔ rustc: 1.85.1 (4eb161250 2025-03-15)
    ✔ cargo: 1.85.1 (d73d2caf9 2024-12-31)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: 1.81.0-x86_64-pc-windows-msvc (overridden by 'C:\j\workspace\desktop-app_dwosk_tauri\rust-toolchain.toml')
    - node: 23.11.0
    - npm: 10.9.2

[-] Packages
    - tauri 🦀: 2.5.1
    - tauri-build 🦀: 2.2.0
    - wry 🦀: 0.51.2
    - tao 🦀: 0.33.0
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.5.0

[-] Plugins
    - tauri-plugin-updater 🦀: 2.7.1
    - @tauri-apps/plugin-updater : not installed!
    - tauri-plugin-single-instance 🦀: 2.2.3
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-dialog 🦀: 2.2.1
    - @tauri-apps/plugin-dialog : not installed!
    - tauri-plugin-notification 🦀: 2.2.2
    - @tauri-apps/plugin-notification : not installed!
    - tauri-plugin-process 🦀: 2.2.1
    - @tauri-apps/plugin-process : not installed!
    - tauri-plugin-deep-link 🦀: 2.2.1
    - @tauri-apps/plugin-deep-link : not installed!
    - tauri-plugin-os 🦀: 2.2.1
    - @tauri-apps/plugin-os : not installed!
    - tauri-plugin-fs 🦀: 2.2.1
    - @tauri-apps/plugin-fs : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../../frontend/build
    - devUrl: http://localhost:3000/

Stack trace


Additional context

No response

dwosk avatar Apr 30 '25 00:04 dwosk

@lucasfernog I believe this was introduced by the recent changes here: https://github.com/tauri-apps/tauri/pull/11676/files

dwosk avatar Apr 30 '25 00:04 dwosk

For now, we've worked around the issue by pinning to a slightly older version of the cli:

$ npm install @tauri-apps/[email protected]   

dwosk avatar Apr 30 '25 01:04 dwosk

I am also encountering this issue after upgrading from 2.2.7 to 2.5.0.

tauri build now attempts to sign a .txt file with relic and causes the build to fail due to the file being an unrecognized file type. This essentially renders 2.5.0 unusable for us. Downgrading back from 2.5.0 circumvents this issue for the time being.

fredgig avatar May 07 '25 18:05 fredgig

I'm having the exact same problem.

IRONAGE-Park avatar May 12 '25 06:05 IRONAGE-Park

I'm having the same problem. Non-dll/exe files should definitely not be signed automatically. I'm not sure it even makes sense to sign dlls included in resources. If you're redistributing dlls that have already been signed, you don't want to replace that signature. It seems to me that dlls in resources should be signed as part of whatever build process created the dll, not by Tauri.

alexmoon avatar May 15 '25 18:05 alexmoon

https://github.com/tauri-apps/tauri/blob/638804e9c488afdcd51bff8f329a321903337263/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs#L748

linguofeng avatar May 17 '25 09:05 linguofeng

If you're redistributing dlls that have already been signed, you don't want to replace that signature

That is absolutely true (most of the time) and something i've added to the sidecar bundling in the past as well.

https://github.com/tauri-apps/tauri/blob/638804e9c488afdcd51bff8f329a321903337263/crates/tauri-bundler/src/bundle.rs#L74

FabianLars avatar May 17 '25 09:05 FabianLars

Same thing: https://github.com/mountain-loop/yaak/actions/runs/15513545972/job/43677453335

gschier avatar Jun 08 '25 03:06 gschier

For now, we've worked around the issue by pinning to a slightly older version of the cli:

$ npm install @tauri-apps/[email protected]   

This worked for me. Thanks!

vwnd avatar Jul 09 '25 07:07 vwnd