modifications for System Update feature
This commit is contained in:
parent
94f0bdcce9
commit
04257f75e7
|
@ -98,7 +98,7 @@ namespace Oqtane.Infrastructure
|
|||
ExtractFile(entry, filename);
|
||||
break;
|
||||
case "wwwroot":
|
||||
filename = Path.Combine(webRootPath, Utilities.PathCombine(entry.FullName.Replace($"wwwroot/", "").Split('/')));
|
||||
filename = Path.Combine(webRootPath.Replace(Path.DirectorySeparatorChar + "wwwroot", ""), Utilities.PathCombine(entry.FullName.Split('/')));
|
||||
ExtractFile(entry, filename);
|
||||
break;
|
||||
case "runtimes":
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace Oqtane.Upgrade
|
|||
files.Add(Path.Combine(binfolder, filename));
|
||||
break;
|
||||
case "wwwroot":
|
||||
files.Add(Path.Combine(webrootfolder, entry.FullName.Replace("wwwroot/", "").Replace("/", Path.DirectorySeparatorChar.ToString())));
|
||||
files.Add(Path.Combine(webrootfolder.Replace(Path.DirectorySeparatorChar + "wwwroot", ""), entry.FullName.Replace('/', Path.DirectorySeparatorChar)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -102,21 +102,26 @@ namespace Oqtane.Upgrade
|
|||
filename = Path.Combine(binfolder, filename);
|
||||
break;
|
||||
case "wwwroot":
|
||||
filename = Path.Combine(webrootfolder, entry.FullName.Replace("wwwroot/", "").Replace("/", Path.DirectorySeparatorChar.ToString()));
|
||||
filename = Path.Combine(webrootfolder.Replace(Path.DirectorySeparatorChar + "wwwroot", ""), entry.FullName.Replace('/', Path.DirectorySeparatorChar));
|
||||
break;
|
||||
}
|
||||
if (files.Contains(filename))
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(filename)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
||||
}
|
||||
entry.ExtractToFile(filename, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
// an error occurred extracting a file
|
||||
success = false;
|
||||
Console.WriteLine("Update Not Successful: Error Extracting Files From Package - " + ex.Message);
|
||||
}
|
||||
|
||||
if (success)
|
||||
|
@ -135,8 +140,6 @@ namespace Oqtane.Upgrade
|
|||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Update Not Successful: Error Extracting Files From Package");
|
||||
|
||||
// restore on failure
|
||||
foreach (string file in files)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user