@@ -166,25 +166,15 @@ private void InitialDriverList()
166
166
private void LoadEnvironmentStringPaths ( )
167
167
{
168
168
_envStringPaths = new Dictionary < string , string > ( ) ;
169
-
170
- var specialPaths =
171
- new Dictionary < string , Environment . SpecialFolder > {
172
- { "appdata" , Environment . SpecialFolder . ApplicationData } ,
173
- { "localappdata" , Environment . SpecialFolder . LocalApplicationData } ,
174
- { "programfiles" , Environment . SpecialFolder . ProgramFiles } ,
175
- { "programfiles(x86)" , Environment . SpecialFolder . ProgramFilesX86 } ,
176
- { "programdata" , Environment . SpecialFolder . CommonApplicationData } ,
177
- { "userprofile" , Environment . SpecialFolder . UserProfile }
178
- } ;
179
-
180
- foreach ( var special in specialPaths )
169
+
170
+ var specialPaths = System . Environment . GetEnvironmentVariables ( ) ;
171
+ foreach ( DictionaryEntry special in specialPaths )
181
172
{
182
- _envStringPaths . Add ( special . Key , Environment . GetFolderPath ( special . Value ) ) ;
173
+ if ( Directory . Exists ( special . Value . ToString ( ) ) )
174
+ {
175
+ _envStringPaths . Add ( special . Key . ToString ( ) . ToLower ( ) , special . Value . ToString ( ) ) ;
176
+ }
183
177
}
184
-
185
- var tempDirectoryPath = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) , "Temp" ) ;
186
-
187
- _envStringPaths . Add ( "temp" , tempDirectoryPath ) ;
188
178
}
189
179
190
180
private static readonly char [ ] _specialSearchChars = new char [ ]
0 commit comments