From 646db17c944436edbcb65fa818f439e5eab3939d Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Sun, 14 Nov 2021 11:05:57 +0100 Subject: [PATCH] Fix launcher thinking patchdata clone is valid --- AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs | 3 +-- AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs index 85a4baa..f6d5002 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs @@ -103,7 +103,7 @@ namespace AM2RLauncher // Handling for updates - if current version does not match PatchData version, rename folder so that we attempt to install! // Also, add a non-installable profile for it so people can access the older version or delete it from the mod manager. - if (IsProfileInstalled(profileList[0])) + if (profileList.Count > 0 && IsProfileInstalled(profileList[0])) { ProfileXML currentXML = Serializer.Deserialize(File.ReadAllText(CrossPlatformOperations.CURRENTPATH + "/Profiles/Community Updates (Latest)/profile.xml")); @@ -333,7 +333,6 @@ namespace AM2RLauncher #region Install case UpdateState.Install: - progressBar.Visible = true; progressBar.Value = 0; SetPlayButtonState(UpdateState.Installing); diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs index fd1c9c4..9bfab98 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Methods.cs @@ -26,7 +26,8 @@ namespace AM2RLauncher /// if yes, if not. private bool IsPatchDataCloned() { - return Repository.IsValid(CrossPlatformOperations.CURRENTPATH + "/PatchData"); + //isValid seems to only check for a .git folder, and there are cases where that exists, but not the profile.xml + return Repository.IsValid(CrossPlatformOperations.CURRENTPATH + "/PatchData") && File.Exists(CrossPlatformOperations.CURRENTPATH + "/PatchData/profile.xml"); } ///