diff --git a/src/Markdowser/Utilities/Configuration.cs b/src/Markdowser/Utilities/Configuration.cs index f859e02..6975467 100644 --- a/src/Markdowser/Utilities/Configuration.cs +++ b/src/Markdowser/Utilities/Configuration.cs @@ -1,12 +1,39 @@ -using System; +using Syroot.Windows.IO; + +using System; using System.IO; +using System.Runtime.InteropServices; namespace Markdowser.Utilities; internal static class Configuration { - public static string DownloadPath => Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - public static string ApplicationDataPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), nameof(Markdowser)); + public static string DownloadPath + { + get + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return KnownFolders.Downloads.Path; + } + + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Downloads"); + } + } + + public static string ApplicationDataPath + { + get + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "StoneRed", nameof(Markdowser)); + } + + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StoneRed", nameof(Markdowser)); + } + } public static string SettingsFilePath => Path.Combine(ApplicationDataPath, "settings.json"); + public static string LogFilePath => Path.Combine(ApplicationDataPath, $"{nameof(Markdowser)}.log"); } \ No newline at end of file