新供应商 数据恢复 升级exe优化
This commit is contained in:
1 parent
456b0534e3
commit
dcb82684f4
13 files changed
+419
-21
No files matched your search
@@ -93,15 +93,27 @@ namespace Update
|
||||
// 备份旧文件
|
||||
foreach (string filePath in Directory.GetFiles(upTempPath))
|
||||
{
|
||||
string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
|
||||
File.Copy(mainPath + "\\" + fileName, upBakPath + "\\" + fileName, true);
|
||||
Thread.Sleep(10);
|
||||
try
|
||||
{
|
||||
string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
|
||||
File.Copy(mainPath + "\\" + fileName, upBakPath + "\\" + fileName, true);
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
foreach (string dirPath in Directory.GetDirectories(upTempPath))
|
||||
{
|
||||
string fileName = dirPath.Substring(dirPath.LastIndexOf("\\") + 1);
|
||||
CopyDirectory(mainPath + "\\" + fileName, upBakPath + "\\" + fileName);
|
||||
Thread.Sleep(10);
|
||||
try
|
||||
{
|
||||
string fileName = dirPath.Substring(dirPath.LastIndexOf("\\") + 1);
|
||||
CopyDirectory(mainPath + "\\" + fileName, upBakPath + "\\" + fileName);
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
string error = "";
|
||||
@@ -109,7 +121,10 @@ namespace Update
|
||||
foreach (string filePath in Directory.GetFiles(upTempPath))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(error))
|
||||
{
|
||||
error = "发生错误:\r\n" + error + "\r\n请关闭升级窗口重试!";
|
||||
break;
|
||||
}
|
||||
try
|
||||
{
|
||||
string fileName = filePath.Substring(filePath.LastIndexOf("\\") + 1);
|
||||
|
||||
Reference in new issue
Block a user