mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Health check for AppData and Startup folder conflict
This commit is contained in:
@@ -60,6 +60,8 @@ namespace NzbDrone.Core.Update
|
||||
{
|
||||
try
|
||||
{
|
||||
EnsureAppDataSafety();
|
||||
|
||||
var updateSandboxFolder = _appFolderInfo.GetUpdateSandboxFolder();
|
||||
|
||||
var packageDestination = Path.Combine(updateSandboxFolder, updatePackage.FileName);
|
||||
@@ -139,6 +141,15 @@ namespace NzbDrone.Core.Update
|
||||
return String.Join(" ", processId, updateSandboxFolder.TrimEnd(Path.DirectorySeparatorChar).WrapInQuotes(), executingApplication.WrapInQuotes());
|
||||
}
|
||||
|
||||
private void EnsureAppDataSafety()
|
||||
{
|
||||
if (_appFolderInfo.StartUpFolder.IsParentPath(_appFolderInfo.AppDataFolder) ||
|
||||
_appFolderInfo.StartUpFolder.PathEquals(_appFolderInfo.AppDataFolder))
|
||||
{
|
||||
throw new NotSupportedException("Update will cause AppData to be deleted, correct you configuration before proceeding");
|
||||
}
|
||||
}
|
||||
|
||||
public void Execute(ApplicationUpdateCommand message)
|
||||
{
|
||||
_logger.ProgressDebug("Checking for updates");
|
||||
|
Reference in New Issue
Block a user