Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Commit 610e961

Browse files
committed
fix release note urls, add unity to list even without uninstaller.exe (but missing version info)
1 parent e31a364 commit 610e961

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

UnityLauncher/Form1.cs

+17
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,23 @@ bool ScanUnityInstallations()
242242
}
243243
} // have unity.exe
244244
} // have uninstaller.exe
245+
else // no uninstaller, probably preview builds
246+
{
247+
var unityExe = Path.Combine(directories[i], "Editor", "Unity.exe");
248+
if (File.Exists(unityExe) == true)
249+
{
250+
// get full version number from uninstaller
251+
var unityVersion = Tools.GetFileVersionData(unityExe).Replace("Unity", "").Trim();
252+
if (unityList.ContainsKey(unityVersion) == false)
253+
{
254+
unityList.Add(unityVersion, unityExe);
255+
var dataFolder = Path.Combine(directories[i], "Editor", "Data");
256+
DateTime? installDate = Tools.GetLastModifiedTime(dataFolder);
257+
// TODO add platforms: PC|iOS|tvOS|Android|UWP|WebGL|Facebook|XBox|PSVita|PS4
258+
gridUnityList.Rows.Add(unityVersion, unityExe, installDate);
259+
}
260+
} // have unity.exe
261+
}
245262
} // got folders
246263
} // failed check
247264
} // all root folders

UnityLauncher/Tools.cs

+9-4
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,14 @@ public static string GetUnityReleaseURL(string version)
183183
if (version.Contains("f")) // archived
184184
{
185185
version = Regex.Replace(version, @"f.", "", RegexOptions.IgnoreCase);
186-
string padding = "";
187-
if (version.Contains("2018.2")) padding = "";
188-
url = "https://unity3d.com/unity/whats-new/" + padding + version;
186+
string padding = "unity-";
187+
string whatsnew = "whats-new";
188+
if (version.Contains("5.6")) padding = "";
189+
if (version.Contains("2017.1")) whatsnew = "whatsnew";
190+
if (version.Contains("2017.4")) padding = "";
191+
if (version.Contains("2018")) padding = "";
192+
if (version.Contains("2019")) padding = "";
193+
url = "https://unity3d.com/unity/"+ whatsnew +"/" + padding + version;
189194
}
190195
else
191196
if (version.Contains("p")) // patch version
@@ -358,9 +363,9 @@ public static string GetProjectVersion(string path)
358363
/// <returns></returns>
359364
public static string GetFileVersionData(string path)
360365
{
361-
// TODO check if path exists
362366
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(path);
363367
return fvi.ProductName.Replace("(64-bit)", "").Trim();
368+
//return fvi.FileVersion.Replace("(64-bit)", "").Trim();
364369
}
365370

366371
/// <summary>

0 commit comments

Comments
 (0)