1
- // <copyright file="Executable.cs" company="WebDriver Committers">
1
+ // <copyright file="Executable.cs" company="WebDriver Committers">
2
2
// Licensed to the Software Freedom Conservancy (SFC) under one
3
3
// or more contributor license agreements. See the NOTICE file
4
4
// distributed with this work for additional information
@@ -135,6 +135,9 @@ private static string LocateFirefoxBinaryFromPlatform()
135
135
string binary = string . Empty ;
136
136
if ( Platform . CurrentPlatform . IsPlatformType ( PlatformType . Windows ) )
137
137
{
138
+ #if ! NETCOREAPP2_0
139
+ // NOTE: This code is legacy, and will be removed. It will not be
140
+ // fixed for the .NET Core case.
138
141
// Look first in HKEY_LOCAL_MACHINE, then in HKEY_CURRENT_USER
139
142
// if it's not found there. If it's still not found, look in
140
143
// the default install location (C:\Program Files\Mozilla Firefox).
@@ -151,6 +154,7 @@ private static string LocateFirefoxBinaryFromPlatform()
151
154
}
152
155
else
153
156
{
157
+ #endif
154
158
// NOTE: Can't use Environment.SpecialFolder.ProgramFilesX86, because .NET 3.5
155
159
// doesn't have that member of the enum.
156
160
string [ ] windowsDefaultInstallLocations = new string [ ]
@@ -160,7 +164,9 @@ private static string LocateFirefoxBinaryFromPlatform()
160
164
} ;
161
165
162
166
binary = GetExecutablePathUsingDefaultInstallLocations ( windowsDefaultInstallLocations , "Firefox.exe" ) ;
167
+ #if ! NETCOREAPP2_0
163
168
}
169
+ #endif
164
170
}
165
171
else
166
172
{
@@ -200,8 +206,11 @@ private static string LocateFirefoxBinaryFromPlatform()
200
206
return FindBinary ( new string [ ] { "firefox3" , "firefox" } ) ;
201
207
}
202
208
209
+ #if ! NETCOREAPP2_0
203
210
private static string GetExecutablePathUsingRegistry ( RegistryKey mozillaKey )
204
211
{
212
+ // NOTE: This code is legacy, and will be removed. It will not be
213
+ // fixed for the .NET Core case.
205
214
string currentVersion = ( string ) mozillaKey . GetValue ( "CurrentVersion" ) ;
206
215
if ( string . IsNullOrEmpty ( currentVersion ) )
207
216
{
@@ -224,6 +233,7 @@ private static string GetExecutablePathUsingRegistry(RegistryKey mozillaKey)
224
233
225
234
return path ;
226
235
}
236
+ #endif
227
237
228
238
private static string GetExecutablePathUsingDefaultInstallLocations ( string [ ] defaultInstallLocations , string exeName )
229
239
{
0 commit comments