Example #1
0
        /// <summary>
        /// Returns the fully qualified path to the executable file.
        /// </summary>
        /// <returns>
        /// The fully qualified path to the executable file.
        /// </returns>
        protected override string GenerateFullPathToTool()
        {
            if (string.IsNullOrEmpty(ToolPath) || ToolPath == _initialToolPath && !ToolPathUtil.SafeFileExists(ToolPath, ToolName))
            {
                ToolPath = FindToolPath(ToolName);
            }

            return(Path.Combine(ToolPath, ToolName));
        }
Example #2
0
        private string FindToolPath(string toolName)
        {
            string toolPath =
                ToolPathUtil.FindInRegistry(toolName) ??
                ToolPathUtil.FindInPath(toolName) ??
                ToolPathUtil.FindInProgramFiles(toolName, @"Git\bin");

            if (toolPath == null)
            {
                throw new Exception("Could not find git.exe.  Looked in PATH locations and various common folders inside Program Files.");
            }

            return(toolPath);
        }
Example #3
0
    public static string LocateSVNTool(string _toolName)
    {
        string t   = ToolPathUtil.MakeToolName(_toolName);
        string dir = null;

        try
        {
            dir = FindToolPath(t);
        }
        catch { }
        if (dir == null)
        {
            return("");
        }
        else
        {
            return(System.IO.Path.Combine(dir, t));
        }
    }
Example #4
0
        /// <summary>
        /// Finds the tool path.
        /// </summary>
        /// <param name="toolName">Name of the tool.</param>
        /// <returns></returns>
        public static string FindToolPath(string toolName)
        {
            string toolPath =
                ToolPathUtil.FindInRegistry(toolName) ??
                ToolPathUtil.FindInPath(toolName) ??
                ToolPathUtil.FindInProgramFiles(toolName,
                                                @"Subversion\bin",
                                                @"CollabNet Subversion Server",
                                                @"CollabNet Subversion",
                                                @"CollabNet Subversion Client",
                                                @"VisualSVN\bin",
                                                @"VisualSVN Server\bin",
                                                @"SlikSvn\bin");

            if (toolPath == null)
            {
                throw new Exception("Could not find svn.exe.  Looked in PATH locations and various common folders inside Program Files.");
            }

            return(toolPath);
        }