From 9e6806bbc3b9f6ee81ae172cd9348fe91868b114 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 18 Jul 2023 13:16:41 +0200 Subject: feat: Add warning for Snap installations (#399) Prints a warning to console if snap installation of Steam is detected. --- src-tauri/src/northstar/install.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src-tauri/src') diff --git a/src-tauri/src/northstar/install.rs b/src-tauri/src/northstar/install.rs index 875458dd..c77fd538 100644 --- a/src-tauri/src/northstar/install.rs +++ b/src-tauri/src/northstar/install.rs @@ -168,6 +168,22 @@ pub fn find_game_install_location() -> Result { // Attempt parsing Steam library directly match steamlocate::SteamDir::locate() { Some(mut steamdir) => { + #[cfg(target_os = "linux")] + { + let snap_dir = match std::env::var("SNAP_USER_DATA") { + Ok(snap_dir) => std::path::PathBuf::from(snap_dir), + Err(_) => match dirs::home_dir() { + Some(path) => path, + None => std::path::PathBuf::new(), + } + .join("snap"), + }; + + if steamdir.path.starts_with(snap_dir) { + log::warn!("Found Steam installed via Snap, you may encounter issues"); + } + } + let titanfall2_steamid = TITANFALL2_STEAM_ID.parse().unwrap(); match steamdir.app(&titanfall2_steamid) { Some(app) => { -- cgit v1.2.3