windows silent install notification

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-09-07 21:29:49 +08:00
parent 065c19cbbc
commit 91decea302
38 changed files with 698 additions and 549 deletions

View File

@@ -1,3 +1,5 @@
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use crate::client::translate;
#[cfg(not(debug_assertions))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use crate::platform::breakdown_callback;
@@ -5,6 +7,8 @@ use hbb_common::log;
#[cfg(not(debug_assertions))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
use hbb_common::platform::register_breakdown_handler;
#[cfg(windows)]
use tauri_winrt_notification::{Duration, Sound, Toast};
#[macro_export]
macro_rules! my_println{
@@ -178,12 +182,23 @@ pub fn core_main() -> Option<Vec<String>> {
}
return None;
} else if args[0] == "--silent-install" {
hbb_common::allow_err!(platform::install_me(
let res = platform::install_me(
"desktopicon startmenu driverCert",
"".to_owned(),
true,
args.len() > 1,
));
);
let text = match res {
Ok(_) => translate("Installation Successful!".to_string()),
Err(_) => translate("Installation failed!".to_string()),
};
Toast::new(Toast::POWERSHELL_APP_ID)
.title(&hbb_common::config::APP_NAME.read().unwrap())
.text1(&text)
.sound(Some(Sound::Default))
.duration(Duration::Short)
.show()
.ok();
return None;
} else if args[0] == "--install-cert" {
#[cfg(windows)]

File diff suppressed because it is too large Load Diff

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "更改颜色"),
("Primary Color", "基本色"),
("HSV Color", "HSV 色"),
("Installation Successful!", "安装成功!"),
("Installation failed!", "安装失败!"),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Farbe ändern"),
("Primary Color", "Primärfarbe"),
("HSV Color", "HSV-Farbe"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Cambiar Color"),
("Primary Color", "Color Primario"),
("HSV Color", "Color HSV"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Modifier la couleur"),
("Primary Color", "Couleur primaire"),
("HSV Color", "Couleur TSL"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Ganti warna"),
("Primary Color", "Warna utama"),
("HSV Color", "Warna HSV"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Modifica colore"),
("Primary Color", "Colore primario"),
("HSV Color", "Colore HSV"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Kleur Aanpassen"),
("Primary Color", "Hoofdkleur"),
("HSV Color", "HSV Kleur"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Изменить цвет"),
("Primary Color", "Основной цвет"),
("HSV Color", "HSV цвет"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -408,7 +408,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("One-time password length", "Tek seferlik şifre uzunluğu"),
("Request access to your device", "Cihazınıza erişim talep edin"),
("Hide connection management window", "Bağlantı yönetimi penceresini gizle"),
("hide_cm_tip", "Oturumları yalnızca parola ile kabul edebilir ve kalıcı parola kullanıyorsanız gizlemeye izin verin"),
("hide_cm_tip", "Oturumları yalnızca parola ile kabul edebilir ve kalıcı parola kullanıyorsanız gizlemeye izin verin"),
("wayland_experiment_tip", "Wayland desteği deneysel aşamada olduğundan, gerektiğinde X11'i kullanmanız önerilir"),
("Right click to select tabs", "Sekmeleri seçmek için sağ tıklayın"),
("Skipped", "Atlandı"),
@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "Rengi Değiştir"),
("Primary Color", "Birincil Renk"),
("HSV Color", "HSV Rengi"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", "更改顏色"),
("Primary Color", "基本色"),
("HSV Color", "HSV 色"),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}

View File

@@ -541,5 +541,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Change Color", ""),
("Primary Color", ""),
("HSV Color", ""),
("Installation Successful!", ""),
("Installation failed!", ""),
].iter().cloned().collect();
}