Skip to content

Instantly share code, notes, and snippets.

@steenhulthin
Created November 2, 2013 17:52
Show Gist options
  • Save steenhulthin/7281575 to your computer and use it in GitHub Desktop.
Save steenhulthin/7281575 to your computer and use it in GitHub Desktop.
Getting the path for ApprovalTests VisualStudioReporter from the registry.
public class VisualStudioReporter : GenericDiffReporter
{
private static readonly string DEVENV_REGISTRYKEY =
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe";
private static readonly string PATH = (string)Registry.GetValue(DEVENV_REGISTRYKEY, "", @"Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe");
public static readonly VisualStudioReporter INSTANCE = new VisualStudioReporter();
public VisualStudioReporter()
: base(
PATH,
"/diff \"{0}\" \"{1}\"",
"Couldn't find Visual Studio at " + PATH)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment