using System.IO;
|
using Yw.Update;
|
|
namespace HStation.Desktop
|
{
|
/// <summary>
|
/// 数据结构版本辅助类
|
/// </summary>
|
public class AutoUpdateHelper
|
{
|
/// <summary>
|
/// 是否需要升级
|
/// </summary>
|
public static bool NeedUpdate()
|
{
|
if (!VersionHelper.HasNewVersion(UpdateConfigHelper.ServerIP, UpdateConfigHelper.ServerPort))
|
{
|
return false;
|
}
|
|
var dlg = new AutoUpdateConfirmDlg();
|
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
{
|
return true;
|
}
|
return false;
|
|
}
|
|
/// <summary>
|
/// 是否
|
/// </summary>
|
public static bool NeedExist()
|
{
|
if (NeedUpdate())
|
{
|
string updateExePath = AppDomain.CurrentDomain.BaseDirectory + "AutoUpdater\\Yw.Update.Client.Core.exe";
|
System.Diagnostics.Process myProcess = System.Diagnostics.Process.Start(updateExePath);
|
return true;
|
}
|
return false;
|
}
|
|
|
}
|
}
|