Skip to content

Commit f0a6167

Browse files
authored
Fix: Fixed a WSL popup from displaying on startup (#15667)
1 parent 27968a1 commit f0a6167

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Files.App/Utils/Global/WSLDistroManager.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public static async Task UpdateDrivesAsync()
2828
{
2929
try
3030
{
31+
// Check if WSL is installed
32+
const string WslRegistryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss";
33+
using (var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(WslRegistryPath))
34+
{
35+
if (key != null && key.GetSubKeyNames().Length == 0)
36+
return;
37+
}
38+
3139
var distroFolder = await StorageFolder.GetFolderFromPathAsync(@"\\wsl$\");
3240
foreach (StorageFolder folder in await distroFolder.GetFoldersAsync())
3341
{

0 commit comments

Comments
 (0)