Prevented overwriting of backups when reapplying mod

This commit is contained in:
Yoshi Askharoun
2021-05-30 23:48:48 -05:00
parent 3dbd9c58ed
commit 712a751bd7
4 changed files with 13 additions and 6 deletions
+6 -2
View File
@@ -34,8 +34,12 @@ namespace ZuneModCore.Mods
return Task.FromResult<string?>($"The file '{zsDllInfo.FullName}' does not exist.");
}
// Make a backup of the file
File.Copy(zsDllInfo.FullName, Path.Combine(StorageDirectory, "ZuneService.original.dll"), true);
// Make a backup if it doesn't already exist
FileInfo zsDllBackupInfo = new(Path.Combine(StorageDirectory, "ZuneService.original.dll"));
if (zsDllBackupInfo.Exists)
{
File.Copy(zsDllInfo.FullName, zsDllBackupInfo.FullName, true);
}
try
{