2020-08-11 20:24:04 +02:00
|
|
|
|
namespace Giants.Launcher
|
|
|
|
|
{
|
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
public static class VersionHelper
|
|
|
|
|
{
|
|
|
|
|
public static Version GetGameVersion(string gamePath)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(gamePath);
|
|
|
|
|
return new Version(fvi.FileVersion.Replace(',', '.'));
|
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
2022-09-10 04:07:40 +02:00
|
|
|
|
string message = string.Format(Resources.AppNotFound, Resources.AppName);
|
|
|
|
|
MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
Application.Exit();
|
|
|
|
|
|
2020-08-11 20:24:04 +02:00
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Version GetLauncherVersion()
|
|
|
|
|
{
|
|
|
|
|
return new Version(Application.ProductVersion);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|