mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-31 17:11:02 +03:00
refact: install printer (#11745)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -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