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