refactor linux install/uninstall service as windows
This commit is contained in:
parent
209e460f3f
commit
7f51f8d976
8 changed files with 309 additions and 195 deletions
|
|
@ -278,13 +278,17 @@ pub fn set_option(key: String, value: String) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
#[cfg(any(target_os = "windows"))]
|
||||
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||
{
|
||||
if crate::platform::is_installed() {
|
||||
if value == "Y" {
|
||||
allow_err!(crate::platform::uninstall_service(true));
|
||||
if crate::platform::uninstall_service(true) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
allow_err!(crate::platform::install_service());
|
||||
if crate::platform::install_service() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue