duheng
2025-03-27 d2ccacb3317aa6310f1b1bb5eb19fbdecba39ff9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
        }
 
 
    }
}