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 pathsmain
parent
3e83f993bf
commit
9d17061452
|
|
@ -314,6 +314,11 @@ namespace MCPForUnity.Editor.Helpers
|
||||||
string roaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ?? string.Empty;
|
string roaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ?? string.Empty;
|
||||||
if (!string.IsNullOrEmpty(roaming))
|
if (!string.IsNullOrEmpty(roaming))
|
||||||
roots.Add(Path.Combine(roaming, "UnityMCP", "UnityMcpServer"));
|
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 { }
|
catch { }
|
||||||
return roots;
|
return roots;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue