|
|
|
@ -163,12 +163,30 @@ namespace ICSharpCode.Build.Tasks
@@ -163,12 +163,30 @@ namespace ICSharpCode.Build.Tasks
|
|
|
|
|
string FindFxCopPath() |
|
|
|
|
{ |
|
|
|
|
// Code duplication: FxCopWrapper.cs in CodeAnalysis addin
|
|
|
|
|
string fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command")); |
|
|
|
|
if (fxCopPath.Length > 0 && File.Exists(Path.Combine(fxCopPath, ToolName))) { |
|
|
|
|
string fxCopPath = null; |
|
|
|
|
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\EDev")) { |
|
|
|
|
if (key != null) { |
|
|
|
|
fxCopPath = key.GetValue("FxCopDir") as string; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { |
|
|
|
|
return fxCopPath; |
|
|
|
|
} |
|
|
|
|
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev")) { |
|
|
|
|
if (key != null) { |
|
|
|
|
fxCopPath = key.GetValue("FxCopDir") as string; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { |
|
|
|
|
return fxCopPath; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command")); |
|
|
|
|
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { |
|
|
|
|
return fxCopPath; |
|
|
|
|
} |
|
|
|
|
fxCopPath = FromRegistry(Registry.ClassesRoot.OpenSubKey(@"FxCopProject\Shell\Open\Command")); |
|
|
|
|
if (fxCopPath.Length > 0 && File.Exists(Path.Combine(fxCopPath, ToolName))) { |
|
|
|
|
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { |
|
|
|
|
return fxCopPath; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|