From e1d76dbc5f2215f360820a6afaa969ff7c9305d6 Mon Sep 17 00:00:00 2001 From: Bod9001 Date: Sun, 12 Nov 2023 17:40:24 +0000 Subject: [PATCH] move to Installation path --- UnitystationLauncher/Services/CodeScanService.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/UnitystationLauncher/Services/CodeScanService.cs b/UnitystationLauncher/Services/CodeScanService.cs index bd69dd6..5147551 100644 --- a/UnitystationLauncher/Services/CodeScanService.cs +++ b/UnitystationLauncher/Services/CodeScanService.cs @@ -16,7 +16,7 @@ public class CodeScanService : ICodeScanService private readonly IAssemblyChecker _IAssemblyChecker; private readonly IEnvironmentService _environmentService; private readonly IGoodFileService _iGoodFileService; - + private readonly IPreferencesService _preferencesService; private const string Managed = "Managed"; private const string Plugins = "Plugins"; @@ -26,11 +26,13 @@ public class CodeScanService : ICodeScanService - public CodeScanService(IAssemblyChecker assemblyChecker, IEnvironmentService environmentService, IGoodFileService iGoodFileService) + public CodeScanService(IAssemblyChecker assemblyChecker, IEnvironmentService environmentService, IGoodFileService iGoodFileService, + IPreferencesService ipreferencesService) { _IAssemblyChecker = assemblyChecker; _environmentService = environmentService; _iGoodFileService = iGoodFileService; + _preferencesService = ipreferencesService; } @@ -52,7 +54,7 @@ public int GetHashCode(FileInfo obj) public async Task OnScan(ZipArchive archive, string targetDirectory, string goodFileVersion, Action info, Action errors) { // TODO: Enable extraction cancelling - var root = new DirectoryInfo(_environmentService.GetUserdataDirectory()); + var root = new DirectoryInfo( _preferencesService.GetPreferences().InstallationPath); DirectoryInfo stagingDirectory = root.CreateSubdirectory("UnsafeBuildZipDirectory"); DirectoryInfo processingDirectory = root.CreateSubdirectory("UnsafeBuildProcessing");