optimize the System Update process

This commit is contained in:
sbwalker
2025-04-07 13:18:52 -04:00
parent 1f8c54ce74
commit 5dcc7c14f3
8 changed files with 150 additions and 81 deletions

View File

@ -380,7 +380,7 @@ namespace Oqtane.Infrastructure
File.WriteAllText(assemblyLogPath, JsonSerializer.Serialize(assemblies, new JsonSerializerOptions { WriteIndented = true }));
}
public async Task UpgradeFramework()
public async Task UpgradeFramework(bool backup)
{
string folder = Path.Combine(_environment.ContentRootPath, Constants.PackagesFolder);
if (Directory.Exists(folder))
@ -448,14 +448,14 @@ namespace Oqtane.Infrastructure
// install Oqtane.Upgrade zip package
if (File.Exists(upgradepackage))
{
FinishUpgrade();
FinishUpgrade(backup);
}
}
}
}
}
private void FinishUpgrade()
private void FinishUpgrade(bool backup)
{
// check if updater application exists
string Updater = Constants.UpdaterPackageId + ".dll";
@ -469,7 +469,7 @@ namespace Oqtane.Infrastructure
{
WorkingDirectory = folder,
FileName = "dotnet",
Arguments = Path.Combine(folder, Updater) + " \"" + _environment.ContentRootPath + "\" \"" + _environment.WebRootPath + "\"",
Arguments = Path.Combine(folder, Updater) + " \"" + _environment.ContentRootPath + "\" \"" + _environment.WebRootPath + "\" \"" + backup.ToString() + "\"",
UseShellExecute = false,
ErrorDialog = false,
CreateNoWindow = true,