You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
In situations where addins are frequently added, removed, and updated, the addins directory tends to fill up with empty directories between application restarts rather quickly. Each one of these directories is then scanned on Registry.Update, potentially causing slowdowns once a lot of them exist.
Perhaps AddinDatabase.RunPendingUninstalls can try deleting the containing folder the addin file being removed was stored in, keeping things a lot more tidy for end users, and avoiding a massive directory of empty folders.
Something as simple as:
if (canUninstall) {
foreach (string file in adn.Files.OrderByDescending(s => s).ToList()) {
var dir = Path.GetDirectoryName(file);
if (dir != null) {
try {
Directory.Delete(dir);
}
catch {
}
}
}
Configuration.UnregisterForUninstall (adn.AddinId);
changesDone = true;
}
to replace the previous code of:
if (canUninstall) {
Configuration.UnregisterForUninstall (adn.AddinId);
changesDone = true;
}
Seems to do the trick, but I'm not sure if that code is compatible with all the targets of Mono.Addins, so just throwing out an example.
I'm not familiar with the possible directory structure for multi-assembly addins, but in my simple testing I just had a single file in a directory so it worked as intended. Maybe a recursive delete can be done regardless if the directory is empty or not, but I'm not sure of the implications of that, or if that's even desirable. I can't think of any case where empty directories of uninstalled addins are desirable though!
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In situations where addins are frequently added, removed, and updated, the addins directory tends to fill up with empty directories between application restarts rather quickly. Each one of these directories is then scanned on
Registry.Update
, potentially causing slowdowns once a lot of them exist.Perhaps
AddinDatabase.RunPendingUninstalls
can try deleting the containing folder the addin file being removed was stored in, keeping things a lot more tidy for end users, and avoiding a massive directory of empty folders.Something as simple as:
to replace the previous code of:
Seems to do the trick, but I'm not sure if that code is compatible with all the targets of Mono.Addins, so just throwing out an example.
I'm not familiar with the possible directory structure for multi-assembly addins, but in my simple testing I just had a single file in a directory so it worked as intended. Maybe a recursive delete can be done regardless if the directory is empty or not, but I'm not sure of the implications of that, or if that's even desirable. I can't think of any case where empty directories of uninstalled addins are desirable though!
The text was updated successfully, but these errors were encountered: