diff --git a/src/Tgstation.Server.Host.Service/Program.cs b/src/Tgstation.Server.Host.Service/Program.cs index c2f72b0901..4a9d39fcd2 100644 --- a/src/Tgstation.Server.Host.Service/Program.cs +++ b/src/Tgstation.Server.Host.Service/Program.cs @@ -179,7 +179,9 @@ namespace Tgstation.Server.Host.Service var exePath = Path.Combine(assemblyDirectory, $"{assemblyNameWithoutExtension}.exe"); var programDataDirectory = Path.Combine( - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), + Environment.GetFolderPath( + Environment.SpecialFolder.CommonApplicationData, + Environment.SpecialFolderOption.DoNotVerify), Server.Common.Constants.CanonicalPackageName); using var processInstaller = new ServiceProcessInstaller(); diff --git a/src/Tgstation.Server.Host/Components/Engine/ByondInstallerBase.cs b/src/Tgstation.Server.Host/Components/Engine/ByondInstallerBase.cs index cf20d498a9..f02239969f 100644 --- a/src/Tgstation.Server.Host/Components/Engine/ByondInstallerBase.cs +++ b/src/Tgstation.Server.Host/Components/Engine/ByondInstallerBase.cs @@ -52,7 +52,7 @@ namespace Tgstation.Server.Host.Components.Engine protected override EngineType TargetEngineType => EngineType.Byond; /// - /// Bath to the system user's local BYOND folder. + /// Path to the system user's local BYOND folder. /// protected abstract string PathToUserFolder { get; } @@ -157,12 +157,6 @@ namespace Tgstation.Server.Host.Components.Engine ArgumentNullException.ThrowIfNull(fullDmbPath); var byondDir = PathToUserFolder; - if (String.IsNullOrWhiteSpace(byondDir)) - { - Logger.LogTrace("No relevant user BYOND directory to install a \"{fileName}\" in", TrustedDmbFileName); - return; - } - var cfgDir = IOManager.ConcatPath( byondDir, CfgDirectoryName); diff --git a/src/Tgstation.Server.Host/Components/Engine/PosixByondInstaller.cs b/src/Tgstation.Server.Host/Components/Engine/PosixByondInstaller.cs index cddace53c8..f3c9c561b1 100644 --- a/src/Tgstation.Server.Host/Components/Engine/PosixByondInstaller.cs +++ b/src/Tgstation.Server.Host/Components/Engine/PosixByondInstaller.cs @@ -65,7 +65,8 @@ namespace Tgstation.Server.Host.Components.Engine PathToUserFolder = IOManager.ResolvePath( IOManager.ConcatPath( Environment.GetFolderPath( - Environment.SpecialFolder.UserProfile), + Environment.SpecialFolder.UserProfile, + Environment.SpecialFolderOption.DoNotVerify), "./byond/cache")); } diff --git a/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs b/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs index 0ebf63ff9f..0f40d3f538 100644 --- a/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs +++ b/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs @@ -100,11 +100,12 @@ namespace Tgstation.Server.Host.Components.Engine this.processExecutor = processExecutor ?? throw new ArgumentNullException(nameof(processExecutor)); generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); - var documentsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - if (String.IsNullOrWhiteSpace(documentsDirectory)) - PathToUserFolder = null; // happens with the service account - else - PathToUserFolder = IOManager.ResolvePath(IOManager.ConcatPath(documentsDirectory, "BYOND")); + var documentsDirectory = Environment.GetFolderPath( + Environment.SpecialFolder.MyDocuments, + Environment.SpecialFolderOption.DoNotVerify); + + PathToUserFolder = IOManager.ResolvePath( + IOManager.ConcatPath(documentsDirectory, "BYOND")); semaphore = new SemaphoreSlim(1); installedDirectX = false; diff --git a/src/Tgstation.Server.Host/Configuration/FileLoggingConfiguration.cs b/src/Tgstation.Server.Host/Configuration/FileLoggingConfiguration.cs index aa798cfed3..c317fc1b97 100644 --- a/src/Tgstation.Server.Host/Configuration/FileLoggingConfiguration.cs +++ b/src/Tgstation.Server.Host/Configuration/FileLoggingConfiguration.cs @@ -62,7 +62,9 @@ namespace Tgstation.Server.Host.Configuration return platformIdentifier.IsWindows ? ioManager.ConcatPath( - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), + Environment.GetFolderPath( + Environment.SpecialFolder.CommonApplicationData, + Environment.SpecialFolderOption.DoNotVerify), assemblyInformationProvider.VersionPrefix, "logs") : ioManager.ConcatPath( diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index 3ce52f39be..10f2728465 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -367,7 +367,9 @@ namespace Tgstation.Server.Host.Core // only global repo manager should be for the OD repo var openDreamRepositoryDirectory = ioManager.ConcatPath( - Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), + Environment.GetFolderPath( + Environment.SpecialFolder.LocalApplicationData, + Environment.SpecialFolderOption.DoNotVerify), assemblyInformationProvider.VersionPrefix, "OpenDreamRepository"); services.AddSingleton( diff --git a/tests/Tgstation.Server.Tests/CachingFileDownloader.cs b/tests/Tgstation.Server.Tests/CachingFileDownloader.cs index bd7d01bbbd..de540b606d 100644 --- a/tests/Tgstation.Server.Tests/CachingFileDownloader.cs +++ b/tests/Tgstation.Server.Tests/CachingFileDownloader.cs @@ -94,7 +94,9 @@ namespace Tgstation.Server.Tests // actions is supposed to cache BYOND for us var dir = Path.Combine( - Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + Environment.GetFolderPath( + Environment.SpecialFolder.UserProfile, + Environment.SpecialFolderOption.DoNotVerify), "byond-zips-cache", windows ? "windows" : "linux"); path = Path.Combine( diff --git a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs index fc5177e355..611ee9ed6f 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs @@ -85,7 +85,9 @@ namespace Tgstation.Server.Tests.Live.Instance { var ioManager = new DefaultIOManager(); var odRepoDir = ioManager.ConcatPath( - Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), + Environment.GetFolderPath( + Environment.SpecialFolder.LocalApplicationData, + Environment.SpecialFolderOption.DoNotVerify), new AssemblyInformationProvider().VersionPrefix, "OpenDreamRepository"); var odRepoIoManager = new ResolvingIOManager(ioManager, odRepoDir);