30 lines
943 B
C#
Raw Normal View History

using SPTInstaller.Interfaces;
2023-05-11 23:11:39 -04:00
using SPTInstaller.Models;
2022-07-09 00:33:55 -04:00
using System.Threading.Tasks;
using SPTInstaller.Helpers;
2022-07-09 00:33:55 -04:00
namespace SPTInstaller.Installer_Tasks;
public class CopyClientTask : InstallerTaskBase
2022-07-09 00:33:55 -04:00
{
private InternalData _data;
2024-05-01 10:31:55 -04:00
public CopyClientTask(InternalData data) : base("Copy Client Files")
{
_data = data;
}
2024-05-01 10:31:55 -04:00
public override async Task<IResult> TaskOperation()
{
SetStatus("Copying Client Files", "", 0);
2024-05-01 10:31:55 -04:00
var originalGameDirInfo = new DirectoryInfo(_data.OriginalGamePath);
var targetInstallDirInfo = new DirectoryInfo(_data.TargetInstallPath);
2024-05-01 10:31:55 -04:00
2023-09-16 16:11:02 -04:00
// relative path for exclusions
var exclusions = new[] { "\\Logs" };
2024-05-01 10:31:55 -04:00
return FileHelper.CopyDirectoryWithProgress(originalGameDirInfo, targetInstallDirInfo,
(message, progress) => { SetStatus(null, message, progress, null, true); }, exclusions);
2022-07-09 00:33:55 -04:00
}
}