From 926d37a5729fabd5c52f0b2d51637119876e0948 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 26 Mar 2023 20:53:10 -0700 Subject: [PATCH] Fixed: Permissions after installing on Windows and opening Firewall port (cherry picked from commit ff2e8ffc372a34d08028db3c49f603cdfb87d832) --- src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs | 3 ++- src/NzbDrone.Host/UtilityModeRouter.cs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs index 0805c07d0..048685d88 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs @@ -11,6 +11,7 @@ namespace NzbDrone.Common.EnvironmentInfo public interface IAppFolderFactory { void Register(); + void SetPermissions(); } public class AppFolderFactory : IAppFolderFactory @@ -58,7 +59,7 @@ public void Register() InitializeMonoApplicationData(); } - private void SetPermissions() + public void SetPermissions() { try { diff --git a/src/NzbDrone.Host/UtilityModeRouter.cs b/src/NzbDrone.Host/UtilityModeRouter.cs index 61a8ce633..5bbd9e69e 100644 --- a/src/NzbDrone.Host/UtilityModeRouter.cs +++ b/src/NzbDrone.Host/UtilityModeRouter.cs @@ -18,18 +18,21 @@ public class UtilityModeRouter : IUtilityModeRouter private readonly IConsoleService _consoleService; private readonly IProcessProvider _processProvider; private readonly IRemoteAccessAdapter _remoteAccessAdapter; + private readonly IAppFolderFactory _appFolderFactory; private readonly Logger _logger; public UtilityModeRouter(IServiceProvider serviceProvider, IConsoleService consoleService, IProcessProvider processProvider, IRemoteAccessAdapter remoteAccessAdapter, + IAppFolderFactory appFolderFactory, Logger logger) { _serviceProvider = serviceProvider; _consoleService = consoleService; _processProvider = processProvider; _remoteAccessAdapter = remoteAccessAdapter; + _appFolderFactory = appFolderFactory; _logger = logger; } @@ -79,6 +82,7 @@ public void Route(ApplicationModes applicationModes) { _logger.Debug("Regiser URL selected"); _remoteAccessAdapter.MakeAccessible(false); + _appFolderFactory.SetPermissions(); break; }