mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-07-25 13:50:51 +02:00
fix: blind windows ci build fixes
This commit is contained in:
@@ -3,7 +3,6 @@ use directories::BaseDirs;
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fs::{self, create_dir_all};
|
use std::fs::{self, create_dir_all};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::Command;
|
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
use sysinfo::{Pid, System};
|
use sysinfo::{Pid, System};
|
||||||
use tauri::Emitter;
|
use tauri::Emitter;
|
||||||
@@ -35,6 +34,7 @@ pub struct BrowserProfile {
|
|||||||
mod macos {
|
mod macos {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
pub fn is_tor_or_mullvad_browser(exe_name: &str, cmd: &[OsString], browser_type: &str) -> bool {
|
pub fn is_tor_or_mullvad_browser(exe_name: &str, cmd: &[OsString], browser_type: &str) -> bool {
|
||||||
match browser_type {
|
match browser_type {
|
||||||
@@ -605,7 +605,10 @@ mod windows {
|
|||||||
|
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
// Fallback: try without -requestPending
|
// 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]);
|
fallback_cmd.args(["-profile", &profile.profile_path, "-new-tab", url]);
|
||||||
|
|
||||||
if let Some(parent_dir) = browser_dir
|
if let Some(parent_dir) = browser_dir
|
||||||
@@ -677,7 +680,7 @@ mod windows {
|
|||||||
browser_type: BrowserType,
|
browser_type: BrowserType,
|
||||||
browser_dir: &Path,
|
browser_dir: &Path,
|
||||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
let browser = create_browser(browser_type);
|
let browser = create_browser(browser_type.clone());
|
||||||
let executable_path = browser
|
let executable_path = browser
|
||||||
.get_executable_path(browser_dir)
|
.get_executable_path(browser_dir)
|
||||||
.map_err(|e| format!("Failed to get executable path: {}", e))?;
|
.map_err(|e| format!("Failed to get executable path: {}", e))?;
|
||||||
@@ -772,6 +775,7 @@ mod windows {
|
|||||||
mod linux {
|
mod linux {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
pub fn is_tor_or_mullvad_browser(
|
pub fn is_tor_or_mullvad_browser(
|
||||||
_exe_name: &str,
|
_exe_name: &str,
|
||||||
|
|||||||
@@ -305,7 +305,6 @@ mod windows {
|
|||||||
// This helps refresh the system's understanding of the changes
|
// This helps refresh the system's understanding of the changes
|
||||||
unsafe {
|
unsafe {
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
use std::ptr;
|
|
||||||
|
|
||||||
// Declare the Windows API functions
|
// Declare the Windows API functions
|
||||||
type UINT = u32;
|
type UINT = u32;
|
||||||
|
|||||||
@@ -453,8 +453,6 @@ impl Extractor {
|
|||||||
zip_path: &Path,
|
zip_path: &Path,
|
||||||
dest_dir: &Path,
|
dest_dir: &Path,
|
||||||
) -> Result<PathBuf, Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<PathBuf, Box<dyn std::error::Error + Send + Sync>> {
|
||||||
use std::io::Read;
|
|
||||||
|
|
||||||
println!("Extracting ZIP archive on Windows: {}", zip_path.display());
|
println!("Extracting ZIP archive on Windows: {}", zip_path.display());
|
||||||
|
|
||||||
// Create destination directory if it doesn't exist
|
// Create destination directory if it doesn't exist
|
||||||
@@ -500,8 +498,6 @@ impl Extractor {
|
|||||||
zip_path: &Path,
|
zip_path: &Path,
|
||||||
dest_dir: &Path,
|
dest_dir: &Path,
|
||||||
) -> Result<PathBuf, Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<PathBuf, Box<dyn std::error::Error + Send + Sync>> {
|
||||||
use std::io::Read;
|
|
||||||
|
|
||||||
println!("Using Rust zip crate for extraction (Windows 7+ compatibility)");
|
println!("Using Rust zip crate for extraction (Windows 7+ compatibility)");
|
||||||
|
|
||||||
let file = fs::File::open(zip_path)?;
|
let file = fs::File::open(zip_path)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user