BizHawk/Version/VersionInfo.cs

44 lines
1.2 KiB
C#
Raw Normal View History

using System.IO;
2017-04-27 16:30:22 +00:00
internal static class VersionInfo
{
// keep this updated at every major release
2019-06-18 16:43:06 +00:00
public const string Mainversion = "2.3.2"; // Use numbers only or the new version notification won't work
public static readonly string RELEASEDATE = "June 18, 2019";
2019-10-27 15:35:29 +00:00
public static readonly bool DeveloperBuild = true;
public static readonly string HomePage = "http://tasvideos.org/BizHawk.html";
public static readonly string CustomBuildString;
public static string GetEmuVersion()
{
2017-04-27 16:30:22 +00:00
return DeveloperBuild ? ("GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH) : ("Version " + Mainversion);
}
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))
{
var lines = File.ReadAllLines(path);
if (lines.Length > 0)
2017-04-27 16:30:22 +00:00
{
CustomBuildString = lines[0];
2017-04-27 16:30:22 +00:00
}
}
}
2017-04-27 16:30:22 +00:00
// code copied to avoid depending on code in otherp rojects
private static string GetExeDirectoryAbsolute()
{
var path = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
if (path.EndsWith(Path.DirectorySeparatorChar.ToString()))
2017-04-27 16:30:22 +00:00
{
path = path.Remove(path.Length - 1, 1);
2017-04-27 16:30:22 +00:00
}
return path;
}
2015-12-20 20:44:50 +00:00
}