refact: install printer (#11745)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-05-13 14:14:54 +08:00
committed by GitHub
parent f56c5c1bbb
commit 4c354ee1ae
2 changed files with 33 additions and 5 deletions

View File

@@ -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")]