Fix launcher thinking patchdata clone is valid

pull/29/head
Miepee 5 years ago
parent 07678b8b9e
commit 646db17c94

@ -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<ProfileXML>(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);

@ -26,7 +26,8 @@ namespace AM2RLauncher
/// <returns><see langword="true"/> if yes, <see langword="false"/> if not.</returns>
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");
}
/// <summary>

Loading…
Cancel
Save