Merge pull request #3476 from 21pages/install

fix reinstall
This commit is contained in:
RustDesk 2023-03-03 10:31:17 +08:00 committed by GitHub
commit ef62869bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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> {