diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 68fdf41..7e83178 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -39,17 +39,26 @@ pub fn run() { tauri::async_runtime::spawn(async move { let mut candidates: Vec = Vec::new(); - // Add current working directory + // Add current working directory (where the executable is launched from) if let Ok(cwd) = std::env::current_dir() { - log::info!("🔍 Searching in current working directory: {}", cwd.display()); + log::info!("🔍 Searching in launch directory: {}", cwd.display()); candidates.push(cwd.join("video.mp4")); candidates.push(cwd.join("public").join("video.mp4")); } - // Add executable directory and its ancestors + // Also check the directory from which the executable is located + if let Ok(exe_path) = std::env::current_exe() { + if let Some(exe_dir) = exe_path.parent() { + log::info!("🔍 Searching in executable directory: {}", exe_dir.display()); + candidates.insert(0, exe_dir.join("video.mp4")); + candidates.insert(1, exe_dir.join("public").join("video.mp4")); + } + } + + // Add ancestor directories (but skip the immediate parent since we already added it) if let Ok(exe_path) = std::env::current_exe() { log::info!("📁 Executable path: {}", exe_path.display()); - let mut ancestor_opt = exe_path.parent(); + let mut ancestor_opt = exe_path.parent().and_then(|p| p.parent()); let mut steps = 0; while let Some(dir) = ancestor_opt { log::info!("🔍 Searching in ancestor directory: {}", dir.display()); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6290d86..5f162c4 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -44,7 +44,7 @@ "minWidth": 375, "minHeight": 812, "resizable": true, - "fullscreen": false + "fullscreen": true } ], "security": {