diff --git a/src/Files.App/Utils/Global/WSLDistroManager.cs b/src/Files.App/Utils/Global/WSLDistroManager.cs index 066478174bfb..63adc28a49c6 100644 --- a/src/Files.App/Utils/Global/WSLDistroManager.cs +++ b/src/Files.App/Utils/Global/WSLDistroManager.cs @@ -28,6 +28,14 @@ public static async Task UpdateDrivesAsync() { try { + // Check if WSL is installed + const string WslRegistryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss"; + using (var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(WslRegistryPath)) + { + if (key != null && key.GetSubKeyNames().Length == 0) + return; + } + var distroFolder = await StorageFolder.GetFolderFromPathAsync(@"\\wsl$\"); foreach (StorageFolder folder in await distroFolder.GetFoldersAsync()) {