install service period protection

how to reproduce:
install, click stop service, click start service and click no
on uac, it'll show "Service is not running" but can be connected.

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-09-11 16:04:51 +08:00
parent e98aa81794
commit d0173fbdc5
4 changed files with 30 additions and 2 deletions

View File

@@ -2167,6 +2167,7 @@ pub fn uninstall_service(show_new_window: bool) -> bool {
pub fn install_service() -> bool {
log::info!("Installing service...");
let _installing = crate::platform::InstallingService::new();
let (_, _, _, exe) = get_install_info();
let tmp_path = std::env::temp_dir().to_string_lossy().to_string();
let tray_shortcut = get_tray_shortcut(&exe, &tmp_path).unwrap_or_default();