From 20ab51e33976154faeeb4e751b2f87a81421742a Mon Sep 17 00:00:00 2001 From: YFdyh000 Date: Sat, 21 Mar 2020 07:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BFv2rayUpgrade.exe=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=87=AA=E8=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/v2rayUpgrade/MainForm.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v2rayN/v2rayUpgrade/MainForm.cs b/v2rayN/v2rayUpgrade/MainForm.cs index 7b77ed61..81583a2e 100644 --- a/v2rayN/v2rayUpgrade/MainForm.cs +++ b/v2rayN/v2rayUpgrade/MainForm.cs @@ -62,6 +62,8 @@ namespace v2rayUpgrade } } + string thisAppOldFile = Application.ExecutablePath + ".tmp"; + File.Delete(thisAppOldFile); string startKey = "v2rayN/"; using (ZipArchive archive = ZipFile.OpenRead(fileName)) @@ -77,6 +79,10 @@ namespace v2rayUpgrade { fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length); } + if (Application.ExecutablePath.ToLower() == GetPath(fullName).ToLower()) + { + File.Move(Application.ExecutablePath, thisAppOldFile); + } string entryOuputPath = GetPath(fullName);