mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Set ProgramData folder permissions for everyone
This commit is contained in:
parent
c719b17ac0
commit
72fe0e74d7
2 changed files with 34 additions and 4 deletions
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Security.AccessControl;
|
||||
using NLog;
|
||||
|
||||
namespace NzbDrone.Common.EnvironmentInfo
|
||||
{
|
||||
|
@ -24,12 +26,13 @@ namespace NzbDrone.Common.EnvironmentInfo
|
|||
|
||||
if (!_diskProvider.FolderExists(AppDataFolder))
|
||||
{
|
||||
MigrateFromAppDate();
|
||||
MigrateFromAppData();
|
||||
}
|
||||
|
||||
SetPermissions();
|
||||
}
|
||||
|
||||
|
||||
private void MigrateFromAppDate()
|
||||
private void MigrateFromAppData()
|
||||
{
|
||||
var oldAppDataFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, Environment.SpecialFolderOption.DoNotVerify), "NzbDrone");
|
||||
|
||||
|
@ -43,6 +46,18 @@ namespace NzbDrone.Common.EnvironmentInfo
|
|||
}
|
||||
}
|
||||
|
||||
private void SetPermissions()
|
||||
{
|
||||
try
|
||||
{
|
||||
_diskProvider.SetPermissions(AppDataFolder, "Everyone", FileSystemRights.FullControl, AccessControlType.Allow);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//Todo: Add logging
|
||||
}
|
||||
}
|
||||
|
||||
public string AppDataFolder { get; private set; }
|
||||
|
||||
public string StartUpFolder { get; private set; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue