Skip to content

Commit 9af4313

Browse files
authored
fix(updater): escape MSI path (#4737)
1 parent 635f23b commit 9af4313

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.changes/fix-windows-updater.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Escape the MSI file path when running msiexec via powershell.

core/tauri/src/updater/core.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,12 @@ fn copy_files_and_run<R: Read + Seek>(
789789
current_exe_arg.push("\"");
790790
current_exe_arg.push(current_exe()?);
791791
current_exe_arg.push("\"");
792+
793+
let mut msi_path_arg = std::ffi::OsString::new();
794+
msi_path_arg.push("\"\"\"");
795+
msi_path_arg.push(&found_path);
796+
msi_path_arg.push("\"\"\"");
797+
792798
// run the installer and relaunch the application
793799
let powershell_install_res = Command::new("powershell.exe")
794800
.args(["-NoProfile", "-windowstyle", "hidden"])
@@ -800,7 +806,7 @@ fn copy_files_and_run<R: Read + Seek>(
800806
"-ArgumentList",
801807
])
802808
.arg("/i,")
803-
.arg(&found_path)
809+
.arg(msi_path_arg)
804810
.arg(format!(", {}, /promptrestart;", msiexec_args.join(", ")))
805811
.arg("Start-Process")
806812
.arg(current_exe_arg)

0 commit comments

Comments
 (0)