diff --git a/rust/crates/clean_flash_common/src/native_host.rs b/rust/crates/clean_flash_common/src/native_host.rs index 2e0003c..e2102cd 100644 --- a/rust/crates/clean_flash_common/src/native_host.rs +++ b/rust/crates/clean_flash_common/src/native_host.rs @@ -116,14 +116,21 @@ pub fn get_native_host_install_dir() -> PathBuf { #[cfg(not(windows))] pub fn get_native_host_install_dir() -> PathBuf { if cfg!(target_os = "macos") { - PathBuf::from("/Library/Application Support/Clean Flash") - } else { + // Install to ~/Library/Application Support/Clean Flash instead + if let Ok(home) = std::env::var("HOME") { + PathBuf::from(home).join("Library/Application Support/Clean Flash") + } else { + PathBuf::from("/Library/Application Support/Clean Flash") + } + } else if cfg!(target_os = "linux") { // Linux if let Ok(home) = std::env::var("HOME") { PathBuf::from(home).join(".cleanflash") } else { PathBuf::from("/tmp/.cleanflash") } + } else { + unreachable!() } } @@ -178,6 +185,11 @@ fn get_non_windows_browser_targets(home: &Path) -> Vec { manifest_dir: home.join("Library/Application Support/Mozilla/NativeMessagingHosts"), kind: BrowserKind::Firefox, }, + BrowserManifestTarget { + detect_path: home.join("Library/Application Support/net.imput.helium"), + manifest_dir: home.join("Library/Application Support/net.imput.helium/NativeMessagingHosts"), + kind: BrowserKind::ChromeLike, + } ] } else { vec![ @@ -211,11 +223,16 @@ fn get_non_windows_browser_targets(home: &Path) -> Vec { manifest_dir: home.join(".config/arc/NativeMessagingHosts"), kind: BrowserKind::ChromeLike, }, + BrowserManifestTarget { + detect_path: home.join(".config/net.imput.helium"), + manifest_dir: home.join(".config/net.imput.helium/NativeMessagingHosts"), + kind: BrowserKind::ChromeLike, + }, BrowserManifestTarget { detect_path: home.join(".mozilla"), manifest_dir: home.join(".mozilla/native-messaging-hosts"), kind: BrowserKind::Firefox, - }, + } ] } } diff --git a/rust/crates/clean_flash_installer/src/installer_linux.rs b/rust/crates/clean_flash_installer/src/installer_linux.rs index e9dd933..83fc2b3 100644 --- a/rust/crates/clean_flash_installer/src/installer_linux.rs +++ b/rust/crates/clean_flash_installer/src/installer_linux.rs @@ -88,7 +88,10 @@ pub fn install( return Ok(()); } - let archive_bytes: &[u8] = include_bytes!("../cleanflash.7z"); + #[cfg(target_os = "linux")] + let archive_bytes: &[u8] = include_bytes!("../cleanflash-linux.7z"); + #[cfg(target_os = "macos")] + let archive_bytes: &[u8] = include_bytes!("../cleanflash-macos.7z"); if archive_bytes.is_empty() { return Ok(()); diff --git a/rust/crates/clean_flash_installer/src/installer_windows.rs b/rust/crates/clean_flash_installer/src/installer_windows.rs index 16bec64..9da33bc 100644 --- a/rust/crates/clean_flash_installer/src/installer_windows.rs +++ b/rust/crates/clean_flash_installer/src/installer_windows.rs @@ -399,7 +399,7 @@ pub fn install( // The 7z archive is embedded in the binary via include_bytes!. // For the port, we expect it at a known resource path; if not present, // this is a no-op placeholder. - let archive_bytes: &[u8] = include_bytes!("../cleanflash.7z"); + let archive_bytes: &[u8] = include_bytes!("../cleanflash-win.7z"); if archive_bytes.is_empty() { // Nothing to extract; still apply the rest of the steps.