From bbc12bcc03e4d3f5b89bd080fe4537d81df779c6 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:25:22 +0400 Subject: [PATCH] fix: blind windows ci build fixes --- src-tauri/src/browser_runner.rs | 10 +++++++--- src-tauri/src/default_browser.rs | 1 - src-tauri/src/extraction.rs | 4 ---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src-tauri/src/browser_runner.rs b/src-tauri/src/browser_runner.rs index 5955393..25d1896 100644 --- a/src-tauri/src/browser_runner.rs +++ b/src-tauri/src/browser_runner.rs @@ -3,7 +3,6 @@ use directories::BaseDirs; use serde::{Deserialize, Serialize}; use std::fs::{self, create_dir_all}; use std::path::{Path, PathBuf}; -use std::process::Command; use std::time::{SystemTime, UNIX_EPOCH}; use sysinfo::{Pid, System}; use tauri::Emitter; @@ -35,6 +34,7 @@ pub struct BrowserProfile { mod macos { use super::*; use std::ffi::OsString; + use std::process::Command; pub fn is_tor_or_mullvad_browser(exe_name: &str, cmd: &[OsString], browser_type: &str) -> bool { match browser_type { @@ -605,7 +605,10 @@ mod windows { if !output.status.success() { // Fallback: try without -requestPending - let mut fallback_cmd = Command::new(browser.get_executable_path(browser_dir)?); + let executable_path = browser + .get_executable_path(browser_dir) + .map_err(|e| format!("Failed to get executable path: {}", e))?; + let mut fallback_cmd = Command::new(executable_path); fallback_cmd.args(["-profile", &profile.profile_path, "-new-tab", url]); if let Some(parent_dir) = browser_dir @@ -677,7 +680,7 @@ mod windows { browser_type: BrowserType, browser_dir: &Path, ) -> Result<(), Box> { - let browser = create_browser(browser_type); + let browser = create_browser(browser_type.clone()); let executable_path = browser .get_executable_path(browser_dir) .map_err(|e| format!("Failed to get executable path: {}", e))?; @@ -772,6 +775,7 @@ mod windows { mod linux { use super::*; use std::ffi::OsString; + use std::process::Command; pub fn is_tor_or_mullvad_browser( _exe_name: &str, diff --git a/src-tauri/src/default_browser.rs b/src-tauri/src/default_browser.rs index 99854e4..b44eee3 100644 --- a/src-tauri/src/default_browser.rs +++ b/src-tauri/src/default_browser.rs @@ -305,7 +305,6 @@ mod windows { // This helps refresh the system's understanding of the changes unsafe { use std::ffi::c_void; - use std::ptr; // Declare the Windows API functions type UINT = u32; diff --git a/src-tauri/src/extraction.rs b/src-tauri/src/extraction.rs index 0a29a79..4297e1c 100644 --- a/src-tauri/src/extraction.rs +++ b/src-tauri/src/extraction.rs @@ -453,8 +453,6 @@ impl Extractor { zip_path: &Path, dest_dir: &Path, ) -> Result> { - use std::io::Read; - println!("Extracting ZIP archive on Windows: {}", zip_path.display()); // Create destination directory if it doesn't exist @@ -500,8 +498,6 @@ impl Extractor { zip_path: &Path, dest_dir: &Path, ) -> Result> { - use std::io::Read; - println!("Using Rust zip crate for extraction (Windows 7+ compatibility)"); let file = fs::File::open(zip_path)?;