mirror of
https://github.com/EasyTier/EasyTier.git
synced 2024-11-16 11:42:27 +08:00
fix bug
This commit is contained in:
parent
084f0deddd
commit
bbbdc84aa9
|
@ -162,17 +162,18 @@ pub struct Service{
|
||||||
|
|
||||||
impl Service {
|
impl Service {
|
||||||
pub fn new() -> Result<Self, anyhow::Error> {
|
pub fn new() -> Result<Self, anyhow::Error> {
|
||||||
let service_manager = if cfg!(windows) {
|
#[cfg(target_os = "windows")]
|
||||||
Box::new(
|
let service_manager = Box::new(
|
||||||
crate::arch::windows::WinServiceManager::new(
|
crate::arch::windows::WinServiceManager::new(
|
||||||
Some(OsString::from("EasyTier Service")),
|
Some(OsString::from("EasyTier Service")),
|
||||||
Some(OsString::from(env!("CARGO_PKG_DESCRIPTION"))),
|
Some(OsString::from(env!("CARGO_PKG_DESCRIPTION"))),
|
||||||
vec![OsString::from("dnscache"), OsString::from("rpcss")],
|
vec![OsString::from("dnscache"), OsString::from("rpcss")],
|
||||||
)?
|
)?
|
||||||
)
|
);
|
||||||
} else {
|
|
||||||
<dyn ServiceManager>::native()?
|
#[cfg(not(target_os = "windows"))]
|
||||||
};
|
let service_manager = <dyn ServiceManager>::native()?;
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
lable: env!("CARGO_PKG_NAME").parse().unwrap(),
|
lable: env!("CARGO_PKG_NAME").parse().unwrap(),
|
||||||
service_manager
|
service_manager
|
||||||
|
|
Loading…
Reference in New Issue
Block a user