disable windows service install/uninstall
This commit is contained in:
parent
14541fd182
commit
594ce024e7
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3301,7 +3301,7 @@ dependencies = [
|
|||||||
"anyhow",
|
"anyhow",
|
||||||
"apple-sys",
|
"apple-sys",
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"core-foundation 0.9.3",
|
"core-foundation",
|
||||||
"shadow-rs",
|
"shadow-rs",
|
||||||
"windows 0.48.0",
|
"windows 0.48.0",
|
||||||
"winres",
|
"winres",
|
||||||
|
@ -1309,11 +1309,13 @@ pub fn add_recent_document(path: &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_installed() -> bool {
|
pub fn is_installed() -> bool {
|
||||||
|
let (_, _, _, exe) = get_install_info();
|
||||||
|
std::fs::metadata(exe).is_ok()
|
||||||
|
/*
|
||||||
use windows_service::{
|
use windows_service::{
|
||||||
service::ServiceAccess,
|
service::ServiceAccess,
|
||||||
service_manager::{ServiceManager, ServiceManagerAccess},
|
service_manager::{ServiceManager, ServiceManagerAccess},
|
||||||
};
|
};
|
||||||
let (_, _, _, exe) = get_install_info();
|
|
||||||
if !std::fs::metadata(exe).is_ok() {
|
if !std::fs::metadata(exe).is_ok() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1326,6 +1328,7 @@ pub fn is_installed() -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_reg(name: &str) -> String {
|
pub fn get_reg(name: &str) -> String {
|
||||||
|
@ -283,6 +283,7 @@ pub fn set_option(key: String, value: String) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
#[cfg(any(target_os = "windows"))]
|
#[cfg(any(target_os = "windows"))]
|
||||||
{
|
{
|
||||||
if crate::platform::is_installed() {
|
if crate::platform::is_installed() {
|
||||||
@ -294,6 +295,7 @@ pub fn set_option(key: String, value: String) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
if value.is_empty() {
|
if value.is_empty() {
|
||||||
options.remove(&key);
|
options.remove(&key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user