Skip to content

Commit 9d17061

Browse files
authored
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
1 parent 3e83f99 commit 9d17061

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

UnityMcpBridge/Editor/Helpers/ServerInstaller.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ private static IEnumerable<string> GetLegacyRootsForDetection()
314314
string roaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ?? string.Empty;
315315
if (!string.IsNullOrEmpty(roaming))
316316
roots.Add(Path.Combine(roaming, "UnityMCP", "UnityMcpServer"));
317+
// Windows legacy: early installers/dev scripts used %LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer
318+
// Detect this location so we can clean up older copies during install/update.
319+
string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) ?? string.Empty;
320+
if (!string.IsNullOrEmpty(localAppData))
321+
roots.Add(Path.Combine(localAppData, "Programs", "UnityMCP", "UnityMcpServer"));
317322
}
318323
catch { }
319324
return roots;

0 commit comments

Comments
 (0)