SVN r509
SVN-Revision: r509
This commit is contained in:
@@ -199,7 +199,7 @@ namespace Lskj.AutoUpdate
|
|||||||
}
|
}
|
||||||
catch (Exception exp)
|
catch (Exception exp)
|
||||||
{
|
{
|
||||||
MessageBox.Show("下载错误202:"+exp.Message);
|
MessageBox.Show("下载错误202:" + exp.Message);
|
||||||
//log the error message,you can use the application's log code
|
//log the error message,you can use the application's log code
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,6 +269,7 @@ namespace Lskj.AutoUpdate
|
|||||||
System.IO.FileInfo f = new FileInfo(newPath);
|
System.IO.FileInfo f = new FileInfo(newPath);
|
||||||
if (!file.Size.ToString().Equals(f.Length.ToString()) && !file.FileName.ToString().EndsWith(".xml"))
|
if (!file.Size.ToString().Equals(f.Length.ToString()) && !file.FileName.ToString().EndsWith(".xml"))
|
||||||
{
|
{
|
||||||
|
MessageBox.Show($"文件大小与服务器不匹配");
|
||||||
ShowErrorAndRestartApplication();
|
ShowErrorAndRestartApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +320,7 @@ namespace Lskj.AutoUpdate
|
|||||||
}
|
}
|
||||||
catch (Exception exp)
|
catch (Exception exp)
|
||||||
{
|
{
|
||||||
MessageBox.Show("oldPath:"+oldPath + "\r\n" + "newPath:"+newPath + "\r\n" + exp.Message);
|
MessageBox.Show("oldPath:" + oldPath + "\r\n" + "newPath:" + newPath + "\r\n" + exp.Message);
|
||||||
//log the error message,you can use the application's log code
|
//log the error message,you can use the application's log code
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,33 +478,4 @@ namespace Lskj.AutoUpdate
|
|||||||
{
|
{
|
||||||
//MessageBox.Show(e.Message);
|
//MessageBox.Show(e.Message);
|
||||||
//log the error message,you can use the application's log code
|
//log the error message,you can use the application's log code
|
||||||
ShowErrorAndRestartApplication();
|
ShowErrorAndRestartApp
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// <para>说明:重新下载</para>
|
|
||||||
/// <para>创建人:龚宇超</para>
|
|
||||||
/// <para>创建日期:2018-02-23 </para>
|
|
||||||
/// <para>修改人:</para>
|
|
||||||
/// <para>修改日期:</para>
|
|
||||||
/// <para>修改备注:</para>
|
|
||||||
/// <para>版本:1.0</para>
|
|
||||||
/// </summary>
|
|
||||||
private void ShowErrorAndRestartApplication()
|
|
||||||
{
|
|
||||||
DialogResult dlg = MessageBox.Show(ConstModel.UPDATE_CONTINUE, ConstModel.LS_TITLE_NAME, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
|
||||||
if (dlg == DialogResult.Yes)
|
|
||||||
CommonUnitity.RestartApplication();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (clientDownload != null)
|
|
||||||
clientDownload.CancelAsync();
|
|
||||||
evtDownload.Set();
|
|
||||||
evtPerDonwload.Set();
|
|
||||||
autoUpdater.RollBack();
|
|
||||||
|
|
||||||
Exit(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user