mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-20 04:05:00 +03:00
使v2rayUpgrade.exe支持更新自身
This commit is contained in:
@@ -62,6 +62,8 @@ namespace v2rayUpgrade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string thisAppOldFile = Application.ExecutablePath + ".tmp";
|
||||||
|
File.Delete(thisAppOldFile);
|
||||||
string startKey = "v2rayN/";
|
string startKey = "v2rayN/";
|
||||||
|
|
||||||
using (ZipArchive archive = ZipFile.OpenRead(fileName))
|
using (ZipArchive archive = ZipFile.OpenRead(fileName))
|
||||||
@@ -77,6 +79,10 @@ namespace v2rayUpgrade
|
|||||||
{
|
{
|
||||||
fullName = fullName.Substring(startKey.Length, fullName.Length - startKey.Length);
|
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);
|
string entryOuputPath = GetPath(fullName);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user