Skip to content

Commit e045fe3

Browse files
authored
fix(bundler): custom sign command failing to sign uninstaller executable (#13334)
1 parent 197da6f commit e045fe3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": patch:bug
3+
---
4+
5+
Fix custom Windows sign command failing to sign app uninstaller if it references relative paths.

crates/tauri-bundler/src/bundle/windows/sign.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,21 @@ pub fn sign_command_custom<P: AsRef<Path>>(
142142
) -> crate::Result<Command> {
143143
let path = path.as_ref();
144144

145+
let cwd = std::env::current_dir()?;
146+
145147
let mut cmd = Command::new(&command.cmd);
146148
for arg in &command.args {
147149
if arg == "%1" {
148150
cmd.arg(path);
149151
} else {
150-
cmd.arg(arg);
152+
let path = Path::new(arg);
153+
// turn relative paths into absolute paths - so the uninstall command can use them
154+
// since the !uninstfinalize NSIS hook runs in a different directory
155+
if path.exists() && path.is_relative() {
156+
cmd.arg(cwd.join(path));
157+
} else {
158+
cmd.arg(arg);
159+
}
151160
}
152161
}
153162
Ok(cmd)

0 commit comments

Comments
 (0)