mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
New: Health check for AppData and Startup folder conflict
This commit is contained in:
parent
519b6debfb
commit
ebd13bdda8
7 changed files with 131 additions and 7 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue