From 8c34745e2f2ecf5df3dbd4ad30f54d1349d79b0c Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Sun, 29 Dec 2024 10:40:14 +0000 Subject: [PATCH] Also check that `portable` is a directory --- src/gui/CemuApp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/CemuApp.cpp b/src/gui/CemuApp.cpp index 2f06629f..c3606292 100644 --- a/src/gui/CemuApp.cpp +++ b/src/gui/CemuApp.cpp @@ -89,7 +89,7 @@ void CemuApp::DeterminePaths(std::set& failedWriteAccess) // for Windo fs::path portablePath = exePath.parent_path() / "portable"; data_path = exePath.parent_path(); // the data path is always the same as the exe path #ifdef CEMU_ALLOW_PORTABLE - if (fs::exists(portablePath, ec)) + if (fs::is_directory(portablePath, ec)) { isPortable = true; user_data_path = config_path = cache_path = portablePath; @@ -132,7 +132,7 @@ void CemuApp::DeterminePaths(std::set& failedWriteAccess) // for Linux portablePath = exePath.parent_path() / "portable"; } #ifdef CEMU_ALLOW_PORTABLE - if (fs::exists(portablePath, ec)) + if (fs::is_directory(portablePath, ec)) { isPortable = true; user_data_path = config_path = cache_path = portablePath; @@ -174,8 +174,8 @@ void CemuApp::DeterminePaths(std::set& failedWriteAccess) // for MacOS // If run from an app bundle, use its parent directory fs::path appPath = exePath.parent_path().parent_path().parent_path(); fs::path portablePath = appPath.extension() == ".app" ? appPath.parent_path() / "portable" : exePath.parent_path() / "portable"; - #ifdef CEMU_ALLOW_PORTABLE - if (fs::exists(portablePath, ec)) +#ifdef CEMU_ALLOW_PORTABLE + if (fs::is_directory(portablePath, ec)) { isPortable = true; user_data_path = config_path = cache_path = portablePath;