Showing window this allows the progress dialog when installing updates elevated

This commit is contained in:
Kevin Bost
2025-08-25 00:09:33 -07:00
parent 5cecac3631
commit 8072dcf28b

View File

@@ -55,7 +55,9 @@ pub fn apply_package_impl(old_locator: &VelopackLocator, package: &PathBuf, run_
vec!["apply".into(), "--norestart".into(), "--package".into(), package.into(), "--root".into(), root_path.into()];
let exe_path = std::env::current_exe()?;
let work_dir: Option<String> = None; // same as this process
let process_handle = process::run_process_as_admin(&exe_path, args, work_dir, false)?;
// NB: show_window must be true for dialogs to be shown
// https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-taskdialogindirect#remarks
let process_handle = process::run_process_as_admin(&exe_path, args, work_dir, true)?;
info!("Waiting (up to 10 minutes) for elevated process (pid: {}) to exit...", process_handle.pid());
let result = process::wait_for_process_to_exit(process_handle, Some(Duration::from_secs(10 * 60)))?;