From 1b0e335d3f3445948d6590f7e074275d97cd9859 Mon Sep 17 00:00:00 2001 From: Wuelfhis Asuaje Date: Tue, 13 Jan 2026 22:09:45 -0300 Subject: [PATCH] Fix: Updater signer failed signing file without extension (#14713) * fixing bug where updater signer failed signing file withou extension * removing unnecessary unwrap() * Adding change file. Removing commnent. Adding TODO. * Apply suggestions from code review --------- Co-authored-by: Wuelfhis Asuaje Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --- .changes/updater-signer-files-without-extension.md | 6 ++++++ crates/tauri-cli/src/helpers/updater_signature.rs | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changes/updater-signer-files-without-extension.md diff --git a/.changes/updater-signer-files-without-extension.md b/.changes/updater-signer-files-without-extension.md new file mode 100644 index 000000000..1ff41edbd --- /dev/null +++ b/.changes/updater-signer-files-without-extension.md @@ -0,0 +1,6 @@ +--- +tauri-cli: patch:bug +"@tauri-apps/cli": patch:bug +--- + +`tauri signer sign` doesn't work for files without an extension diff --git a/crates/tauri-cli/src/helpers/updater_signature.rs b/crates/tauri-cli/src/helpers/updater_signature.rs index 9367e7bad..ba9012359 100644 --- a/crates/tauri-cli/src/helpers/updater_signature.rs +++ b/crates/tauri-cli/src/helpers/updater_signature.rs @@ -120,9 +120,14 @@ where { let bin_path = bin_path.as_ref(); // We need to append .sig at the end it's where the signature will be stored - let mut extension = bin_path.extension().unwrap().to_os_string(); - extension.push(".sig"); - let signature_path = bin_path.with_extension(extension); + // TODO: use with_added_extension when we bump MSRV to > 1.91' + let signature_path = if let Some(ext) = bin_path.extension() { + let mut extension = ext.to_os_string(); + extension.push(".sig"); + bin_path.with_extension(extension) + } else { + bin_path.with_extension("sig") + }; let trusted_comment = format!( "timestamp:{}\tfile:{}",