fix #1272 - add support for ref folder in package installation
This commit is contained in:
parent
8c70913a72
commit
72b06b16cf
|
@ -91,7 +91,7 @@
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await PackageService.DownloadPackageAsync(packageid, version, "Modules");
|
await PackageService.DownloadPackageAsync(packageid, version, "Packages");
|
||||||
await logger.LogInformation("Module {ModuleDefinitionName} {Version} Downloaded Successfully", packageid, version);
|
await logger.LogInformation("Module {ModuleDefinitionName} {Version} Downloaded Successfully", packageid, version);
|
||||||
AddModuleMessage(Localizer["Modules Downloaded Successfully. Click Install To Complete Installation."], MessageType.Success);
|
AddModuleMessage(Localizer["Modules Downloaded Successfully. Click Install To Complete Installation."], MessageType.Success);
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
|
|
@ -85,7 +85,7 @@ else
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await PackageService.DownloadPackageAsync(packagename, version, "Modules");
|
await PackageService.DownloadPackageAsync(packagename, version, "Packages");
|
||||||
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", packagename, version);
|
await logger.LogInformation("Module Downloaded {ModuleDefinitionName} {Version}", packagename, version);
|
||||||
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
await ModuleDefinitionService.InstallModuleDefinitionsAsync();
|
||||||
AddModuleMessage(Localizer["Module Installed Successfully. You Must <a href=\"{0}\">Restart</a> Your Application To Apply These Changes.", NavigateUrl("admin/system")], MessageType.Success);
|
AddModuleMessage(Localizer["Module Installed Successfully. You Must <a href=\"{0}\">Restart</a> Your Application To Apply These Changes.", NavigateUrl("admin/system")], MessageType.Success);
|
||||||
|
@ -103,7 +103,7 @@ else
|
||||||
{
|
{
|
||||||
await ModuleDefinitionService.DeleteModuleDefinitionAsync(moduleDefinition.ModuleDefinitionId, moduleDefinition.SiteId);
|
await ModuleDefinitionService.DeleteModuleDefinitionAsync(moduleDefinition.ModuleDefinitionId, moduleDefinition.SiteId);
|
||||||
AddModuleMessage(Localizer["Module Deleted Successfully"], MessageType.Success);
|
AddModuleMessage(Localizer["Module Deleted Successfully"], MessageType.Success);
|
||||||
StateHasChanged();
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "reload"));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await PackageService.DownloadPackageAsync(packageid, version, "Themes");
|
await PackageService.DownloadPackageAsync(packageid, version, "Packages");
|
||||||
await logger.LogInformation("Theme {ThemeName} {Version} Downloaded Successfully", packageid, version);
|
await logger.LogInformation("Theme {ThemeName} {Version} Downloaded Successfully", packageid, version);
|
||||||
AddModuleMessage(Localizer["Themes Downloaded Successfully. Click Install To Complete Installation."], MessageType.Success);
|
AddModuleMessage(Localizer["Themes Downloaded Successfully. Click Install To Complete Installation."], MessageType.Success);
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
|
|
@ -86,7 +86,7 @@ else
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await PackageService.DownloadPackageAsync(packagename, version, "Themes");
|
await PackageService.DownloadPackageAsync(packagename, version, "Packages");
|
||||||
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", packagename, version);
|
await logger.LogInformation("Theme Downloaded {ThemeName} {Version}", packagename, version);
|
||||||
await ThemeService.InstallThemesAsync();
|
await ThemeService.InstallThemesAsync();
|
||||||
AddModuleMessage(Localizer["Theme Installed Successfully. You Must <a href=\"{0}\">Restart</a> Your Application To Apply These Changes.", NavigateUrl("admin/system")], MessageType.Success);
|
AddModuleMessage(Localizer["Theme Installed Successfully. You Must <a href=\"{0}\">Restart</a> Your Application To Apply These Changes.", NavigateUrl("admin/system")], MessageType.Success);
|
||||||
|
@ -104,7 +104,7 @@ else
|
||||||
{
|
{
|
||||||
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
|
await ThemeService.DeleteThemeAsync(Theme.ThemeName);
|
||||||
AddModuleMessage(Localizer["Theme Deleted Successfully"], MessageType.Success);
|
AddModuleMessage(Localizer["Theme Deleted Successfully"], MessageType.Success);
|
||||||
StateHasChanged();
|
NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "reload"));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace Oqtane.Controllers
|
||||||
public void InstallModules()
|
public void InstallModules()
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Modules Installed");
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Modules Installed");
|
||||||
_installationManager.InstallPackages("Modules");
|
_installationManager.InstallPackages();
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/<controller>/5?siteid=x
|
// DELETE api/<controller>/5?siteid=x
|
||||||
|
@ -128,25 +128,8 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove module assets
|
// remove module assets
|
||||||
string assetpath = Path.Combine(_environment.WebRootPath, "Modules", Utilities.GetTypeName(moduledefinition.ModuleDefinitionName));
|
if (_installationManager.UninstallPackage(moduledefinition.PackageName))
|
||||||
if (System.IO.File.Exists(Path.Combine(assetpath, "assets.json")))
|
|
||||||
{
|
{
|
||||||
// use assets.json to clean up file resources
|
|
||||||
List<string> assets = JsonSerializer.Deserialize<List<string>>(System.IO.File.ReadAllText(Path.Combine(assetpath, "assets.json")));
|
|
||||||
assets.Reverse();
|
|
||||||
foreach(string asset in assets)
|
|
||||||
{
|
|
||||||
// legacy support for assets that were stored as absolute paths
|
|
||||||
string filepath = asset.StartsWith("\\") ? Path.Combine(_environment.ContentRootPath, asset.Substring(1)) : asset;
|
|
||||||
if (System.IO.File.Exists(filepath))
|
|
||||||
{
|
|
||||||
System.IO.File.Delete(filepath);
|
|
||||||
if (!Directory.EnumerateFiles(Path.GetDirectoryName(filepath)).Any())
|
|
||||||
{
|
|
||||||
Directory.Delete(Path.GetDirectoryName(filepath));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Module Assets Removed For {ModuleDefinitionName}", moduledefinition.ModuleDefinitionName);
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Module Assets Removed For {ModuleDefinitionName}", moduledefinition.ModuleDefinitionName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -160,6 +143,7 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up module static resource folder
|
// clean up module static resource folder
|
||||||
|
string assetpath = Path.Combine(_environment.WebRootPath, "Modules", Utilities.GetTypeName(moduledefinition.ModuleDefinitionName));
|
||||||
if (Directory.Exists(assetpath))
|
if (Directory.Exists(assetpath))
|
||||||
{
|
{
|
||||||
Directory.Delete(assetpath, true);
|
Directory.Delete(assetpath, true);
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace Oqtane.Controllers
|
||||||
public void InstallPackages()
|
public void InstallPackages()
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Packages Installed");
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Packages Installed");
|
||||||
_installationManager.InstallPackages("Packages");
|
_installationManager.InstallPackages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace Oqtane.Controllers
|
||||||
public void InstallThemes()
|
public void InstallThemes()
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Themes Installed");
|
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Themes Installed");
|
||||||
_installationManager.InstallPackages("Themes");
|
_installationManager.InstallPackages();
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/<controller>/xxx
|
// DELETE api/<controller>/xxx
|
||||||
|
@ -58,25 +58,8 @@ namespace Oqtane.Controllers
|
||||||
if (theme != null && Utilities.GetAssemblyName(theme.ThemeName) != "Oqtane.Client")
|
if (theme != null && Utilities.GetAssemblyName(theme.ThemeName) != "Oqtane.Client")
|
||||||
{
|
{
|
||||||
// remove theme assets
|
// remove theme assets
|
||||||
string assetpath = Path.Combine(_environment.WebRootPath, "Themes", Utilities.GetTypeName(theme.ThemeName));
|
if (_installationManager.UninstallPackage(theme.PackageName))
|
||||||
if (System.IO.File.Exists(Path.Combine(assetpath, "assets.json")))
|
|
||||||
{
|
{
|
||||||
// use assets.json to clean up file resources
|
|
||||||
List<string> assets = JsonSerializer.Deserialize<List<string>>(System.IO.File.ReadAllText(Path.Combine(assetpath, "assets.json")));
|
|
||||||
assets.Reverse();
|
|
||||||
foreach (string asset in assets)
|
|
||||||
{
|
|
||||||
// legacy support for assets that were stored as absolute paths
|
|
||||||
string filepath = (asset.StartsWith("\\")) ? Path.Combine(_environment.ContentRootPath, asset.Substring(1)) : asset;
|
|
||||||
if (System.IO.File.Exists(filepath))
|
|
||||||
{
|
|
||||||
System.IO.File.Delete(filepath);
|
|
||||||
if (!Directory.EnumerateFiles(Path.GetDirectoryName(filepath)).Any())
|
|
||||||
{
|
|
||||||
Directory.Delete(Path.GetDirectoryName(filepath));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Assets Removed For {ThemeName}", theme.ThemeName);
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Assets Removed For {ThemeName}", theme.ThemeName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -90,10 +73,10 @@ namespace Oqtane.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// clean up theme static resource folder
|
// clean up theme static resource folder
|
||||||
string folder = Path.Combine(_environment.WebRootPath, "Themes" , Utilities.GetTypeName(theme.ThemeName));
|
string assetpath = Path.Combine(_environment.WebRootPath, "Themes", Utilities.GetTypeName(theme.ThemeName));
|
||||||
if (Directory.Exists(folder))
|
if (Directory.Exists(assetpath))
|
||||||
{
|
{
|
||||||
Directory.Delete(folder, true);
|
Directory.Delete(assetpath, true);
|
||||||
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Static Resource Folder Removed For {ThemeName}", theme.ThemeName);
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Theme Static Resource Folder Removed For {ThemeName}", theme.ThemeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ using Oqtane.Models;
|
||||||
using Oqtane.Repository;
|
using Oqtane.Repository;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using Oqtane.Enums;
|
using Oqtane.Enums;
|
||||||
using Oqtane.Interfaces;
|
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
|
|
||||||
// ReSharper disable MemberCanBePrivate.Global
|
// ReSharper disable MemberCanBePrivate.Global
|
||||||
|
@ -205,7 +204,7 @@ namespace Oqtane.Infrastructure
|
||||||
using (var scope = _serviceScopeFactory.CreateScope())
|
using (var scope = _serviceScopeFactory.CreateScope())
|
||||||
{
|
{
|
||||||
var installationManager = scope.ServiceProvider.GetRequiredService<IInstallationManager>();
|
var installationManager = scope.ServiceProvider.GetRequiredService<IInstallationManager>();
|
||||||
installationManager.InstallPackages(packageFolderName);
|
installationManager.InstallPackages();
|
||||||
result.Success = true;
|
result.Success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,11 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
// ReSharper disable AssignNullToNotNullAttribute
|
// ReSharper disable AssignNullToNotNullAttribute
|
||||||
|
@ -18,36 +18,46 @@ namespace Oqtane.Infrastructure
|
||||||
{
|
{
|
||||||
private readonly IHostApplicationLifetime _hostApplicationLifetime;
|
private readonly IHostApplicationLifetime _hostApplicationLifetime;
|
||||||
private readonly IWebHostEnvironment _environment;
|
private readonly IWebHostEnvironment _environment;
|
||||||
private readonly IMemoryCache _cache;
|
|
||||||
|
|
||||||
public InstallationManager(IHostApplicationLifetime hostApplicationLifetime, IWebHostEnvironment environment, IMemoryCache cache)
|
public InstallationManager(IHostApplicationLifetime hostApplicationLifetime, IWebHostEnvironment environment)
|
||||||
{
|
{
|
||||||
_hostApplicationLifetime = hostApplicationLifetime;
|
_hostApplicationLifetime = hostApplicationLifetime;
|
||||||
_environment = environment;
|
_environment = environment;
|
||||||
_cache = cache;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InstallPackages(string folders)
|
public void InstallPackages()
|
||||||
{
|
{
|
||||||
if (!InstallPackages(folders, _environment.WebRootPath, _environment.ContentRootPath))
|
if (!InstallPackages(_environment.WebRootPath, _environment.ContentRootPath))
|
||||||
{
|
{
|
||||||
// error installing packages
|
// error installing packages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool InstallPackages(string folders, string webRootPath, string contentRootPath)
|
public static bool InstallPackages(string webRootPath, string contentRootPath)
|
||||||
{
|
{
|
||||||
bool install = false;
|
bool install = false;
|
||||||
string binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
string binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
|
||||||
|
|
||||||
foreach (string folder in folders.Split(','))
|
string sourceFolder = Path.Combine(webRootPath, "Packages");
|
||||||
{
|
|
||||||
string sourceFolder = Path.Combine(webRootPath, folder);
|
|
||||||
if (!Directory.Exists(sourceFolder))
|
if (!Directory.Exists(sourceFolder))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(sourceFolder);
|
Directory.CreateDirectory(sourceFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// support for legacy folder locations
|
||||||
|
foreach (var folder in "Modules,Themes".Split(","))
|
||||||
|
{
|
||||||
|
foreach(var file in Directory.GetFiles(Path.Combine(webRootPath, folder), "*.nupkg"))
|
||||||
|
{
|
||||||
|
var destinationFile = Path.Combine(sourceFolder, Path.GetFileName(file));
|
||||||
|
if (File.Exists(destinationFile))
|
||||||
|
{
|
||||||
|
File.Delete(destinationFile);
|
||||||
|
}
|
||||||
|
File.Move(file, destinationFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// iterate through Nuget packages in source folder
|
// iterate through Nuget packages in source folder
|
||||||
foreach (string packagename in Directory.GetFiles(sourceFolder, "*.nupkg"))
|
foreach (string packagename in Directory.GetFiles(sourceFolder, "*.nupkg"))
|
||||||
{
|
{
|
||||||
|
@ -71,8 +81,8 @@ namespace Oqtane.Infrastructure
|
||||||
{
|
{
|
||||||
frameworkversion = node.Attributes["version"].Value;
|
frameworkversion = node.Attributes["version"].Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.Close();
|
reader.Close();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +95,8 @@ namespace Oqtane.Infrastructure
|
||||||
// packages are in form of name.1.0.0.nupkg or name.culture.1.0.0.nupkg
|
// packages are in form of name.1.0.0.nupkg or name.culture.1.0.0.nupkg
|
||||||
string name = Path.GetFileNameWithoutExtension(packagename);
|
string name = Path.GetFileNameWithoutExtension(packagename);
|
||||||
string[] segments = name?.Split('.');
|
string[] segments = name?.Split('.');
|
||||||
if (segments != null) name = string.Join('.', segments, 0, segments.Length - 3); // remove version information
|
// remove version information from name
|
||||||
|
if (segments != null) name = string.Join('.', segments, 0, segments.Length - 3);
|
||||||
|
|
||||||
// deploy to appropriate locations
|
// deploy to appropriate locations
|
||||||
foreach (ZipArchiveEntry entry in archive.Entries)
|
foreach (ZipArchiveEntry entry in archive.Entries)
|
||||||
|
@ -104,12 +115,15 @@ namespace Oqtane.Infrastructure
|
||||||
case "runtimes": // runtimes/name/...
|
case "runtimes": // runtimes/name/...
|
||||||
filename = ExtractFile(entry, binPath, 0);
|
filename = ExtractFile(entry, binPath, 0);
|
||||||
break;
|
break;
|
||||||
|
case "ref": // ref/net5.0/...
|
||||||
|
filename = ExtractFile(entry, Path.Combine(binPath, "ref"), 2);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename != "")
|
if (filename != "")
|
||||||
{
|
{
|
||||||
assets.Add(filename.Replace(contentRootPath, ""));
|
assets.Add(filename.Replace(contentRootPath, ""));
|
||||||
if (!manifest && Path.GetFileName(filename) == "assets.json")
|
if (!manifest && Path.GetFileName(filename) == name + ".log")
|
||||||
{
|
{
|
||||||
manifest = true;
|
manifest = true;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +133,7 @@ namespace Oqtane.Infrastructure
|
||||||
// save dynamic list of assets
|
// save dynamic list of assets
|
||||||
if (!manifest && assets.Count != 0)
|
if (!manifest && assets.Count != 0)
|
||||||
{
|
{
|
||||||
string manifestpath = Path.Combine(webRootPath, folder, name, "assets.json");
|
string manifestpath = Path.Combine(sourceFolder, name + ".log");
|
||||||
if (File.Exists(manifestpath))
|
if (File.Exists(manifestpath))
|
||||||
{
|
{
|
||||||
File.Delete(manifestpath);
|
File.Delete(manifestpath);
|
||||||
|
@ -137,7 +151,6 @@ namespace Oqtane.Infrastructure
|
||||||
File.Delete(packagename);
|
File.Delete(packagename);
|
||||||
install = true;
|
install = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return install;
|
return install;
|
||||||
}
|
}
|
||||||
|
@ -163,6 +176,31 @@ namespace Oqtane.Infrastructure
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool UninstallPackage(string PackageName)
|
||||||
|
{
|
||||||
|
if (File.Exists(Path.Combine(_environment.WebRootPath, "Packages", PackageName + ".log")))
|
||||||
|
{
|
||||||
|
// use manifest to clean up file resources
|
||||||
|
List<string> assets = JsonSerializer.Deserialize<List<string>>(File.ReadAllText(Path.Combine(_environment.WebRootPath, "Packages", PackageName + ".log")));
|
||||||
|
assets.Reverse();
|
||||||
|
foreach (string asset in assets)
|
||||||
|
{
|
||||||
|
// legacy support for assets that were stored as absolute paths
|
||||||
|
string filepath = asset.StartsWith("\\") ? Path.Combine(_environment.ContentRootPath, asset.Substring(1)) : asset;
|
||||||
|
if (File.Exists(filepath))
|
||||||
|
{
|
||||||
|
File.Delete(filepath);
|
||||||
|
if (!Directory.EnumerateFiles(Path.GetDirectoryName(filepath)).Any())
|
||||||
|
{
|
||||||
|
Directory.Delete(Path.GetDirectoryName(filepath));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void UpgradeFramework()
|
public void UpgradeFramework()
|
||||||
{
|
{
|
||||||
string folder = Path.Combine(_environment.WebRootPath, "Framework");
|
string folder = Path.Combine(_environment.WebRootPath, "Framework");
|
||||||
|
|
|
@ -2,7 +2,8 @@ namespace Oqtane.Infrastructure
|
||||||
{
|
{
|
||||||
public interface IInstallationManager
|
public interface IInstallationManager
|
||||||
{
|
{
|
||||||
void InstallPackages(string folders);
|
void InstallPackages();
|
||||||
|
bool UninstallPackage(string PackageName);
|
||||||
void UpgradeFramework();
|
void UpgradeFramework();
|
||||||
void RestartApplication();
|
void RestartApplication();
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,9 +95,16 @@ namespace Oqtane.Repository
|
||||||
// clean up any orphaned permissions
|
// clean up any orphaned permissions
|
||||||
var ids = new HashSet<int>(moduleDefinitions.Select(item => item.ModuleDefinitionId));
|
var ids = new HashSet<int>(moduleDefinitions.Select(item => item.ModuleDefinitionId));
|
||||||
foreach (var permission in permissions.Where(item => !ids.Contains(item.EntityId)))
|
foreach (var permission in permissions.Where(item => !ids.Contains(item.EntityId)))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
_permissions.DeletePermission(permission.PermissionId);
|
_permissions.DeletePermission(permission.PermissionId);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// multi-threading can cause a race condition to occur
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -174,7 +174,7 @@ namespace Oqtane
|
||||||
services.AddSingleton<IDatabaseManager, DatabaseManager>();
|
services.AddSingleton<IDatabaseManager, DatabaseManager>();
|
||||||
|
|
||||||
// install any modules or themes ( this needs to occur BEFORE the assemblies are loaded into the app domain )
|
// install any modules or themes ( this needs to occur BEFORE the assemblies are loaded into the app domain )
|
||||||
InstallationManager.InstallPackages("Modules,Themes,Packages", _env.WebRootPath, _env.ContentRootPath);
|
InstallationManager.InstallPackages(_env.WebRootPath, _env.ContentRootPath);
|
||||||
|
|
||||||
// register transient scoped core services
|
// register transient scoped core services
|
||||||
services.AddTransient<ITenantManager, TenantManager>();
|
services.AddTransient<ITenantManager, TenantManager>();
|
||||||
|
|
1
Oqtane.Server/wwwroot/Packages/Oqtane.Blogs.log
Normal file
1
Oqtane.Server/wwwroot/Packages/Oqtane.Blogs.log
Normal file
|
@ -0,0 +1 @@
|
||||||
|
["C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Blogs.Client.Oqtane.dll","C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Blogs.Client.Oqtane.pdb","C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Blogs.Server.Oqtane.dll","C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Blogs.Server.Oqtane.pdb","C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Blogs.Shared.Oqtane.dll","C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Blogs.Shared.Oqtane.pdb","\\wwwroot\\Modules\\Oqtane.Blogs\\Module.css","\\wwwroot\\Modules\\Oqtane.Blogs\\Module.js"]
|
|
@ -0,0 +1 @@
|
||||||
|
["C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Database.SqlServer.dll","C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Oqtane.Database.SqlServer.pdb","C:\\Users\\Shaun.Walker\\source\\repos\\sbwalker\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\net5.0\\Microsoft.EntityFrameworkCore.SqlServer.dll"]
|
Loading…
Reference in New Issue
Block a user