Fix unix build

This commit is contained in:
Thoronium
2023-04-26 15:17:27 -06:00
parent 5374e2b0b9
commit 17fed553da
2 changed files with 13 additions and 3 deletions

View File

@@ -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();

View File

@@ -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) {}