|
|
@@ -47,6 +47,22 @@ namespace UAS_AutoUpdate
|
|
|
//进行版本的比较
|
|
|
if (ver1 > ver2)
|
|
|
{
|
|
|
+ Process[] pro = Process.GetProcessesByName("UAS_MES");
|
|
|
+ if (pro.Length > 0)
|
|
|
+ {
|
|
|
+ string CloseProcess = MessageBox.Show(this.ParentForm, "当前程序仍在运行,是否关闭", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
+ if (CloseProcess == "Yes")
|
|
|
+ {
|
|
|
+ for (int i = 0; i < pro.Length; i++)
|
|
|
+ {
|
|
|
+ Process.GetProcessById(pro[i].Id).Kill();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
|
|
|
wc.DownloadFileAsync(new Uri(GetCacheData(ConfigFile, "UpdatePath").ToString()), "UAS_MES.zip");
|
|
|
SetCacheData(ConfigFile, "Version", ver1.ToString());
|