diff --git a/.changes/fix-custom-signer-uninstaller.md b/.changes/fix-custom-signer-uninstaller.md new file mode 100644 index 000000000..f3d1e6a16 --- /dev/null +++ b/.changes/fix-custom-signer-uninstaller.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": patch:bug +--- + +Fix custom Windows sign command failing to sign app uninstaller if it references relative paths. \ No newline at end of file diff --git a/crates/tauri-bundler/src/bundle/windows/sign.rs b/crates/tauri-bundler/src/bundle/windows/sign.rs index 3c4cd9573..d24b9135b 100644 --- a/crates/tauri-bundler/src/bundle/windows/sign.rs +++ b/crates/tauri-bundler/src/bundle/windows/sign.rs @@ -142,12 +142,21 @@ pub fn sign_command_custom>( ) -> crate::Result { let path = path.as_ref(); + let cwd = std::env::current_dir()?; + let mut cmd = Command::new(&command.cmd); for arg in &command.args { if arg == "%1" { cmd.arg(path); } else { - cmd.arg(arg); + let path = Path::new(arg); + // turn relative paths into absolute paths - so the uninstall command can use them + // since the !uninstfinalize NSIS hook runs in a different directory + if path.exists() && path.is_relative() { + cmd.arg(cwd.join(path)); + } else { + cmd.arg(arg); + } } } Ok(cmd)