mirror of https://github.com/Jackett/Jackett
Changed app settings location to longer require root on unix
This commit is contained in:
parent
a0987d9b50
commit
7cbad21e0b
|
@ -18,7 +18,7 @@ namespace Jackett
|
|||
{
|
||||
class Program
|
||||
{
|
||||
public static string AppConfigDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett");
|
||||
public static string AppConfigDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett");
|
||||
|
||||
public static Server ServerInstance { get; private set; }
|
||||
|
||||
|
@ -36,6 +36,8 @@ namespace Jackett
|
|||
{
|
||||
ExitEvent = new ManualResetEvent(false);
|
||||
|
||||
MigrateSettingsDirectory();
|
||||
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(AppConfigDirectory))
|
||||
|
@ -111,6 +113,22 @@ namespace Jackett
|
|||
Console.WriteLine("Server thread exit");
|
||||
}
|
||||
|
||||
static void MigrateSettingsDirectory()
|
||||
{
|
||||
try
|
||||
{
|
||||
string oldDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett");
|
||||
if (Directory.Exists(oldDir) && !Directory.Exists(AppConfigDirectory))
|
||||
{
|
||||
Directory.Move(oldDir, AppConfigDirectory);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("ERROR could not migrate settings directory " + ex);
|
||||
}
|
||||
}
|
||||
|
||||
static void ReadSettingsFile()
|
||||
{
|
||||
var path = Path.Combine(AppConfigDirectory, "config.json");
|
||||
|
|
Loading…
Reference in New Issue