2023-07-12 09:19:33 +02:00
|
|
|
|
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;
|
2023-07-12 09:19:33 +02:00
|
|
|
|
using SPTInstaller.Helpers;
|
2022-07-09 00:33:55 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
namespace SPTInstaller.Installer_Tasks;
|
|
|
|
|
|
|
|
|
|
public class CopyClientTask : InstallerTaskBase
|
2022-07-09 00:33:55 -04:00
|
|
|
|
{
|
2023-07-12 09:19:33 +02:00
|
|
|
|
private InternalData _data;
|
2022-07-09 00:33:55 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
public CopyClientTask(InternalData data) : base("Copy Client Files")
|
|
|
|
|
{
|
|
|
|
|
_data = data;
|
|
|
|
|
}
|
2022-07-09 00:33:55 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
public override async Task<IResult> TaskOperation()
|
|
|
|
|
{
|
|
|
|
|
SetStatus("Copying Client Files", "", 0);
|
2022-07-09 00:33:55 -04:00
|
|
|
|
|
2023-07-12 09:19:33 +02:00
|
|
|
|
var originalGameDirInfo = new DirectoryInfo(_data.OriginalGamePath);
|
|
|
|
|
var targetInstallDirInfo = new DirectoryInfo(_data.TargetInstallPath);
|
2022-07-09 00:33:55 -04:00
|
|
|
|
|
2023-09-16 16:11:02 -04:00
|
|
|
|
// relative path for exclusions
|
2023-09-16 16:10:40 -04:00
|
|
|
|
var exclusions = new[] { "\\Logs" };
|
|
|
|
|
|
|
|
|
|
return FileHelper.CopyDirectoryWithProgress(originalGameDirInfo, targetInstallDirInfo, (message, progress) => { SetStatus(null, message, progress, null, true); }, exclusions);
|
2022-07-09 00:33:55 -04:00
|
|
|
|
}
|
2023-07-12 09:19:33 +02:00
|
|
|
|
}
|