private void ResolveDiffToolPath()
{
if (!Settings.RunningOnWindows())
return;
GitCommands.GitCommands gitCommands = new GitCommands.GitCommands();
if (GlobalDiffTool.Text.Equals("kdiff3", StringComparison.CurrentCultureIgnoreCase))
{
string kdiff3path = gitCommands.GetGlobalSetting("difftool.kdiff3.path");
if (!kdiff3path.ToLower().Contains("kdiff3.exe"))
kdiff3path = "";
if (string.IsNullOrEmpty(kdiff3path) || !File.Exists(kdiff3path))
{
kdiff3path = @"c:\Program Files\KDiff3\kdiff3.exe";
if (string.IsNullOrEmpty(kdiff3path) || !File.Exists(kdiff3path))
{
kdiff3path = @"c:\Program Files (x86)\KDiff3\kdiff3.exe";
if (string.IsNullOrEmpty(kdiff3path) || !File.Exists(kdiff3path))
{
kdiff3path = GetRegistryValue(Registry.LocalMachine, "SOFTWARE\\KDiff3", "") + "\\kdiff3.exe";
if (string.IsNullOrEmpty(kdiff3path) || !File.Exists(kdiff3path))
{
kdiff3path = MergetoolPath.Text;
if (!kdiff3path.ToLower().Contains("kdiff3.exe"))
kdiff3path = "";
}
}
}
}
DifftoolPath.Text = kdiff3path;
}
}