Skip to content

Commit

Permalink
backend: omit registry stuff on linux/macos
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser committed Feb 10, 2024
1 parent 364ccd5 commit 9358b38
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src-tauri/src/commands/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ use crate::{config::LauncherConfig, util::file::delete_dir};
use semver::Version;
use sysinfo::Disks;
use tauri::Manager;
use winreg::{
enums::{HKEY_LOCAL_MACHINE, KEY_READ},
RegKey,
};

use super::CommandError;

Expand Down Expand Up @@ -117,10 +113,15 @@ pub async fn is_diskspace_requirement_met(
));
}

#[cfg(target_os = "windows")]
#[tauri::command]
pub async fn is_vcc_runtime_installed(
_config: tauri::State<'_, tokio::sync::Mutex<LauncherConfig>>,
) -> Result<bool, CommandError> {
use winreg::{
enums::{HKEY_LOCAL_MACHINE, KEY_READ},
RegKey,
};
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
let path = r"SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64";

Expand All @@ -137,6 +138,22 @@ pub async fn is_vcc_runtime_installed(
));
}

#[cfg(target_os = "linux")]
#[tauri::command]
pub async fn is_vcc_runtime_installed(
_config: tauri::State<'_, tokio::sync::Mutex<LauncherConfig>>,
) -> Result<bool, CommandError> {
return Ok(false);
}

#[cfg(target_os = "macos")]
#[tauri::command]
pub async fn is_vcc_runtime_installed(
_config: tauri::State<'_, tokio::sync::Mutex<LauncherConfig>>,
) -> Result<bool, CommandError> {
return Ok(false);
}

#[tauri::command]
pub async fn is_avx_requirement_met(
config: tauri::State<'_, tokio::sync::Mutex<LauncherConfig>>,
Expand Down

0 comments on commit 9358b38

Please sign in to comment.