diff --git a/BizHawk.Client.Common/Properties/AssemblyInfo.cs b/BizHawk.Client.Common/Properties/AssemblyInfo.cs index 0135df64f6..4b146615a3 100644 --- a/BizHawk.Client.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.Common/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 7391c6dbe2..5951fa4ff2 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -316,7 +316,7 @@ namespace BizHawk.Client.Common public string LibretroCore { get; set; } // ReSharper disable once UnusedMember.Global - public string LastWrittenFrom { get; set; } = VersionInfo.Mainversion; + public string LastWrittenFrom { get; set; } = VersionInfo.MainVersion; // ReSharper disable once UnusedMember.Global public string LastWrittenFromDetailed { get; set; } = VersionInfo.GetEmuVersion(); diff --git a/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs b/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs index d3c12a6be3..0aba12848b 100644 --- a/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs +++ b/BizHawk.Client.DiscoHawk/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Client.EmuHawk/BizBox.cs b/BizHawk.Client.EmuHawk/BizBox.cs index c560142798..ffa969421b 100644 --- a/BizHawk.Client.EmuHawk/BizBox.cs +++ b/BizHawk.Client.EmuHawk/BizBox.cs @@ -17,7 +17,7 @@ namespace BizHawk.Client.EmuHawk private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { linkLabel1.LinkVisited = true; - System.Diagnostics.Process.Start("http://tasvideos.org/Bizhawk.html"); + Process.Start(VersionInfo.HomePage); } private void OK_Click(object sender, EventArgs e) @@ -27,7 +27,7 @@ namespace BizHawk.Client.EmuHawk private void BizBox_Load(object sender, EventArgs e) { - string mainVersion = VersionInfo.Mainversion; + string mainVersion = VersionInfo.MainVersion; if (IntPtr.Size == 8) { mainVersion += " (x64)"; @@ -40,7 +40,7 @@ namespace BizHawk.Client.EmuHawk : $"Version {mainVersion} (GIT {SubWCRev.GIT_BRANCH}#{SubWCRev.GIT_SHORTHASH})"; VersionLabel.Text = $"Version {mainVersion}"; - DateLabel.Text = VersionInfo.RELEASEDATE; + DateLabel.Text = VersionInfo.ReleaseDate; var cores = Assembly .Load("BizHawk.Emulation.Cores") diff --git a/BizHawk.Client.EmuHawk/UpdateChecker.cs b/BizHawk.Client.EmuHawk/UpdateChecker.cs index 38168c127e..a4c3fa0f9e 100644 --- a/BizHawk.Client.EmuHawk/UpdateChecker.cs +++ b/BizHawk.Client.EmuHawk/UpdateChecker.cs @@ -52,8 +52,8 @@ namespace BizHawk.Client.EmuHawk public static bool IsNewVersionAvailable => AutoCheckEnabled && LatestVersion != IgnoreVersion - && ParseVersion(VersionInfo.Mainversion) != 0 // Avoid notifying if current version string is invalid - && ParseVersion(LatestVersion) > ParseVersion(VersionInfo.Mainversion); + && ParseVersion(VersionInfo.MainVersion) != 0 // Avoid notifying if current version string is invalid + && ParseVersion(LatestVersion) > ParseVersion(VersionInfo.MainVersion); public static void IgnoreNewVersion() { diff --git a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs index c729bf3d4e..b82af2ca88 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/Libraries/EmuLuaLibrary.Client.cs @@ -416,7 +416,7 @@ namespace BizHawk.Client.EmuHawk [LuaMethod("getversion", "Returns the current stable BizHawk version")] public static string GetVersion() { - return VersionInfo.Mainversion; + return VersionInfo.MainVersion; } [LuaMethodExample("local nlcliget = client.getavailabletools( );")] diff --git a/BizHawk.Common/Properties/AssemblyInfo.cs b/BizHawk.Common/Properties/AssemblyInfo.cs index dc26c045bd..449595248e 100644 --- a/BizHawk.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Common/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs b/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs index 35d9fed2fb..af4295ee55 100644 --- a/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.Common/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs b/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs index 209b53e7aa..d9a76f3097 100644 --- a/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.Cores/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] diff --git a/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs b/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs index 74acf30784..caf4c4eab4 100644 --- a/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs +++ b/BizHawk.Emulation.DiscSystem/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] -[assembly: AssemblyFileVersion(VersionInfo.Mainversion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] +[assembly: AssemblyFileVersion(VersionInfo.MainVersion + "." + SubWCRev.SVN_REV)] diff --git a/Version/VersionInfo.cs b/Version/VersionInfo.cs index 0294d5aa0e..193dda2d0f 100644 --- a/Version/VersionInfo.cs +++ b/Version/VersionInfo.cs @@ -1,20 +1,23 @@ #nullable disable using System.IO; +using System.Reflection; internal static class VersionInfo { // 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 static readonly string RELEASEDATE = "January 18, 2020"; + 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"; 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() { - return DeveloperBuild ? ("GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH) : ("Version " + Mainversion); + return DeveloperBuild + ? "GIT " + SubWCRev.GIT_BRANCH + "#" + SubWCRev.GIT_SHORTHASH + : "Version " + MainVersion; } static VersionInfo() @@ -34,7 +37,7 @@ internal static class VersionInfo // code copied to avoid depending on code in other projects 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())) { path = path.Remove(path.Length - 1, 1);