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);