diff --git a/src-tauri/src/binary_manager.rs b/src-tauri/src/binary_manager.rs index 5ac487b..ba05233 100644 --- a/src-tauri/src/binary_manager.rs +++ b/src-tauri/src/binary_manager.rs @@ -204,22 +204,31 @@ pub async fn download_qjs(app: &AppHandle) -> Result { let source_name = get_qjs_source_name_in_zip(); let target_name = get_qjs_binary_name(); // quickjs.exe or quickjs - let mut found = false; + let mut found_exe = false; for i in 0..archive.len() { let mut file = archive.by_index(i)?; // Filenames in zip might be like "quickjs-win-x86_64-2024-01-13/qjs.exe" - let name = file.name(); + let name = file.name().to_string(); + + // Skip directories + if file.is_dir() { + continue; + } + let filename_only = name.split('/').last().unwrap_or(""); if filename_only == source_name { let mut out_file = fs::File::create(bin_dir.join(target_name))?; std::io::copy(&mut file, &mut out_file)?; - found = true; - break; + found_exe = true; + } else if filename_only.ends_with(".dll") { + // Extract DLLs (needed for Windows MinGW builds, e.g. libwinpthread-1.dll) + let mut out_file = fs::File::create(bin_dir.join(filename_only))?; + std::io::copy(&mut file, &mut out_file)?; } } - if !found { + if !found_exe { return Err(anyhow!("在下载的压缩包中找不到 {}", source_name)); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index ccd2dd7..ea992e6 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -12,7 +12,7 @@ "app": { "windows": [ { - "title": "Stream Capture", + "title": "流萤 - 视频下载", "width": 1300, "height": 850 } diff --git a/src/App.vue b/src/App.vue index 1deb4d7..0555b7e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,7 +23,7 @@ onMounted(async () => {