Bug
After running the full uninstall flow (WSL uninstall from tray app followed by MSIX uninstall), two empty directories remain on disk:
%LOCALAPPDATA%\OpenClawTray\wsl\ - empty folder (parent of where the VHD lived)
%LOCALAPPDATA%\OpenClawTray\ - now-empty parent directory
Repro Steps
- Install OpenClaw Tray (MSIX, v0.4.4.0)
- Run through easy-button setup (WSL distro provisions successfully)
- Use tray app - Settings - Remove Local Gateway (WSL uninstall completes)
- Uninstall the MSIX package via Windows Settings
- Inspect
%LOCALAPPDATA%\OpenClawTray\
Expected
%LOCALAPPDATA%\OpenClawTray\ should not exist after uninstall.
Actual
%LOCALAPPDATA%\OpenClawTray\wsl\ remains as an empty directory. The parent OpenClawTray\ folder also persists.
Root Cause
In the 13-step uninstall engine (LocalGatewayUninstall.cs), Step 7 deletes the VHD directory at %LOCALAPPDATA%\OpenClawTray\wsl\OpenClawGateway\ but does not clean up the parent wsl\ directory. After all steps complete, the OpenClawTray\ folder is left behind because it still contains the empty wsl\ subdirectory.
Suggested Fix
After Step 7 removes the VHD subdirectory, also remove the parent wsl\ directory if it is empty. Then, as a final cleanup step, remove the %LOCALAPPDATA%\OpenClawTray\ directory itself if it is empty (i.e., no logs, result files, or other artifacts remain).
// After deleting wsl\OpenClawGateway:
var wslDir = Path.Combine(localAppData, "OpenClawTray", "wsl");
if (Directory.Exists(wslDir) && !Directory.EnumerateFileSystemEntries(wslDir).Any())
{
Directory.Delete(wslDir);
}
// Final cleanup - remove OpenClawTray dir if empty
var appDir = Path.Combine(localAppData, "OpenClawTray");
if (Directory.Exists(appDir) && !Directory.EnumerateFileSystemEntries(appDir).Any())
{
Directory.Delete(appDir);
}
The validation script (scripts/validate-wsl-gateway-uninstall.ps1) should also be updated to assert that the wsl\ parent directory is absent after uninstall.
Additional Note
A separate empty temp directory at %LOCALAPPDATA%\Temp\WSLDVCPlugin\OpenClawGateway\ also persists, but since this is in the system Temp folder it is lower priority and will be cleaned up by normal temp maintenance.
Environment
- Windows 11
- OpenClaw Tray v0.4.4.0 (MSIX, test-signed)
- WSL2
Bug
After running the full uninstall flow (WSL uninstall from tray app followed by MSIX uninstall), two empty directories remain on disk:
%LOCALAPPDATA%\OpenClawTray\wsl\- empty folder (parent of where the VHD lived)%LOCALAPPDATA%\OpenClawTray\- now-empty parent directoryRepro Steps
%LOCALAPPDATA%\OpenClawTray\Expected
%LOCALAPPDATA%\OpenClawTray\should not exist after uninstall.Actual
%LOCALAPPDATA%\OpenClawTray\wsl\remains as an empty directory. The parentOpenClawTray\folder also persists.Root Cause
In the 13-step uninstall engine (
LocalGatewayUninstall.cs), Step 7 deletes the VHD directory at%LOCALAPPDATA%\OpenClawTray\wsl\OpenClawGateway\but does not clean up the parentwsl\directory. After all steps complete, theOpenClawTray\folder is left behind because it still contains the emptywsl\subdirectory.Suggested Fix
After Step 7 removes the VHD subdirectory, also remove the parent
wsl\directory if it is empty. Then, as a final cleanup step, remove the%LOCALAPPDATA%\OpenClawTray\directory itself if it is empty (i.e., no logs, result files, or other artifacts remain).The validation script (
scripts/validate-wsl-gateway-uninstall.ps1) should also be updated to assert that thewsl\parent directory is absent after uninstall.Additional Note
A separate empty temp directory at
%LOCALAPPDATA%\Temp\WSLDVCPlugin\OpenClawGateway\also persists, but since this is in the system Temp folder it is lower priority and will be cleaned up by normal temp maintenance.Environment