Skip to content

Commit

Permalink
Fixed issue when a tool is in different repositories and we want to u…
Browse files Browse the repository at this point in the history
…ninstall it
  • Loading branch information
MscrmTools committed Jan 31, 2023
1 parent a904ab9 commit 6e8e74e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
7 changes: 5 additions & 2 deletions XrmToolBox.ToolLibrary/ToolLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ public bool PerformInstallation(PluginUpdates updates, Form form)
}
}

PluginsUpdated?.Invoke(this, new EventArgs());

if (updates.Plugins.Any(p => p.RequireRestart))
{
XmlSerializerHelper.SerializeToFile(updates, Path.Combine(Paths.XrmToolBoxPath, "Update.xml"));
Expand All @@ -539,6 +537,10 @@ public bool PerformInstallation(PluginUpdates updates, Form form)

return false;
}
else
{
PluginsUpdated?.Invoke(this, new EventArgs());
}

return true;
}
Expand Down Expand Up @@ -592,6 +594,7 @@ public void PrepareUninstallPlugins(List<XtbPlugin> pluginsTodelete, PluginDelet
{
var conflicts = XrmToolBoxPlugins.Plugins.Where(p =>
p.Id != plugin.Id
&& p.NugetId.ToLower() != plugin.NugetId.ToLower()
&& (p.Action == PackageInstallAction.None || p.Action == PackageInstallAction.Update)
&& plugin.Files.Any(ff => p.Files.Contains(ff))).ToList();

Expand Down
18 changes: 15 additions & 3 deletions XrmToolBox/New/PluginsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,22 @@ public void ReloadPluginsList()
pluginsManager.Recompose();
pluginsModels.Clear();

txtSearch.AutoCompleteCustomSource.Clear();
txtSearch.AutoCompleteCustomSource.AddRange(PluginManager.PluginsExt.Where(p => !Options.Instance.HiddenPlugins.Contains(p.Metadata.Name)).Select(p => p.Metadata.Name).ToArray());
var mi = new MethodInvoker(() =>
{
txtSearch.AutoCompleteCustomSource.Clear();
txtSearch.AutoCompleteCustomSource.AddRange(PluginManager.PluginsExt.Where(p => !Options.Instance.HiddenPlugins.Contains(p.Metadata.Name)).Select(p => p.Metadata.Name).ToArray());

DisplayPlugins(filterText);
DisplayPlugins(filterText);
});

if (InvokeRequired)
{
Invoke(mi);
}
else
{
mi();
}
}

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Expand Down

0 comments on commit 6e8e74e

Please sign in to comment.