From 680fa9fd27c8b76c6afdb18285a987864059de2e Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sun, 6 Feb 2022 09:25:01 +0100 Subject: [PATCH] Make mac profile installation not crash --- AM2RLauncher/AM2RLauncherCore/Profile.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AM2RLauncher/AM2RLauncherCore/Profile.cs b/AM2RLauncher/AM2RLauncherCore/Profile.cs index e897e92..9118f42 100644 --- a/AM2RLauncher/AM2RLauncherCore/Profile.cs +++ b/AM2RLauncher/AM2RLauncherCore/Profile.cs @@ -308,8 +308,9 @@ public static class Profile foreach (var file in new DirectoryInfo(profilePath).GetFiles()) if (file.Name.EndsWith(".ogg") && !File.Exists(file.DirectoryName + "/" + file.Name.ToLower())) File.Move(file.FullName, file.DirectoryName + "/" + file.Name.ToLower()); - // Loading custom fonts crashes on Mac, so we delete those - Directory.Delete(profilePath + "/lang/fonts", true); + // Loading custom fonts crashes on Mac, so we delete those if they exist + if (Directory.Exists(profilePath + "/lang/fonts")) + Directory.Delete(profilePath + "/lang/fonts", true); // Move Frameworks, Info.plist and PkgInfo over HelperMethods.DirectoryCopy(CrossPlatformOperations.CURRENTPATH + "/PatchData/data/Frameworks", profilePath.Replace("Resources", "Frameworks")); File.Copy(dataPath + "/Info.plist", profilePath.Replace("Resources", "") + "/Info.plist", true); @@ -701,4 +702,4 @@ public static class Profile log.Info("AM2R_11 check successful!"); return IsZipAM2R11ReturnCodes.Successful; } -} \ No newline at end of file +}