diff --git a/src/Ryujinx.Common/Configuration/AppDataManager.cs b/src/Ryujinx.Common/Configuration/AppDataManager.cs index d6e77843..b685e706 100644 --- a/src/Ryujinx.Common/Configuration/AppDataManager.cs +++ b/src/Ryujinx.Common/Configuration/AppDataManager.cs @@ -96,7 +96,7 @@ namespace Ryujinx.Common.Configuration if (OperatingSystem.IsMacOS() && Mode == LaunchMode.UserProfile) { string oldConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), DefaultBaseDir); - if (Path.Exists(oldConfigPath) && !Path.Exists(BaseDirPath)) + if (Path.Exists(oldConfigPath) && !IsPathSymlink(oldConfigPath) && !Path.Exists(BaseDirPath)) { CopyDirectory(oldConfigPath, BaseDirPath); Directory.Delete(oldConfigPath, true); @@ -115,6 +115,14 @@ namespace Ryujinx.Common.Configuration Directory.CreateDirectory(KeysDirPath = Path.Combine(BaseDirPath, KeysDir)); } + // Check if existing old baseDirPath is a symlink, to prevent possible errors. + // Should be removed, when the existance of the old directory isn't checked anymore. + private static bool IsPathSymlink(string path) + { + FileAttributes attributes = File.GetAttributes(path); + return (attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint; + } + private static void CopyDirectory(string sourceDir, string destinationDir) { var dir = new DirectoryInfo(sourceDir);