mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2026-09-12 01:00:49 +08:00
[#] 修改当前备份逻辑,相同版本dll只做一次备份!
原因: 可选功能补丁允许在非原版dll上做多次安装补丁操作。
This commit is contained in:
@@ -345,6 +345,7 @@ namespace RevokeMsgPatcher.Modifier
|
||||
bool success = editor.Patch();
|
||||
if (!success)
|
||||
{
|
||||
// 此处还原逻辑不可能进入
|
||||
editor.Restore();
|
||||
}
|
||||
else
|
||||
@@ -369,7 +370,7 @@ namespace RevokeMsgPatcher.Modifier
|
||||
{
|
||||
foreach (FileHexEditor editor in editors)
|
||||
{
|
||||
if (!File.Exists(editor.FileBakPath))
|
||||
if (!File.Exists(editor.FileBakPath) || editor.FileVersion != editor.BackupFileVersion)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,19 @@ namespace RevokeMsgPatcher.Modifier
|
||||
/// </summary>
|
||||
public void Backup()
|
||||
{
|
||||
File.Copy(FilePath, FileBakPath, true);
|
||||
// 不覆盖同版本的备份文件
|
||||
if (File.Exists(FileBakPath))
|
||||
{
|
||||
if (FileVersion != BackupFileVersion)
|
||||
{
|
||||
File.Copy(FilePath, FileBakPath, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
File.Copy(FilePath, FileBakPath, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user