never ever update dev plugins

This commit is contained in:
goat 2023-04-10 21:07:21 +02:00
parent 869ce9568d
commit 4328826c86
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
2 changed files with 14 additions and 30 deletions

View file

@ -2176,7 +2176,7 @@ internal class PluginInstallerWindow : Window, IDisposable
this.DrawSendFeedbackButton(plugin.Manifest, plugin.IsTesting); this.DrawSendFeedbackButton(plugin.Manifest, plugin.IsTesting);
} }
if (availablePluginUpdate != default) if (availablePluginUpdate != default && ! plugin.IsDev)
this.DrawUpdateSinglePluginButton(availablePluginUpdate); this.DrawUpdateSinglePluginButton(availablePluginUpdate);
ImGui.SameLine(); ImGui.SameLine();

View file

@ -1144,44 +1144,28 @@ Thanks and have fun!";
if (plugin.IsDev) if (plugin.IsDev)
{ {
// TODO: Does this ever work? Why? We should never update devplugins throw new Exception("We should never update a dev plugin");
try
{
plugin.DllFile.Delete();
lock (this.pluginListLock)
{
this.InstalledPlugins = this.InstalledPlugins.Remove(plugin);
}
}
catch (Exception ex)
{
Log.Error(ex, "Error during delete (update)");
updateStatus.WasUpdated = false;
return updateStatus;
}
} }
else
try
{ {
try // TODO: Why were we ever doing this? We should never be loading the old version in the first place
{ /*
// TODO: Why were we ever doing this? We should never be loading the old version in the first place
/*
if (!plugin.IsDisabled) if (!plugin.IsDisabled)
plugin.Disable(); plugin.Disable();
*/ */
lock (this.pluginListLock) lock (this.pluginListLock)
{
this.InstalledPlugins = this.InstalledPlugins.Remove(plugin);
}
}
catch (Exception ex)
{ {
Log.Error(ex, "Error during disable (update)"); this.InstalledPlugins = this.InstalledPlugins.Remove(plugin);
updateStatus.WasUpdated = false;
return updateStatus;
} }
} }
catch (Exception ex)
{
Log.Error(ex, "Error during disable (update)");
updateStatus.WasUpdated = false;
return updateStatus;
}
// We need to handle removed DTR nodes here, as otherwise, plugins will not be able to re-add their bar entries after updates. // We need to handle removed DTR nodes here, as otherwise, plugins will not be able to re-add their bar entries after updates.
var dtr = Service<DtrBar>.Get(); var dtr = Service<DtrBar>.Get();