Example #1
0
        /// <summary>
        /// The full path of the tool to execute.
        /// </summary>
        override protected string GenerateFullPathToTool()
        {
            string pathToTool = null;

            if (String.IsNullOrEmpty(pathToTool) || !File.Exists(pathToTool))
            {
                pathToTool = SdkToolsPathUtility.GeneratePathToTool(SdkToolsPathUtility.FileInfoExists, Microsoft.Build.Utilities.ProcessorArchitecture.CurrentProcessArchitecture, SdkToolsPath, ToolName, Log, true);
            }

            return(pathToTool);
        }
Example #2
0
        protected override string GenerateFullPathToTool()
        {
            string pathToDotNetFrameworkFile = null;

            if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("COMPLUS_InstallRoot")) || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("COMPLUS_Version")))
            {
                pathToDotNetFrameworkFile = ToolLocationHelper.GetPathToDotNetFrameworkFile(this.ToolName, TargetDotNetFrameworkVersion.Version40);
            }
            if (!string.IsNullOrEmpty(pathToDotNetFrameworkFile) && File.Exists(pathToDotNetFrameworkFile))
            {
                return(pathToDotNetFrameworkFile);
            }
            return(SdkToolsPathUtility.GeneratePathToTool(SdkToolsPathUtility.FileInfoExists, ProcessorArchitecture.CurrentProcessArchitecture, this.SdkToolsPath, this.ToolName, base.Log, true));
        }
Example #3
0
        /// <summary>
        /// Generates the full path to the tool being executed by this ToolTask
        /// </summary>
        /// <returns>A string containing the full path of this tool, or null if the tool was not found</returns>
        protected override string GenerateFullPathToTool()
        {
            string pathToTool = null;

            pathToTool = SdkToolsPathUtility.GeneratePathToTool
                         (
                SdkToolsPathUtility.FileInfoExists,
                Microsoft.Build.Utilities.ProcessorArchitecture.CurrentProcessArchitecture,
                SdkToolsPath,
                ToolName,
                Log,
                true
                         );

            return(pathToTool);
        }
Example #4
0
        /// <summary>
        /// Return the path of the tool to execute
        /// </summary>
        override protected string GenerateFullPathToTool()
        {
            string pathToTool = null;

            // If COMPLUS_InstallRoot\COMPLUS_Version are set (the dogfood world), we want to find it there, instead of
            // the SDK, which may or may not be installed. The following will look there.
            if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("COMPLUS_InstallRoot")) || !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("COMPLUS_Version")))
            {
                pathToTool = ToolLocationHelper.GetPathToDotNetFrameworkFile(ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
            }

            if (String.IsNullOrEmpty(pathToTool) || !File.Exists(pathToTool))
            {
                pathToTool = SdkToolsPathUtility.GeneratePathToTool(SdkToolsPathUtility.FileInfoExists, Microsoft.Build.Utilities.ProcessorArchitecture.CurrentProcessArchitecture, SdkToolsPath, ToolExe, Log, true);
            }

            return(pathToTool);
        }
Example #5
0
            /// <summary>
            /// Generates the full path to ResGen.exe.
            /// </summary>
            /// <returns>The path to ResGen.exe, or null.</returns>
            private string GenerateResGenFullPath()
            {
                string pathToTool = null;

                // Use ToolPath if it exists.
                pathToTool = (string)Bag["ToolPathWithFile"];

                if (pathToTool == null)
                {
                    // First see if the user has set ToolPath
                    if (ToolPath != null)
                    {
                        pathToTool = Path.Combine(ToolPath, ToolExe);

                        if (!File.Exists(pathToTool))
                        {
                            pathToTool = null;
                        }
                    }

                    // If it still hasn't been found, try to generate the appropriate path.
                    if (pathToTool == null)
                    {
                        pathToTool = SdkToolsPathUtility.GeneratePathToTool
                                     (
                            SdkToolsPathUtility.FileInfoExists,
                            MSBuildProcessorArchitecture.CurrentProcessArchitecture,
                            SdkToolsPath,
                            ToolName,
                            Log,
                            true                 /* log errors and warnings */
                                     );

                        pathToTool = NativeMethodsShared.GetLongFilePath(pathToTool);
                    }

                    // And then set it for future reference.  If it's still null, there's nothing else
                    // we can do, and we've already logged an appropriate error.
                    Bag["ToolPathWithFile"] = pathToTool;
                }

                return(pathToTool);
            }
Example #6
0
 protected override string GenerateFullPathToTool()
 {
     return(SdkToolsPathUtility.GeneratePathToTool(SdkToolsPathUtility.FileInfoExists, Microsoft.Build.Utilities.ProcessorArchitecture.CurrentProcessArchitecture, this.SdkToolsPath, this.ToolName, base.Log, true));
 }