mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:37:09 +00:00
fix(bundler): custom sign command failing to sign uninstaller executable (#13334)
This commit is contained in:
parent
197da6fe78
commit
e045fe32c9
5
.changes/fix-custom-signer-uninstaller.md
Normal file
5
.changes/fix-custom-signer-uninstaller.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch:bug
|
||||
---
|
||||
|
||||
Fix custom Windows sign command failing to sign app uninstaller if it references relative paths.
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user