Skip to content

Commit

Permalink
Fix for #1348
Browse files Browse the repository at this point in the history
  • Loading branch information
daryllabar committed Aug 7, 2024
1 parent 729f81a commit 00d5d91
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions XrmToolBox.ToolLibrary/ToolLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void DownloadPackage(ToolOperationEventArgs e, PluginUpdates pus)
}
else
{
AddFilesToUpdate(cachePackagePath, pus, e.Plugin);
AddFilesToUpdate(cachePackagePath, string.Empty, pus, e.Plugin);
}
}

Expand Down Expand Up @@ -657,13 +657,14 @@ public void UninstallByFileName(string fileName)
}
}

private void AddFilesToUpdate(string folderPath, PluginUpdates pus, XtbPlugin tool)
private void AddFilesToUpdate(string cacheRootPath, string relativePath, PluginUpdates pus, XtbPlugin tool)
{
var folderPath = Path.Combine(cacheRootPath, relativePath);
foreach (var file in Directory.GetFiles(folderPath))
{
var fileName = new FileInfo(file).Name;
var fullPath = Path.Combine(folderPath, fileName);
var destinationFile = Path.Combine(Paths.PluginsPath, fileName);
var destinationFile = Path.Combine(Paths.PluginsPath, relativePath, fileName);

// XrmToolBox restart is required when a plugin has to be
// updated or when a new plugin shares files with other
Expand All @@ -682,7 +683,7 @@ private void AddFilesToUpdate(string folderPath, PluginUpdates pus, XtbPlugin to

foreach (var directory in Directory.GetDirectories(folderPath))
{
AddFilesToUpdate(directory, pus, tool);
AddFilesToUpdate(cacheRootPath, directory.Substring(cacheRootPath.Length + 1), pus, tool);
}
}

Expand Down

0 comments on commit 00d5d91

Please sign in to comment.