Skip to content

Commit

Permalink
fix automatic install path, #BUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
unitycoder committed Sep 16, 2024
1 parent 2bda48b commit 5954f47
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions UnityLauncherPro/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,14 @@ public static bool VersionIsAlpha(string version)

public static bool VersionIsChinese(string version)
{
return version.Contains("c1");
return version.Contains("c1");
}


//as of 21 May 2021, only final 'f' versions are now available on the alpha release notes for Unity 2018 and newer. 2017 and 5 still have patch 'p' versions as well.
public static bool HasAlphaReleaseNotes(string version) => VersionIsArchived(version) || VersionIsPatch(version);

public static string GetAlphaReleaseNotesURL(string fromVersion, string toVersion = null)
public static string GetAlphaReleaseNotesURL(string fromVersion, string toVersion = null)
=> "https://alpha.release-notes.ds.unity3d.com/search?fromVersion=" + fromVersion + "&toVersion=" + (toVersion != null ? toVersion : fromVersion);

// open release notes page in browser
Expand All @@ -606,7 +606,7 @@ public static bool OpenReleaseNotes(string version)
bool result = false;
if (string.IsNullOrEmpty(version)) return false;
string url = null;
if(Properties.Settings.Default.useAlphaReleaseNotes && HasAlphaReleaseNotes(version))
if (Properties.Settings.Default.useAlphaReleaseNotes && HasAlphaReleaseNotes(version))
{
url = GetAlphaReleaseNotesURL(version);
}
Expand Down Expand Up @@ -644,8 +644,8 @@ public static bool OpenReleaseNotes_Cumulative(string version)
if (nextFinalVersionAfterInstalled != null) comparisonVersion = nextFinalVersionAfterInstalled;

}
url = GetAlphaReleaseNotesURL(comparisonVersion,version);
url = GetAlphaReleaseNotesURL(comparisonVersion, version);

OpenURL(url);
result = true;
return result;
Expand Down Expand Up @@ -695,8 +695,10 @@ public static void DownloadAndInstall(string url, string version)
// get base version, to use for install path
// FIXME check if have any paths?
string lastRootFolder = Properties.Settings.Default.rootFolders[Properties.Settings.Default.rootFolders.Count - 1];

// check if ends with / or \
if (lastRootFolder.EndsWith("/") == false && lastRootFolder.EndsWith("\\") == false) lastRootFolder += "/";
if (lastRootFolder.EndsWith("/") == false && lastRootFolder.EndsWith("\\") == false) lastRootFolder += "\\";

string outputVersionFolder = version.Split('.')[0] + "_" + version.Split('.')[1];
string targetPathArgs = " /D=" + lastRootFolder + outputVersionFolder; ;

Expand Down

0 comments on commit 5954f47

Please sign in to comment.