From 7039bf7e98f82b0e4a131d56da3f43451aa5e8f6 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Mon, 1 Jun 2026 16:09:28 +0700 Subject: [PATCH] fix: pass updater executable path to CreateProcess --- src/update/handoff.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/update/handoff.rs b/src/update/handoff.rs index 36f285f..02acb45 100644 --- a/src/update/handoff.rs +++ b/src/update/handoff.rs @@ -22,6 +22,7 @@ use windows::Win32::System::Threading::{ /// so no zombie wait is required. pub fn spawn_detached(exe: &Path, args: &[OsString]) -> io::Result<()> { let mut cmdline = build_command_line(exe, args); + let exe_w: Vec = exe.as_os_str().encode_wide().chain(Some(0)).collect(); let si = STARTUPINFOW { cb: std::mem::size_of::() as u32, @@ -32,7 +33,7 @@ pub fn spawn_detached(exe: &Path, args: &[OsString]) -> io::Result<()> { let flags = CREATE_NO_WINDOW | DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP; let ok = unsafe { CreateProcessW( - PCWSTR::null(), + PCWSTR::from_raw(exe_w.as_ptr()), windows::core::PWSTR(cmdline.as_mut_ptr()), None, None,