fix reinstall

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-03-02 21:40:03 +08:00
parent 4f8dd59c7c
commit 896da1b153
2 changed files with 4 additions and 4 deletions

View File

@ -129,7 +129,7 @@ pub fn core_main() -> Option<Vec<String>> {
{
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<Vec<String>> {
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(),

View File

@ -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<std::path::PathBuf> {