2020-01-23 00:21:03 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2016-11-13 00:49:03 +00:00
|
|
|
using System.IO;
|
2020-02-26 21:33:50 +00:00
|
|
|
using System.Reflection;
|
2016-11-13 00:49:03 +00:00
|
|
|
|
2017-04-27 16:30:22 +00:00
|
|
|
internal static class VersionInfo
|
2012-11-02 05:33:33 +00:00
|
|
|
{
|
2019-01-05 20:08:10 +00:00
|
|
|
// keep this updated at every major release
|
2020-02-26 21:33:50 +00:00
|
|
|
public const string MainVersion = "2.4.0"; // Use numbers only or the new version notification won't work
|
|
|
|
public const string ReleaseDate = "January 18, 2020";
|
|
|
|
public const string HomePage = "http://tasvideos.org/BizHawk.html";
|
2019-10-27 15:35:29 +00:00
|
|
|
public static readonly bool DeveloperBuild = true;
|
2013-11-10 02:55:11 +00:00
|
|
|
|
2016-11-13 00:49:03 +00:00
|
|
|
public static readonly string CustomBuildString;
|
|
|
|
|
2013-11-15 14:14:24 +00:00
|
|
|
public static string GetEmuVersion()
|
2013-11-10 02:55:11 +00:00
|
|
|
{
|
2020-02-26 21:33:50 +00:00
|
|
|
return DeveloperBuild
|
|
|
|
? "GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH
|
|
|
|
: "Version " + MainVersion;
|
2013-11-10 02:55:11 +00:00
|
|
|
}
|
2016-11-13 00:49:03 +00:00
|
|
|
|
|
|
|
static VersionInfo()
|
|
|
|
{
|
2017-04-24 12:41:55 +00:00
|
|
|
string path = Path.Combine(GetExeDirectoryAbsolute(), "dll");
|
|
|
|
path = Path.Combine(path, "custombuild.txt");
|
|
|
|
if (File.Exists(path))
|
2016-11-13 00:49:03 +00:00
|
|
|
{
|
|
|
|
var lines = File.ReadAllLines(path);
|
|
|
|
if (lines.Length > 0)
|
2017-04-27 16:30:22 +00:00
|
|
|
{
|
2016-11-13 00:49:03 +00:00
|
|
|
CustomBuildString = lines[0];
|
2017-04-27 16:30:22 +00:00
|
|
|
}
|
2016-11-13 00:49:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-12 21:05:06 +00:00
|
|
|
// code copied to avoid depending on code in other projects
|
2017-04-27 16:30:22 +00:00
|
|
|
private static string GetExeDirectoryAbsolute()
|
2016-11-13 00:49:03 +00:00
|
|
|
{
|
2020-02-26 21:33:50 +00:00
|
|
|
var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? "";
|
2016-11-13 00:49:03 +00:00
|
|
|
if (path.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
2017-04-27 16:30:22 +00:00
|
|
|
{
|
2016-11-13 00:49:03 +00:00
|
|
|
path = path.Remove(path.Length - 1, 1);
|
2017-04-27 16:30:22 +00:00
|
|
|
}
|
2016-11-13 00:49:03 +00:00
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
2015-12-20 20:44:50 +00:00
|
|
|
}
|