From 896da1b1539e980243163001f8b836b0cc2035dd Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 2 Mar 2023 21:40:03 +0800 Subject: [PATCH] fix reinstall Signed-off-by: 21pages --- src/core_main.rs | 4 ++-- src/platform/windows.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core_main.rs b/src/core_main.rs index 2619a1c07..8db8b6467 100644 --- a/src/core_main.rs +++ b/src/core_main.rs @@ -129,7 +129,7 @@ pub fn core_main() -> Option> { { use crate::platform; if args[0] == "--uninstall" { - if let Err(err) = platform::uninstall_me() { + if let Err(err) = platform::uninstall_me(true) { log::error!("Failed to uninstall: {}", err); } return None; @@ -147,7 +147,7 @@ pub fn core_main() -> Option> { hbb_common::allow_err!(platform::update_me()); return None; } else if args[0] == "--reinstall" { - hbb_common::allow_err!(platform::uninstall_me()); + hbb_common::allow_err!(platform::uninstall_me(false)); hbb_common::allow_err!(platform::install_me( "desktopicon startmenu", "".to_owned(), diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 561bb4570..3d8b415b5 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -1235,8 +1235,8 @@ fn get_uninstall(kill_self: bool) -> String { ) } -pub fn uninstall_me() -> ResultType<()> { - run_cmds(get_uninstall(true), true, "uninstall") +pub fn uninstall_me(kill_self: bool) -> ResultType<()> { + run_cmds(get_uninstall(kill_self), true, "uninstall") } fn write_cmds(cmds: String, ext: &str, tip: &str) -> ResultType {