From 9d17061452dc773128e9e76b72ace623d722ffaf Mon Sep 17 00:00:00 2001 From: dsarno Date: Tue, 9 Sep 2025 10:18:22 -0700 Subject: [PATCH] Add Windows legacy server cleanup for %LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer (#272) - Detect and clean up legacy server installations in LocalApplicationData - Prevents accumulation of old server copies during package updates - Improves cleanup of Windows-specific legacy installation paths --- UnityMcpBridge/Editor/Helpers/ServerInstaller.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs b/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs index 235cf43..56cf095 100644 --- a/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs +++ b/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs @@ -314,6 +314,11 @@ namespace MCPForUnity.Editor.Helpers string roaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ?? string.Empty; if (!string.IsNullOrEmpty(roaming)) roots.Add(Path.Combine(roaming, "UnityMCP", "UnityMcpServer")); + // Windows legacy: early installers/dev scripts used %LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer + // Detect this location so we can clean up older copies during install/update. + string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) ?? string.Empty; + if (!string.IsNullOrEmpty(localAppData)) + roots.Add(Path.Combine(localAppData, "Programs", "UnityMCP", "UnityMcpServer")); } catch { } return roots;