From 97484610242ce1f95ebcd4e6313da991025543e6 Mon Sep 17 00:00:00 2001 From: CWX Date: Tue, 21 May 2024 23:07:51 +0100 Subject: [PATCH] rebrand - ico and release Field to change --- README.md | 8 +- SPTInstaller/App.axaml | 26 ++--- SPTInstaller/App.axaml.cs | 2 +- SPTInstaller/Assets/Styles.axaml | 94 +++++++++---------- .../Dialogs/ChangeLogDialog.axaml | 2 +- .../Dialogs/ConfirmationDialog.axaml | 2 +- .../Dialogs/WhyCacheThoughDialog.axaml | 4 +- .../CustomControls/PreCheckItem.axaml | 10 +- .../CustomControls/ProgressableTaskItem.axaml | 2 +- SPTInstaller/CustomControls/TitleBar.axaml | 4 +- SPTInstaller/Helpers/FileHelper.cs | 16 +++- SPTInstaller/Helpers/ProcessHelper.cs | 4 +- SPTInstaller/Installer Tasks/DownloadTask.cs | 14 +-- .../Installer Tasks/ReleaseCheckTask.cs | 34 +++---- .../Installer Tasks/SetupClientTask.cs | 2 +- SPTInstaller/Models/InternalData.cs | 4 +- .../Models/ReleaseInfo/ReleaseInfo.cs | 2 +- SPTInstaller/SPTInstaller.csproj | 3 +- SPTInstaller/ViewModels/PreChecksViewModel.cs | 14 +-- SPTInstaller/Views/InstallView.axaml | 4 +- SPTInstaller/Views/MainWindow.axaml | 4 +- 21 files changed, 131 insertions(+), 124 deletions(-) diff --git a/README.md b/README.md index 14a3845..7d90b19 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SPT-AKI Installer made for EFT. +# SPT Installer made for EFT. spt installer 2.59 @@ -9,12 +9,12 @@ - Checks if there is enough space before install - Checks installer is not in a problematic path - Checks install folder does not have game files already in it -- Checks if gameversion matches aki version, if so skip patcher process +- Checks if gameversion matches SPT version, if so skip patcher process - Checks both zips are there, other than when the above match, patcher isnt checked for - downloads both Zips from the Repo's if needed ### Installer Processes: - Copies files from registry logged GamePath to new location - Extracts, runs and deletes patcher with no user input -- Extracts Aki -- Deletes both Patcher and AKI zips at the end \ No newline at end of file +- Extracts SPT +- Deletes both Patcher and SPT zips at the end \ No newline at end of file diff --git a/SPTInstaller/App.axaml b/SPTInstaller/App.axaml index fc2db57..3331a7d 100644 --- a/SPTInstaller/App.axaml +++ b/SPTInstaller/App.axaml @@ -16,21 +16,21 @@ - #121212 - #FFC107 - #FFFFFF - #282828 - #323947 - #444259 + #121212 + #FFC107 + #FFFFFF + #282828 + #323947 + #444259 - - - - - - - + + + + + + + - + diff --git a/SPTInstaller/Helpers/FileHelper.cs b/SPTInstaller/Helpers/FileHelper.cs index bcb962b..61681c9 100644 --- a/SPTInstaller/Helpers/FileHelper.cs +++ b/SPTInstaller/Helpers/FileHelper.cs @@ -96,29 +96,35 @@ public static class FileHelper { try { + Log.Debug($"Starting StreamAssemblyResourceOut, resourcename: {resourceName}, outputFilePath: {outputFilePath}"); var assembly = Assembly.GetExecutingAssembly(); + Log.Debug($"1"); FileInfo outputFile = new FileInfo(outputFilePath); - + Log.Debug($"2"); if (outputFile.Exists) { + Log.Debug($"3"); outputFile.Delete(); } - + Log.Debug($"4"); if (!outputFile.Directory.Exists) { + Log.Debug($"5"); Directory.CreateDirectory(outputFile.Directory.FullName); } - + Log.Debug($"6"); var resName = assembly.GetManifestResourceNames().First(x => x.EndsWith(resourceName)); - + Log.Debug($"7"); using (FileStream fs = File.Create(outputFilePath)) using (Stream s = assembly.GetManifestResourceStream(resName)) { + Log.Debug($"8"); s.CopyTo(fs); } - + Log.Debug($"9"); outputFile.Refresh(); + Log.Debug(outputFile.Exists.ToString()); return outputFile.Exists; } catch (Exception ex) diff --git a/SPTInstaller/Helpers/ProcessHelper.cs b/SPTInstaller/Helpers/ProcessHelper.cs index dd925bb..12e004b 100644 --- a/SPTInstaller/Helpers/ProcessHelper.cs +++ b/SPTInstaller/Helpers/ProcessHelper.cs @@ -38,7 +38,7 @@ public static class ProcessHelper switch ((PatcherExitCode)process.ExitCode) { case PatcherExitCode.Success: - return Result.FromSuccess("Patcher Finished Successfully, extracting Aki"); + return Result.FromSuccess("Patcher Finished Successfully, extracting SPT"); case PatcherExitCode.ProgramClosed: return Result.FromError("Patcher was closed before completing!"); @@ -47,7 +47,7 @@ public static class ProcessHelper return Result.FromError("EscapeFromTarkov.exe is missing from the install Path"); case PatcherExitCode.NoPatchFolder: - return Result.FromError("Patchers Folder called 'Aki_Patches' is missing"); + return Result.FromError("Patchers Folder called 'SPT_Patches' is missing"); case PatcherExitCode.MissingFile: return Result.FromError("EFT files was missing a Vital file to continue"); diff --git a/SPTInstaller/Installer Tasks/DownloadTask.cs b/SPTInstaller/Installer Tasks/DownloadTask.cs index 75875cc..3776944 100644 --- a/SPTInstaller/Installer Tasks/DownloadTask.cs +++ b/SPTInstaller/Installer Tasks/DownloadTask.cs @@ -68,23 +68,23 @@ public class DownloadTask : InstallerTaskBase return Result.FromError("Failed to download Patcher"); } - private async Task DownloadSptAkiFromMirrors(IProgress progress) + private async Task DownloadSPTFromMirrors(IProgress progress) { // Note that GetOrDownloadFileAsync handles the cached file hash check, so we don't need to check it first foreach (var mirror in _data.ReleaseInfo.Mirrors) { - SetStatus("Downloading SPT-AKI", mirror.DownloadUrl, progressStyle: ProgressStyle.Indeterminate); + SetStatus("Downloading SPT", mirror.DownloadUrl, progressStyle: ProgressStyle.Indeterminate); - _data.AkiZipInfo = - await DownloadCacheHelper.GetOrDownloadFileAsync("sptaki", mirror.DownloadUrl, progress, mirror.Hash); + _data.SPTZipInfo = + await DownloadCacheHelper.GetOrDownloadFileAsync("SPT", mirror.DownloadUrl, progress, mirror.Hash); - if (_data.AkiZipInfo != null) + if (_data.SPTZipInfo != null) { return Result.FromSuccess(); } } - return Result.FromError("Failed to download spt-aki"); + return Result.FromError("Failed to download SPT"); } public override async Task TaskOperation() @@ -110,6 +110,6 @@ public class DownloadTask : InstallerTaskBase } } - return await DownloadSptAkiFromMirrors(progress); + return await DownloadSPTFromMirrors(progress); } } \ No newline at end of file diff --git a/SPTInstaller/Installer Tasks/ReleaseCheckTask.cs b/SPTInstaller/Installer Tasks/ReleaseCheckTask.cs index 8857c55..ca8b018 100644 --- a/SPTInstaller/Installer Tasks/ReleaseCheckTask.cs +++ b/SPTInstaller/Installer Tasks/ReleaseCheckTask.cs @@ -24,58 +24,58 @@ public class ReleaseCheckTask : InstallerTaskBase SetStatus("Checking SPT Releases", "", null, ProgressStyle.Indeterminate); var progress = new Progress((d) => { SetStatus(null, null, (int)Math.Floor(d)); }); - var akiReleaseInfoFile = + var SPTReleaseInfoFile = await DownloadCacheHelper.GetOrDownloadFileAsync("release.json", DownloadCacheHelper.ReleaseMirrorUrl, progress, DownloadCacheHelper.SuggestedTtl); - if (akiReleaseInfoFile == null) + if (SPTReleaseInfoFile == null) { return Result.FromError("Failed to download release metadata"); } - var akiReleaseInfo = - JsonConvert.DeserializeObject(File.ReadAllText(akiReleaseInfoFile.FullName)); + var SPTReleaseInfo = + JsonConvert.DeserializeObject(File.ReadAllText(SPTReleaseInfoFile.FullName)); SetStatus("Checking for Patches", "", null, ProgressStyle.Indeterminate); - var akiPatchMirrorsFile = + var SPTPatchMirrorsFile = await DownloadCacheHelper.GetOrDownloadFileAsync("mirrors.json", DownloadCacheHelper.PatchMirrorUrl, progress, DownloadCacheHelper.SuggestedTtl); - if (akiPatchMirrorsFile == null) + if (SPTPatchMirrorsFile == null) { return Result.FromError("Failed to download patch mirror data"); } var patchMirrorInfo = - JsonConvert.DeserializeObject(File.ReadAllText(akiPatchMirrorsFile.FullName)); + JsonConvert.DeserializeObject(File.ReadAllText(SPTPatchMirrorsFile.FullName)); - if (akiReleaseInfo == null || patchMirrorInfo == null) + if (SPTReleaseInfo == null || patchMirrorInfo == null) { - return Result.FromError("An error occurred while deserializing aki or patch data"); + return Result.FromError("An error occurred while deserializing SPT or patch data"); } - _data.ReleaseInfo = akiReleaseInfo; + _data.ReleaseInfo = SPTReleaseInfo; _data.PatchInfo = patchMirrorInfo; - int intAkiVersion = int.Parse(akiReleaseInfo.ClientVersion); + int intSPTVersion = int.Parse(SPTReleaseInfo.ClientVersion); int intGameVersion = int.Parse(_data.OriginalGameVersion); - // note: it's possible the game version could be lower than the aki version and still need a patch if the major version numbers change + // note: it's possible the game version could be lower than the SPT version and still need a patch if the major version numbers change // : it's probably a low chance though - bool patchNeedCheck = intGameVersion > intAkiVersion; + bool patchNeedCheck = intGameVersion > intSPTVersion; - if (intGameVersion < intAkiVersion) + if (intGameVersion < intSPTVersion) { return Result.FromError("Your client is outdated. Please update EFT"); } - if (intGameVersion == intAkiVersion) + if (intGameVersion == intSPTVersion) { patchNeedCheck = false; } if ((intGameVersion != patchMirrorInfo.SourceClientVersion || - intAkiVersion != patchMirrorInfo.TargetClientVersion) && patchNeedCheck) + intSPTVersion != patchMirrorInfo.TargetClientVersion) && patchNeedCheck) { return Result.FromError( "No patcher available for your version.\nA patcher is usually created within 24 hours of an EFT update."); @@ -84,7 +84,7 @@ public class ReleaseCheckTask : InstallerTaskBase _data.PatchNeeded = patchNeedCheck; string status = - $"Current Release: {akiReleaseInfo.ClientVersion} - {(_data.PatchNeeded ? "Patch Available" : "No Patch Needed")}"; + $"Current Release: {SPTReleaseInfo.ClientVersion} - {(_data.PatchNeeded ? "Patch Available" : "No Patch Needed")}"; SetStatus(null, status); diff --git a/SPTInstaller/Installer Tasks/SetupClientTask.cs b/SPTInstaller/Installer Tasks/SetupClientTask.cs index a2f2607..2a85cbc 100644 --- a/SPTInstaller/Installer Tasks/SetupClientTask.cs +++ b/SPTInstaller/Installer Tasks/SetupClientTask.cs @@ -71,7 +71,7 @@ public class SetupClientTask : InstallerTaskBase // extract release files SetStatus("Extracting Release", "", 0); - var extractReleaseResult = ZipHelper.Decompress(_data.AkiZipInfo, targetInstallDirInfo, progress); + var extractReleaseResult = ZipHelper.Decompress(_data.SPTZipInfo, targetInstallDirInfo, progress); if (!extractReleaseResult.Succeeded) { diff --git a/SPTInstaller/Models/InternalData.cs b/SPTInstaller/Models/InternalData.cs index 94bbc78..7f47166 100644 --- a/SPTInstaller/Models/InternalData.cs +++ b/SPTInstaller/Models/InternalData.cs @@ -26,9 +26,9 @@ public class InternalData public FileInfo PatcherZipInfo { get; set; } /// - /// SPT-AKI zip file info + /// SPT zip file info /// - public FileInfo AkiZipInfo { get; set; } + public FileInfo SPTZipInfo { get; set; } /// /// The release information from release.json diff --git a/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs b/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs index 44b5df4..f252882 100644 --- a/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs +++ b/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs @@ -4,7 +4,7 @@ namespace SPTInstaller.Models.ReleaseInfo; public class ReleaseInfo { - public string AkiVersion { get; set; } + public string AkiVersion { get; set; } // TODO: Change this and what gets uploaded to SPTVersion public string ClientVersion { get; set; } public List Mirrors { get; set; } } \ No newline at end of file diff --git a/SPTInstaller/SPTInstaller.csproj b/SPTInstaller/SPTInstaller.csproj index ca0fba1..4b97e46 100644 --- a/SPTInstaller/SPTInstaller.csproj +++ b/SPTInstaller/SPTInstaller.csproj @@ -6,12 +6,13 @@ enable true app.manifest + icon.ico Assets\icon.ico Debug;Release;TEST 2.66 2.66 - SPT-AKI + SPT diff --git a/SPTInstaller/ViewModels/PreChecksViewModel.cs b/SPTInstaller/ViewModels/PreChecksViewModel.cs index 7b111c6..38d31bc 100644 --- a/SPTInstaller/ViewModels/PreChecksViewModel.cs +++ b/SPTInstaller/ViewModels/PreChecksViewModel.cs @@ -156,7 +156,7 @@ public class PreChecksViewModel : ViewModelBase { Log.CloseAndFlush(); - var logFiles = Directory.GetFiles(InstallPath, "spt-aki-installer_*.log"); + var logFiles = Directory.GetFiles(InstallPath, "spt-installer_*.log"); // remove log file from original game path if they exist foreach (var file in logFiles) @@ -287,27 +287,27 @@ public class PreChecksViewModel : ViewModelBase var progress = new Progress((d) => { }); - var akiReleaseInfoFile = + var SPTReleaseInfoFile = await DownloadCacheHelper.GetOrDownloadFileAsync("release.json", DownloadCacheHelper.ReleaseMirrorUrl, progress, DownloadCacheHelper.SuggestedTtl); - if (akiReleaseInfoFile == null) + if (SPTReleaseInfoFile == null) { InstallButtonText = "Could not get SPT release metadata"; InstallButtonCheckState = StatusSpinner.SpinnerState.Error; return; } - var akiReleaseInfo = - JsonConvert.DeserializeObject(File.ReadAllText(akiReleaseInfoFile.FullName)); - if (akiReleaseInfo == null) + var SPTReleaseInfo = + JsonConvert.DeserializeObject(File.ReadAllText(SPTReleaseInfoFile.FullName)); + if (SPTReleaseInfo == null) { InstallButtonText = "Could not parse latest SPT release"; InstallButtonCheckState = StatusSpinner.SpinnerState.Error; return; } - InstallButtonText = $"Start Install: SPT v{akiReleaseInfo.AkiVersion}"; + InstallButtonText = $"Start Install: SPT v{SPTReleaseInfo.SPTVersion}"; InstallButtonCheckState = StatusSpinner.SpinnerState.OK; AllowDetailsButton = true; diff --git a/SPTInstaller/Views/InstallView.axaml b/SPTInstaller/Views/InstallView.axaml index 272e96e..d6a4979 100644 --- a/SPTInstaller/Views/InstallView.axaml +++ b/SPTInstaller/Views/InstallView.axaml @@ -9,10 +9,10 @@ + CompletedColor="{StaticResource SPT_Brush_Yellow}" /> @@ -32,7 +32,7 @@ XButtonCommand="{Binding CloseCommand}" MinButtonCommand="{Binding MinimizeCommand}" /> - +