fix: Returns a warning instead of panicking if an AppImage is not mounted, closes #7736 (#7843)

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
This commit is contained in:
Benjamin Demetz 2023-09-28 15:22:11 +02:00 committed by GitHub
parent 228e5a4c76
commit 1bce7397a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch:bug
---
Fix the validation of `std::env::current_exe` warn the user if AppImage is not mounted instead of panicking

View File

@ -38,6 +38,7 @@ memchr = "2"
semver = "1" semver = "1"
infer = "0.12" infer = "0.12"
dunce = "1" dunce = "1"
log = "0.4.20"
[target."cfg(target_os = \"linux\")".dependencies] [target."cfg(target_os = \"linux\")".dependencies]
heck = "0.4" heck = "0.4"

View File

@ -22,6 +22,8 @@ use std::{
use semver::Version; use semver::Version;
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
use log::warn;
pub mod assets; pub mod assets;
pub mod config; pub mod config;
pub mod html; pub mod html;
@ -306,7 +308,7 @@ impl Default for Env {
.unwrap_or(true); .unwrap_or(true);
if !is_temp { if !is_temp {
panic!("`APPDIR` or `APPIMAGE` environment variable found but this application was not detected as an AppImage; this might be a security issue."); warn!("`APPDIR` or `APPIMAGE` environment variable found but this application was not detected as an AppImage; this might be a security issue.");
} }
} }
env env