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