Skip to content

Commit

Permalink
#903 add Terraria version check
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryConstruct committed Dec 13, 2016
1 parent 534f15d commit 311b8f7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TEditXna/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ protected override void OnStartup(StartupEventArgs e)

try
{

if (!DependencyChecker.VerifyTerraria())
{
ErrorLogging.Log("Unable to locate Terraria. No texture data will be available.");
}
else
{
ErrorLogging.Log(string.Format("Terraria v{0}", DependencyChecker.GetTerrariaVersion() ?? "not found"));
ErrorLogging.Log(string.Format("Terraria Data Path: {0}", DependencyChecker.PathToContent));
}
}
Expand Down
13 changes: 13 additions & 0 deletions TEditXna/DependencyChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Diagnostics;

namespace TEditXna
{
Expand Down Expand Up @@ -217,5 +218,17 @@ public static bool VerifyTerraria()
return Directory.Exists(PathToContent);
}

public static string GetTerrariaVersion()
{
string version = null;
try
{
string terrariaExePath = Directory.GetParent(PathToContent).FullName + "\\Terraria.exe";
version = FileVersionInfo.GetVersionInfo(terrariaExePath).FileVersion;
}
catch { /*no message*/}
return version;
}

}
}
2 changes: 1 addition & 1 deletion TEditXna/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//

[assembly: AssemblyVersion("3.9.0.0")]
[assembly: AssemblyFileVersion("3.9.16323.1415")]
[assembly: AssemblyFileVersion("3.9.16348.0006")]


[assembly: XmlnsDefinition("http://tedit/wpf", "TEdit.UI.Xaml")]
Expand Down
2 changes: 1 addition & 1 deletion teditversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.7.16323.1415
v3.9.0.0

0 comments on commit 311b8f7

Please sign in to comment.