diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index d1455f8..2d52b62 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -308,6 +308,7 @@ fn is_grasscutter_running() -> bool { !proc.is_empty() } +#[cfg(windows)] #[tauri::command] fn restart_grasscutter(window: tauri::Window) -> bool { let pid: usize = *GC_PID.lock().unwrap(); @@ -338,6 +339,7 @@ fn restart_grasscutter(window: tauri::Window) -> bool { } } +#[cfg(windows)] #[tauri::command] fn enable_grasscutter_watcher(window: tauri::Window, process: String) { let grasscutter_name = process.clone(); diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index f25e193..c3537f1 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -1,12 +1,12 @@ use duct::cmd; use ini::Ini; -use std::ffi::OsStr; use std::path::PathBuf; -use windows_service::service::{ServiceAccess, ServiceState::Stopped}; -use windows_service::service_manager::{ServiceManager, ServiceManagerAccess}; #[cfg(windows)] +use std::ffi::OsStr; use registry::{Data, Hive, Security}; +use windows_service::service::{ServiceAccess, ServiceState::Stopped}; +use windows_service::service_manager::{ServiceManager, ServiceManagerAccess}; #[tauri::command] pub fn run_program(path: String, args: Option) { @@ -262,6 +262,10 @@ pub fn start_service(service: String) -> bool { true } +#[cfg(unix)] +#[tauri::command] +pub fn start_service(service: String) -> bool {} + #[cfg(windows)] #[tauri::command] pub fn stop_service(service: String) -> bool { @@ -281,6 +285,10 @@ pub fn stop_service(service: String) -> bool { true } +#[cfg(unix)] +#[tauri::command] +pub fn stop_service(service: String) -> bool {} + #[cfg(unix)] #[tauri::command] pub fn wipe_registry(_exec_name: String) {}