mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-05 08:37:15 +00:00
refact: install printer (#11745)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
1 parent
f56c5c1bbb
commit
4c354ee1ae
2 files changed
+33
-5
No files matched your search
@@ -269,6 +269,28 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
crate::virtual_display_manager::amyuni_idd::uninstall_driver()
|
||||
);
|
||||
return None;
|
||||
} else if args[0] == "--install-remote-printer" {
|
||||
#[cfg(windows)]
|
||||
if crate::platform::is_win_10_or_greater() {
|
||||
match remote_printer::install_update_printer(&crate::get_app_name()) {
|
||||
Ok(_) => {
|
||||
log::info!("Remote printer installed/updated successfully");
|
||||
}
|
||||
Err(e) => {
|
||||
log::error!("Failed to install/update the remote printer: {}", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log::error!("Win10 or greater required!");
|
||||
}
|
||||
return None;
|
||||
} else if args[0] == "--uninstall-remote-printer" {
|
||||
#[cfg(windows)]
|
||||
if crate::platform::is_win_10_or_greater() {
|
||||
remote_printer::uninstall_printer(&crate::get_app_name());
|
||||
log::info!("Remote printer uninstalled");
|
||||
}
|
||||
return None;
|
||||
}
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
Reference in new issue
Block a user