Restore files from save archive based on entries in manifest
parent
7b625b2f60
commit
82779bcc72
|
@ -67,13 +67,14 @@ namespace LANCommander.SDK
|
||||||
bool inInstallDir = savePath.Path.StartsWith("{InstallDir}");
|
bool inInstallDir = savePath.Path.StartsWith("{InstallDir}");
|
||||||
string tempSavePath = Path.Combine(tempLocation, savePath.Id.ToString());
|
string tempSavePath = Path.Combine(tempLocation, savePath.Id.ToString());
|
||||||
|
|
||||||
var tempSavePathFile = Path.Combine(tempSavePath, savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}" + Path.DirectorySeparatorChar, ""));
|
foreach (var entry in savePath.Entries)
|
||||||
|
{
|
||||||
|
var tempSavePathFile = Path.Combine(tempSavePath, entry.ArchivePath);
|
||||||
|
|
||||||
destination = Environment.ExpandEnvironmentVariables(savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}", installDirectory));
|
destination = Environment.ExpandEnvironmentVariables(entry.ActualPath).Replace("{InstallDir}", installDirectory);
|
||||||
|
|
||||||
if (File.Exists(tempSavePathFile))
|
if (File.Exists(tempSavePathFile))
|
||||||
{
|
{
|
||||||
// Is file, move file
|
|
||||||
if (File.Exists(destination))
|
if (File.Exists(destination))
|
||||||
File.Delete(destination);
|
File.Delete(destination);
|
||||||
|
|
||||||
|
@ -108,6 +109,7 @@ namespace LANCommander.SDK
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Handle registry importing
|
#region Handle registry importing
|
||||||
|
|
Loading…
Reference in New Issue