mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Flow.Launcher.Infrastructure.UserSettings
|
|
{
|
|
public static class DataLocation
|
|
{
|
|
public const string PortableFolderName = "UserData";
|
|
public const string DeletionIndicatorFile = ".dead";
|
|
public static string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName);
|
|
public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher");
|
|
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);
|
|
}
|
|
}
|