mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +01:00
Fix unix build
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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<String>) {
|
||||
@@ -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) {}
|
||||
|
||||
Reference in New Issue
Block a user