public static bool SolveLinuxToolsDir()
{
if (!Settings.RunningOnWindows())
{
GitCommands.Settings.GitBinDir = "";
return true;
}
if (CheckIfFileIsInPath("sh.exe") || CheckIfFileIsInPath("sh"))
{
GitCommands.Settings.GitBinDir = "";
return true;
}
GitCommands.Settings.GitBinDir = @"c:\Program Files\Git\bin\";
if (!File.Exists(GitCommands.Settings.GitBinDir + "sh.exe") && !File.Exists(GitCommands.Settings.GitBinDir + "sh"))
{
GitCommands.Settings.GitBinDir = @"c:\Program Files (x86)\Git\bin\";
if (!File.Exists(GitCommands.Settings.GitBinDir + "sh.exe") && !File.Exists(GitCommands.Settings.GitBinDir + "sh"))
{
GitCommands.Settings.GitBinDir = "C:\\cygwin\\bin\\";
if (!File.Exists(GitCommands.Settings.GitBinDir + "sh.exe") && !File.Exists(GitCommands.Settings.GitBinDir + "sh"))
{
GitCommands.Settings.GitBinDir = GitCommands.Settings.GitCommand;
GitCommands.Settings.GitBinDir = GitCommands.Settings.GitBinDir.Replace("\\cmd\\git.cmd", "\\bin\\").Replace("\\bin\\git.exe", "\\bin\\");
if (!File.Exists(GitCommands.Settings.GitBinDir + "sh.exe") && !File.Exists(GitCommands.Settings.GitBinDir + "sh"))
{
GitCommands.Settings.GitBinDir = GetRegistryValue(Registry.LocalMachine, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1", "InstallLocation") + "\\bin\\";
if (!File.Exists(GitCommands.Settings.GitBinDir + "sh.exe") && !File.Exists(GitCommands.Settings.GitBinDir + "sh"))
{
GitCommands.Settings.GitBinDir = "";
return false;
}
}
}
}
}
return true;
}