2022-11-27 21:44:42 +00:00
|
|
|
|
using System;
|
2020-04-01 11:20:33 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
2020-04-21 09:12:17 +00:00
|
|
|
|
namespace Flow.Launcher.Infrastructure.UserSettings
|
2020-04-01 11:20:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
public static class DataLocation
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string PortableFolderName = "UserData";
|
|
|
|
|
|
public const string DeletionIndicatorFile = ".dead";
|
|
|
|
|
|
public static string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName);
|
2020-04-24 02:15:49 +00:00
|
|
|
|
public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher");
|
2020-04-01 11:20:33 +00:00
|
|
|
|
public static string DataDirectory()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (PortableDataLocationInUse())
|
|
|
|
|
|
return PortableDataPath;
|
|
|
|
|
|
|
|
|
|
|
|
return RoamingDataPath;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static bool PortableDataLocationInUse()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Directory.Exists(PortableDataPath) && !File.Exists(DeletionIndicatorFile))
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly string PluginsDirectory = Path.Combine(DataDirectory(), Constant.Plugins);
|
2020-08-16 11:49:22 +00:00
|
|
|
|
public static readonly string PluginSettingsDirectory = Path.Combine(DataDirectory(), "Settings", Constant.Plugins);
|
2022-11-27 21:44:42 +00:00
|
|
|
|
|
2022-12-01 03:40:24 +00:00
|
|
|
|
public const string PythonEnvironmentName = "Python";
|
|
|
|
|
|
public const string NodeEnvironmentName = "Node.js";
|
|
|
|
|
|
public const string PluginEnvironments = "Environments";
|
|
|
|
|
|
public static readonly string PluginEnvironmentsPath = Path.Combine(DataDirectory(), PluginEnvironments);
|
2020-04-01 11:20:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|