예제 #1
0
            public static string DetectPath()
            {
                string path  = @"C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe";
                string clsid = "{2F410E77-24FD-4788-8412-3810115E7BCB}";

                if (RegistryKey64.Is64BitOperatingSystem())
                {
                    clsid = "{41E0355D-F488-487D-B7BA-D235D5834F1D}";
                }
                RegistryKey64 key = RegistryKey64.OpenKey(RegistryHive.ClassesRoot, @"CLSID\" + clsid + @"\InprocServer32", false, RegistryKey64.RegWow64Options.None);

                if (key != null)
                {
                    try
                    {
                        path = key.GetValue("") as string;
                        if (path != null)
                        {
                            path = path.Substring(0, path.LastIndexOf('\\') + 1) + "sgdm.exe";
                        }
                    }
                    finally
                    {
                        key.Close();
                    }
                }
                return(path);
            }
예제 #2
0
            protected static RegistryKey64 Open64Or32Key(RegistryHive hKey, string subkey)
            {
                RegistryKey64 key;

                key = RegistryKey64.OpenKey(hKey, subkey, false, RegistryKey64.RegWow64Options.KEY_WOW64_64KEY);
                if (key != null)
                {
                    return(key);
                }

                key = RegistryKey64.OpenKey(hKey, subkey, false, RegistryKey64.RegWow64Options.KEY_WOW64_32KEY);
                return(key);
            }
예제 #3
0
            public static string DetectPath_TortoiseProc()
            {
                string        path = null;
                RegistryKey64 key  = Open64Or32Key(RegistryHive.LocalMachine, @"SOFTWARE\TortoiseSVN");

                if (key != null)
                {
                    try
                    {
                        path = key.GetValue("ProcPath") as string;
                    }
                    finally
                    {
                        key.Close();
                    }
                }
                return(path);
            }
예제 #4
0
            public string DetectUDiff()
            {
                string        path = "";
                RegistryKey64 key  = Open64Or32Key(RegistryHive.LocalMachine, @"SOFTWARE\TortoiseSVN");

                if (key != null)
                {
                    try
                    {
                        path  = key.GetValue("Directory") as string;
                        path += @"bin\TortoiseUDiff.exe";
                    }
                    finally
                    {
                        key.Close();
                    }
                }
                return(path);
            }
예제 #5
0
            public static string DetectPath()
            {
                string        path = "";
                RegistryKey64 key  = Open64Or32Key(RegistryHive.LocalMachine, @"SOFTWARE\KDiff3");

                if (key != null)
                {
                    try
                    {
                        path = key.GetValue("") as string;
                        if (path != null)
                        {
                            path += @"\kdiff3.exe";
                        }
                    }
                    finally
                    {
                        key.Close();
                    }
                }
                return(path);
            }
예제 #6
0
            public static string DetectPath()
            {
                string        path = "";
                RegistryKey64 key  = Open64Or32Key(RegistryHive.CurrentUser, @"SOFTWARE\Thingamahoochie\WinMerge");

                if (key != null)
                {
                    try
                    {
                        path = key.GetValue("Executable") as string;
                    }
                    finally
                    {
                        key.Close();
                    }
                }
                if (path == null)
                {
                    key = RegistryKey64.OpenKey(RegistryHive.ClassesRoot, @"CLSID\{4E716236-AA30-4C65-B225-D68BBA81E9C2}\InprocServer32", false, RegistryKey64.RegWow64Options.KEY_WOW64_32KEY);
                    if (key != null)
                    {
                        try
                        {
                            path = key.GetValue("") as string;
                            if (path != null)
                            {
                                path = path.Substring(0, path.LastIndexOf('\\') + 1) + "WinMergeU.exe";
                            }
                        }
                        finally
                        {
                            key.Close();
                        }
                    }
                }
                return(path);
            }