Compare commits

...
Author SHA1 Message Date
zhom bf5b2886f5 build: blind windows ci build fixes 2025-06-09 15:01:10 +04:00
2 changed files with 44 additions and 54 deletions
+3 -3
View File
@@ -642,12 +642,12 @@ mod windows {
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { ) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
// On Windows, TOR and Mullvad browsers can sometimes accept URLs via command line // On Windows, TOR and Mullvad browsers can sometimes accept URLs via command line
// even with -no-remote, by launching a new instance that hands off to existing one // even with -no-remote, by launching a new instance that hands off to existing one
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))?;
let mut cmd = Command::new(executable_path); let mut cmd = Command::new(&executable_path);
cmd.args(["-profile", &profile.profile_path, url]); cmd.args(["-profile", &profile.profile_path, url]);
// Set working directory // Set working directory
@@ -704,7 +704,7 @@ mod windows {
if !output.status.success() { if !output.status.success() {
// Try fallback without --new-window // Try fallback without --new-window
let mut fallback_cmd = Command::new(executable_path); let mut fallback_cmd = Command::new(&executable_path);
fallback_cmd.args([&format!("--user-data-dir={}", profile.profile_path), url]); fallback_cmd.args([&format!("--user-data-dir={}", profile.profile_path), url]);
if let Some(parent_dir) = browser_dir if let Some(parent_dir) = browser_dir
+41 -51
View File
@@ -84,17 +84,15 @@ impl ProfileImporter {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
// Primary location in AppData\Roaming // Primary location in AppData\Roaming
if let Some(app_data) = self.base_dirs.data_dir() { let app_data = self.base_dirs.data_dir();
let firefox_dir = app_data.join("Mozilla/Firefox/Profiles"); let firefox_dir = app_data.join("Mozilla/Firefox/Profiles");
profiles.extend(self.scan_firefox_profiles_dir(&firefox_dir, "firefox")?); profiles.extend(self.scan_firefox_profiles_dir(&firefox_dir, "firefox")?);
}
// Also check AppData\Local for portable installations // Also check AppData\Local for portable installations
if let Some(local_app_data) = self.base_dirs.data_local_dir() { let local_app_data = self.base_dirs.data_local_dir();
let firefox_local_dir = local_app_data.join("Mozilla/Firefox/Profiles"); let firefox_local_dir = local_app_data.join("Mozilla/Firefox/Profiles");
if firefox_local_dir.exists() { if firefox_local_dir.exists() {
profiles.extend(self.scan_firefox_profiles_dir(&firefox_local_dir, "firefox")?); profiles.extend(self.scan_firefox_profiles_dir(&firefox_local_dir, "firefox")?);
}
} }
} }
@@ -129,12 +127,11 @@ impl ProfileImporter {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
if let Some(app_data) = self.base_dirs.data_dir() { let app_data = self.base_dirs.data_dir();
// Firefox Developer Edition on Windows typically uses separate directories // Firefox Developer Edition on Windows typically uses separate directories
let firefox_dev_dir = app_data.join("Mozilla/Firefox Developer Edition/Profiles"); let firefox_dev_dir = app_data.join("Mozilla/Firefox Developer Edition/Profiles");
if firefox_dev_dir.exists() { if firefox_dev_dir.exists() {
profiles.extend(self.scan_firefox_profiles_dir(&firefox_dev_dir, "firefox-developer")?); profiles.extend(self.scan_firefox_profiles_dir(&firefox_dev_dir, "firefox-developer")?);
}
} }
} }
@@ -168,10 +165,9 @@ impl ProfileImporter {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
if let Some(local_app_data) = self.base_dirs.data_local_dir() { let local_app_data = self.base_dirs.data_local_dir();
let chrome_dir = local_app_data.join("Google/Chrome/User Data"); let chrome_dir = local_app_data.join("Google/Chrome/User Data");
profiles.extend(self.scan_chrome_profiles_dir(&chrome_dir, "chromium")?); profiles.extend(self.scan_chrome_profiles_dir(&chrome_dir, "chromium")?);
}
} }
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
@@ -198,10 +194,9 @@ impl ProfileImporter {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
if let Some(local_app_data) = self.base_dirs.data_local_dir() { let local_app_data = self.base_dirs.data_local_dir();
let chromium_dir = local_app_data.join("Chromium/User Data"); let chromium_dir = local_app_data.join("Chromium/User Data");
profiles.extend(self.scan_chrome_profiles_dir(&chromium_dir, "chromium")?); profiles.extend(self.scan_chrome_profiles_dir(&chromium_dir, "chromium")?);
}
} }
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
@@ -228,10 +223,9 @@ impl ProfileImporter {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
if let Some(local_app_data) = self.base_dirs.data_local_dir() { let local_app_data = self.base_dirs.data_local_dir();
let brave_dir = local_app_data.join("BraveSoftware/Brave-Browser/User Data"); let brave_dir = local_app_data.join("BraveSoftware/Brave-Browser/User Data");
profiles.extend(self.scan_chrome_profiles_dir(&brave_dir, "brave")?); profiles.extend(self.scan_chrome_profiles_dir(&brave_dir, "brave")?);
}
} }
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
@@ -264,17 +258,15 @@ impl ProfileImporter {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
// Primary location in AppData\Roaming // Primary location in AppData\Roaming
if let Some(app_data) = self.base_dirs.data_dir() { let app_data = self.base_dirs.data_dir();
let mullvad_dir = app_data.join("MullvadBrowser/Profiles"); let mullvad_dir = app_data.join("MullvadBrowser/Profiles");
profiles.extend(self.scan_firefox_profiles_dir(&mullvad_dir, "mullvad-browser")?); profiles.extend(self.scan_firefox_profiles_dir(&mullvad_dir, "mullvad-browser")?);
}
// Also check common installation locations // Also check common installation locations
if let Some(local_app_data) = self.base_dirs.data_local_dir() { let local_app_data = self.base_dirs.data_local_dir();
let mullvad_local_dir = local_app_data.join("MullvadBrowser/Profiles"); let mullvad_local_dir = local_app_data.join("MullvadBrowser/Profiles");
if mullvad_local_dir.exists() { if mullvad_local_dir.exists() {
profiles.extend(self.scan_firefox_profiles_dir(&mullvad_local_dir, "mullvad-browser")?); profiles.extend(self.scan_firefox_profiles_dir(&mullvad_local_dir, "mullvad-browser")?);
}
} }
} }
@@ -304,10 +296,9 @@ impl ProfileImporter {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
if let Some(app_data) = self.base_dirs.data_dir() { let app_data = self.base_dirs.data_dir();
let zen_dir = app_data.join("Zen/Profiles"); let zen_dir = app_data.join("Zen/Profiles");
profiles.extend(self.scan_firefox_profiles_dir(&zen_dir, "zen")?); profiles.extend(self.scan_firefox_profiles_dir(&zen_dir, "zen")?);
}
} }
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
@@ -378,17 +369,16 @@ impl ProfileImporter {
} }
// Also check AppData directories if available // Also check AppData directories if available
if let Some(app_data) = self.base_dirs.data_dir() { let app_data = self.base_dirs.data_dir();
let tor_app_data = let tor_app_data =
app_data.join("TorBrowser/Browser/TorBrowser/Data/Browser/profile.default"); app_data.join("TorBrowser/Browser/TorBrowser/Data/Browser/profile.default");
if tor_app_data.exists() { if tor_app_data.exists() {
profiles.push(DetectedProfile { profiles.push(DetectedProfile {
browser: "tor-browser".to_string(), browser: "tor-browser".to_string(),
name: "TOR Browser - AppData Profile".to_string(), name: "TOR Browser - AppData Profile".to_string(),
path: tor_app_data.to_string_lossy().to_string(), path: tor_app_data.to_string_lossy().to_string(),
description: "TOR Browser profile from AppData".to_string(), description: "TOR Browser profile from AppData".to_string(),
}); });
}
} }
} }