Skip to content

Commit

Permalink
Check for ANDROID_HOME Sdk location on Windows. (#230)
Browse files Browse the repository at this point in the history
For some reason we never check for the `%ANDROID_HOME%` environment
variable on Windows.  This might cause issues with people using VSCode
since we probably will be using environment variables as a backup when
using that IDE.

Add a check to use `%ANDROID_HOME%` after checking the registry
entries.  This way Visual Studio and Android SDK Installer paths will
still be preferred.
  • Loading branch information
dellis1972 authored Apr 17, 2024
1 parent 05f9a90 commit c8a5b5b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ protected override IEnumerable<string> GetAllAvailableAndroidSdks ()
if (CheckRegistryKeyForExecutable (root, ANDROID_INSTALLER_PATH, ANDROID_INSTALLER_KEY, wow, "platform-tools", Adb))
yield return RegistryEx.GetValueString (root, ANDROID_INSTALLER_PATH, ANDROID_INSTALLER_KEY, wow) ?? "";

foreach (string dir in GetSdkFromEnvironmentVariables ())
yield return dir;

// Check some hardcoded paths for good measure
var paths = new string [] {
Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData), "Xamarin", "MonoAndroid", "android-sdk-windows"),
Expand Down

0 comments on commit c8a5b5b

Please sign in to comment.