cleanup VersionInfo.cs a bit

This commit is contained in:
adelikat 2020-02-26 15:33:50 -06:00
parent 9cbf7b1176
commit f5e9e8eecd
11 changed files with 27 additions and 24 deletions

View File

@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]
[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]

View File

@ -316,7 +316,7 @@ namespace BizHawk.Client.Common
public string LibretroCore { get; set; } public string LibretroCore { get; set; }
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global
public string LastWrittenFrom { get; set; } = VersionInfo.Mainversion; public string LastWrittenFrom { get; set; } = VersionInfo.MainVersion;
// ReSharper disable once UnusedMember.Global // ReSharper disable once UnusedMember.Global
public string LastWrittenFromDetailed { get; set; } = VersionInfo.GetEmuVersion(); public string LastWrittenFromDetailed { get; set; } = VersionInfo.GetEmuVersion();

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]
[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]

View File

@ -17,7 +17,7 @@ namespace BizHawk.Client.EmuHawk
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{ {
linkLabel1.LinkVisited = true; linkLabel1.LinkVisited = true;
System.Diagnostics.Process.Start("http://tasvideos.org/Bizhawk.html"); Process.Start(VersionInfo.HomePage);
} }
private void OK_Click(object sender, EventArgs e) private void OK_Click(object sender, EventArgs e)
@ -27,7 +27,7 @@ namespace BizHawk.Client.EmuHawk
private void BizBox_Load(object sender, EventArgs e) private void BizBox_Load(object sender, EventArgs e)
{ {
string mainVersion = VersionInfo.Mainversion; string mainVersion = VersionInfo.MainVersion;
if (IntPtr.Size == 8) if (IntPtr.Size == 8)
{ {
mainVersion += " (x64)"; mainVersion += " (x64)";
@ -40,7 +40,7 @@ namespace BizHawk.Client.EmuHawk
: $"Version {mainVersion} (GIT {SubWCRev.GIT_BRANCH}#{SubWCRev.GIT_SHORTHASH})"; : $"Version {mainVersion} (GIT {SubWCRev.GIT_BRANCH}#{SubWCRev.GIT_SHORTHASH})";
VersionLabel.Text = $"Version {mainVersion}"; VersionLabel.Text = $"Version {mainVersion}";
DateLabel.Text = VersionInfo.RELEASEDATE; DateLabel.Text = VersionInfo.ReleaseDate;
var cores = Assembly var cores = Assembly
.Load("BizHawk.Emulation.Cores") .Load("BizHawk.Emulation.Cores")

View File

@ -52,8 +52,8 @@ namespace BizHawk.Client.EmuHawk
public static bool IsNewVersionAvailable => public static bool IsNewVersionAvailable =>
AutoCheckEnabled AutoCheckEnabled
&& LatestVersion != IgnoreVersion && LatestVersion != IgnoreVersion
&& ParseVersion(VersionInfo.Mainversion) != 0 // Avoid notifying if current version string is invalid && ParseVersion(VersionInfo.MainVersion) != 0 // Avoid notifying if current version string is invalid
&& ParseVersion(LatestVersion) > ParseVersion(VersionInfo.Mainversion); && ParseVersion(LatestVersion) > ParseVersion(VersionInfo.MainVersion);
public static void IgnoreNewVersion() public static void IgnoreNewVersion()
{ {

View File

@ -416,7 +416,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethod("getversion", "Returns the current stable BizHawk version")] [LuaMethod("getversion", "Returns the current stable BizHawk version")]
public static string GetVersion() public static string GetVersion()
{ {
return VersionInfo.Mainversion; return VersionInfo.MainVersion;
} }
[LuaMethodExample("local nlcliget = client.getavailabletools( );")] [LuaMethodExample("local nlcliget = client.getavailabletools( );")]

View File

@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]
[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]

View File

@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]
[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]

View File

@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]
[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]

View File

@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]
[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] [assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)]

View File

@ -1,20 +1,23 @@
#nullable disable #nullable disable
using System.IO; using System.IO;
using System.Reflection;
internal static class VersionInfo internal static class VersionInfo
{ {
// keep this updated at every major release // keep this updated at every major release
public const string Mainversion = "2.4.0"; // Use numbers only or the new version notification won't work public const string MainVersion = "2.4.0"; // Use numbers only or the new version notification won't work
public static readonly string RELEASEDATE = "January 18, 2020"; public const string ReleaseDate = "January 18, 2020";
public const string HomePage = "http://tasvideos.org/BizHawk.html";
public static readonly bool DeveloperBuild = true; public static readonly bool DeveloperBuild = true;
public static readonly string HomePage = "http://tasvideos.org/BizHawk.html";
public static readonly string CustomBuildString; public static readonly string CustomBuildString;
public static string GetEmuVersion() public static string GetEmuVersion()
{ {
return DeveloperBuild ? ("GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH) : ("Version " + Mainversion); return DeveloperBuild
? "GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH
: "Version " + MainVersion;
} }
static VersionInfo() static VersionInfo()
@ -34,7 +37,7 @@ internal static class VersionInfo
// code copied to avoid depending on code in other projects // code copied to avoid depending on code in other projects
private static string GetExeDirectoryAbsolute() private static string GetExeDirectoryAbsolute()
{ {
var path = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location); var path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? "";
if (path.EndsWith(Path.DirectorySeparatorChar.ToString())) if (path.EndsWith(Path.DirectorySeparatorChar.ToString()))
{ {
path = path.Remove(path.Length - 1, 1); path = path.Remove(path.Length - 1, 1);