From 1b3c84b0c78ea438c8f446054af196c620d30602 Mon Sep 17 00:00:00 2001 From: "Begonia, HE" <163421589+BegoniaHe@users.noreply.github.com> Date: Thu, 15 Jan 2026 04:24:14 +0100 Subject: fix: change Java installation path to use Tauri app handle for directory access --- src-tauri/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src-tauri/src/main.rs') diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 2632924..a2b8c6c 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -848,8 +848,8 @@ async fn refresh_account( /// Detect Java installations on the system #[tauri::command] -async fn detect_java() -> Result, String> { - Ok(core::java::detect_all_java_installations()) +async fn detect_java(app_handle: tauri::AppHandle) -> Result, String> { + Ok(core::java::detect_all_java_installations(&app_handle)) } /// Get recommended Java for a specific Minecraft version @@ -876,6 +876,7 @@ async fn fetch_adoptium_java( /// Download and install Adoptium Java #[tauri::command] async fn download_adoptium_java( + app_handle: tauri::AppHandle, major_version: u32, image_type: String, custom_path: Option, @@ -885,7 +886,7 @@ async fn download_adoptium_java( _ => core::java::ImageType::Jre, }; let path = custom_path.map(std::path::PathBuf::from); - core::java::download_and_install_java(major_version, img_type, path).await + core::java::download_and_install_java(&app_handle, major_version, img_type, path).await } /// Get available Adoptium Java versions -- cgit v1.2.3-70-g09d2