mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
fix(updater): Escape msi path string (#1495)
* fix(updater): Escape msi path string * fmt
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"updater": patch
|
||||
---
|
||||
|
||||
On Windows, escape the path to the downloaded msi updater to fix an issue causing the update to fail when the `productName` contained spaces.
|
||||
@@ -2,7 +2,13 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
const COMMANDS: &[&str] = &["notify", "request_permission", "is_permission_granted", "register_action_types", "register_listener"];
|
||||
const COMMANDS: &[&str] = &[
|
||||
"notify",
|
||||
"request_permission",
|
||||
"is_permission_granted",
|
||||
"register_action_types",
|
||||
"register_listener",
|
||||
];
|
||||
|
||||
fn main() {
|
||||
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
|
||||
|
||||
@@ -582,6 +582,11 @@ impl Update {
|
||||
|
||||
let (updater_type, path, _temp) = Self::extract(bytes)?;
|
||||
|
||||
let mut msi_path = std::ffi::OsString::new();
|
||||
msi_path.push("\"");
|
||||
msi_path.push(&path);
|
||||
msi_path.push("\"");
|
||||
|
||||
let install_mode = self.config.install_mode();
|
||||
let installer_args: Vec<&OsStr> = match updater_type {
|
||||
WindowsUpdaterType::Nsis => install_mode
|
||||
@@ -592,7 +597,7 @@ impl Update {
|
||||
.chain(self.nsis_installer_args())
|
||||
.chain(self.installer_args())
|
||||
.collect(),
|
||||
WindowsUpdaterType::Msi => [OsStr::new("/i"), path.as_os_str()]
|
||||
WindowsUpdaterType::Msi => [OsStr::new("/i"), msi_path.as_os_str()]
|
||||
.into_iter()
|
||||
.chain(install_mode.msiexec_args().iter().map(OsStr::new))
|
||||
.chain(once(OsStr::new("/promptrestart")))
|
||||
|
||||
Reference in New Issue
Block a user