fix(bundler): custom sign command failing to sign uninstaller executable (#13334)

This commit is contained in:
Lucas Fernandes Nogueira 2025-04-30 15:21:14 -03:00 committed by GitHub
parent 197da6fe78
commit e045fe32c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-bundler": patch:bug
---
Fix custom Windows sign command failing to sign app uninstaller if it references relative paths.

View File

@ -142,12 +142,21 @@ pub fn sign_command_custom<P: AsRef<Path>>(
) -> crate::Result<Command> {
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)