File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/Files.App/ViewModels/Settings Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) Files Community
22// Licensed under the MIT License.
33
4+ using System . IO ;
45using System . Windows . Input ;
56
67namespace Files . App . ViewModels . Settings
@@ -63,7 +64,8 @@ public string IDEPath
6364 IsIDEPathValid =
6465 ! string . IsNullOrWhiteSpace ( value ) &&
6566 ! value . Contains ( '\" ' ) &&
66- ! value . Contains ( '\' ' ) ;
67+ ! value . Contains ( '\' ' ) &&
68+ CheckPathExists ( ) ;
6769 }
6870 }
6971 }
@@ -177,5 +179,20 @@ private async void DoTestIDE()
177179 PowerShellExecutionOptions . Hidden
178180 ) ;
179181 }
182+
183+ private bool CheckPathExists ( )
184+ {
185+ if ( Path . Exists ( IDEPath ) )
186+ return true ;
187+
188+ var paths = Environment . GetEnvironmentVariable ( "PATH" ) ? . Split ( ';' ) ;
189+ foreach ( var path in paths ?? Array . Empty < string > ( ) )
190+ {
191+ if ( Path . Exists ( Path . Combine ( path , IDEPath ) ) )
192+ return true ;
193+ }
194+
195+ return false ;
196+ }
180197 }
181198}
You can’t perform that action at this time.
0 commit comments