refactor
This commit is contained in:
parent
b0dfd777fb
commit
0325500ebf
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -517,7 +517,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "cpal"
|
name = "cpal"
|
||||||
version = "0.13.4"
|
version = "0.13.4"
|
||||||
source = "git+https://github.com/rustaudio/cpal#959733011607148100032fca5fd18c48c98d5d92"
|
source = "git+https://github.com/open-trade/cpal#6b0b769f3d8ea22abdc3a6ea0c74311bf0cfbac3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alsa",
|
"alsa",
|
||||||
"core-foundation-sys 0.8.2",
|
"core-foundation-sys 0.8.2",
|
||||||
@ -2852,7 +2852,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustdesk"
|
name = "rustdesk"
|
||||||
version = "1.1.6"
|
version = "1.1.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_logger",
|
"android_logger",
|
||||||
"arboard",
|
"arboard",
|
||||||
|
15
src/main.rs
15
src/main.rs
@ -58,30 +58,23 @@ fn main() {
|
|||||||
if args.is_empty() {
|
if args.is_empty() {
|
||||||
std::thread::spawn(move || start_server(false, false));
|
std::thread::spawn(move || start_server(false, false));
|
||||||
} else {
|
} else {
|
||||||
if args[0] == "--uninstall" {
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
{
|
||||||
|
if args[0] == "--uninstall" {
|
||||||
if let Err(err) = platform::uninstall_me() {
|
if let Err(err) = platform::uninstall_me() {
|
||||||
log::error!("Failed to uninstall: {}", err);
|
log::error!("Failed to uninstall: {}", err);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
} else if args[0] == "--update" {
|
} else if args[0] == "--update" {
|
||||||
#[cfg(windows)]
|
|
||||||
{
|
|
||||||
hbb_common::allow_err!(platform::update_me());
|
hbb_common::allow_err!(platform::update_me());
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
} else if args[0] == "--reinstall" {
|
} else if args[0] == "--reinstall" {
|
||||||
#[cfg(windows)]
|
|
||||||
{
|
|
||||||
hbb_common::allow_err!(platform::uninstall_me());
|
hbb_common::allow_err!(platform::uninstall_me());
|
||||||
hbb_common::allow_err!(platform::install_me(
|
hbb_common::allow_err!(platform::install_me("desktopicon startmenu",));
|
||||||
"desktopicon startmenu",
|
|
||||||
));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if args[0] == "--remove" {
|
}
|
||||||
|
if args[0] == "--remove" {
|
||||||
if args.len() == 2 {
|
if args.len() == 2 {
|
||||||
// sleep a while so that process of removed exe exit
|
// sleep a while so that process of removed exe exit
|
||||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user