fix: remote printer, update install option (#11461)

* fix: remote printer, update install option

Signed-off-by: fufesou <linlong1266@gmail.com>

* Add comments

Signed-off-by: fufesou <linlong1266@gmail.com>

* Add comments

Signed-off-by: fufesou <linlong1266@gmail.com>

* Win, run_cmds, remove extra whitespace and newline

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-04-24 18:24:22 +08:00
committed by GitHub
parent 5c2538e7af
commit 279fb72a4f
5 changed files with 73 additions and 4 deletions

View File

@@ -2438,6 +2438,16 @@ pub fn main_set_common(_key: String, _value: String) {
(false, err)
}
};
if success {
// Use `ipc` to notify the server process to update the install option in the registry.
// Because `install_update_printer()` may prompt for permissions, there is no need to prompt again here.
if let Err(e) = crate::ipc::set_install_option(
crate::platform::REG_NAME_INSTALL_PRINTER.to_string(),
"1".to_string(),
) {
log::error!("Failed to set install printer option: {}", e);
}
}
let data = HashMap::from([
("name", serde_json::json!("install-printer-res")),
("success", serde_json::json!(success)),