diff --git a/BTCPayServer/Plugins/PluginManager.cs b/BTCPayServer/Plugins/PluginManager.cs index d92f22086..b5a5663dd 100644 --- a/BTCPayServer/Plugins/PluginManager.cs +++ b/BTCPayServer/Plugins/PluginManager.cs @@ -216,6 +216,10 @@ namespace BTCPayServer.Plugins case "delete": ExecuteCommand(("enable", command.extension), pluginsFolder, true); + if (File.Exists(dirName)) + { + File.Delete(dirName); + } if (Directory.Exists(dirName)) { Directory.Delete(dirName, true); diff --git a/BTCPayServer/Plugins/PluginService.cs b/BTCPayServer/Plugins/PluginService.cs index 95c755a93..85b4d7930 100644 --- a/BTCPayServer/Plugins/PluginService.cs +++ b/BTCPayServer/Plugins/PluginService.cs @@ -92,7 +92,7 @@ namespace BTCPayServer.Plugins { var dest = _dataDirectories.Value.PluginDir; - var filedest = Path.Join(dest, plugin); + var filedest = Path.Join(dest, plugin+".btcpay"); Directory.CreateDirectory(Path.GetDirectoryName(filedest)); using var resp2 = await _githubClient.GetAsync(path); using var fs = new FileStream(filedest, FileMode.Create, FileAccess.ReadWrite);