fix(updater): escape MSI path (#4737)

This commit is contained in:
Lucas Fernandes Nogueira 2022-07-22 11:23:43 -03:00 committed by GitHub
parent 635f23b88a
commit 9af43134e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Escape the MSI file path when running msiexec via powershell.

View File

@ -789,6 +789,12 @@ fn copy_files_and_run<R: Read + Seek>(
current_exe_arg.push("\"");
current_exe_arg.push(current_exe()?);
current_exe_arg.push("\"");
let mut msi_path_arg = std::ffi::OsString::new();
msi_path_arg.push("\"\"\"");
msi_path_arg.push(&found_path);
msi_path_arg.push("\"\"\"");
// run the installer and relaunch the application
let powershell_install_res = Command::new("powershell.exe")
.args(["-NoProfile", "-windowstyle", "hidden"])
@ -800,7 +806,7 @@ fn copy_files_and_run<R: Read + Seek>(
"-ArgumentList",
])
.arg("/i,")
.arg(&found_path)
.arg(msi_path_arg)
.arg(format!(", {}, /promptrestart;", msiexec_args.join(", ")))
.arg("Start-Process")
.arg(current_exe_arg)