fix(core): block the wizard if app has been translocated on macOS. Fix #844
This commit is contained in:
parent
fcc0a4ee50
commit
93ce220b62
|
@ -72,7 +72,7 @@ fn launcher_main(args: CliModuleArgs) -> i32 {
|
|||
|
||||
let is_welcome_page_enabled = !preferences.has_completed_wizard();
|
||||
|
||||
let is_move_bundle_page_enabled = false; // TODO
|
||||
let is_move_bundle_page_enabled = crate::cli::util::is_subject_to_app_translocation_on_macos();
|
||||
|
||||
let is_legacy_version_page_enabled = util::is_legacy_version_running(&paths.runtime);
|
||||
let runtime_dir_clone = paths.runtime.clone();
|
||||
|
|
|
@ -69,3 +69,17 @@ pub fn prevent_running_as_root_on_macos() {
|
|||
pub fn prevent_running_as_root_on_macos() {
|
||||
// Do nothing on other platforms
|
||||
}
|
||||
|
||||
// This is needed to make sure the app is NOT subject to "App Translocation" on
|
||||
// macOS, which would make Espanso misbehave on some circumstances.
|
||||
// For more information, see: https://github.com/federico-terzi/espanso/issues/844
|
||||
pub fn is_subject_to_app_translocation_on_macos() -> bool {
|
||||
if !cfg!(target_os = "macos") {
|
||||
return false;
|
||||
}
|
||||
|
||||
let exec_path = std::env::current_exe().expect("unable to extract executable path");
|
||||
let exec_path = exec_path.to_string_lossy();
|
||||
|
||||
exec_path.contains("/private/")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user