diff --git a/GVFS/GVFS.Common/GVFSPlatform.cs b/GVFS/GVFS.Common/GVFSPlatform.cs index 0ec0bd668..6723177ba 100644 --- a/GVFS/GVFS.Common/GVFSPlatform.cs +++ b/GVFS/GVFS.Common/GVFSPlatform.cs @@ -143,7 +143,6 @@ public abstract class GVFSPlatformConstants public abstract string GVFSExecutableName { get; } - public abstract string ProgramLocaterCommand { get; } /// /// Different platforms can have different requirements diff --git a/GVFS/GVFS.Platform.Windows/WindowsGitInstallation.cs b/GVFS/GVFS.Platform.Windows/WindowsGitInstallation.cs index 76b6e22c7..64c4e3dd8 100644 --- a/GVFS/GVFS.Platform.Windows/WindowsGitInstallation.cs +++ b/GVFS/GVFS.Platform.Windows/WindowsGitInstallation.cs @@ -19,7 +19,7 @@ public bool GitExists(string gitBinPath) return File.Exists(gitBinPath); } - return ProcessHelper.GetProgramLocation(GVFSPlatform.Instance.Constants.ProgramLocaterCommand, GitProcessName) != null; + return !string.IsNullOrEmpty(GetInstalledGitBinPath()); } public string GetInstalledGitBinPath() diff --git a/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs b/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs index c79f49196..ecd050535 100644 --- a/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs +++ b/GVFS/GVFS.Platform.Windows/WindowsPlatform.cs @@ -258,14 +258,14 @@ public override bool TryGetGVFSHooksVersion(out string hooksVersion, out string { error = null; hooksVersion = null; - string hooksPath = ProcessHelper.GetProgramLocation(GVFSPlatform.Instance.Constants.ProgramLocaterCommand, GVFSPlatform.Instance.Constants.GVFSHooksExecutableName); - if (hooksPath == null) + string hooksPath = Path.Combine(ProcessHelper.GetCurrentProcessLocation(), GVFSPlatform.Instance.Constants.GVFSHooksExecutableName); + if (hooksPath == null || !File.Exists(hooksPath)) { error = "Could not find " + GVFSPlatform.Instance.Constants.GVFSHooksExecutableName; return false; } - FileVersionInfo hooksFileVersionInfo = FileVersionInfo.GetVersionInfo(Path.Combine(hooksPath, GVFSPlatform.Instance.Constants.GVFSHooksExecutableName)); + FileVersionInfo hooksFileVersionInfo = FileVersionInfo.GetVersionInfo(hooksPath); hooksVersion = hooksFileVersionInfo.ProductVersion; return true; } @@ -444,11 +444,6 @@ public override string GVFSExecutableName get { return "GVFS" + this.ExecutableExtension; } } - public override string ProgramLocaterCommand - { - get { return "where"; } - } - public override HashSet UpgradeBlockingProcesses { get { return new HashSet(GVFSPlatform.Instance.Constants.PathComparer) { "GVFS", "GVFS.Mount", "git", "ssh-agent", "wish", "bash" }; } diff --git a/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs b/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs index e7c5263c4..7e6e32d3e 100644 --- a/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs +++ b/GVFS/GVFS.UnitTests/Mock/Common/MockPlatform.cs @@ -221,11 +221,6 @@ public override string GVFSExecutableName { get { return "MockGVFS" + this.ExecutableExtension; } } - - public override string ProgramLocaterCommand - { - get { return "MockWhere"; } - } public override HashSet UpgradeBlockingProcesses {