Example #1
0
        private static bool ReadBoolRegKey(string key, bool defaultValue)
        {
            object obj = VersionIndependentRegKey.GetValue(key);

            if (!(obj is string))
            {
                obj = null;
            }
            if (obj == null)
            {
                return(defaultValue);
            }
            return(((string)obj).Equals("true", StringComparison.CurrentCultureIgnoreCase));
        }
Example #2
0
        public static string GetInstallDir()
        {
#if DEBUG
#if INSTALL_DIR_FROM_REG
            VersionIndependentRegKey.GetValue("InstallDir", string.Empty);
#else
            string gitExtDir = GetGitExtensionsDirectory().TrimEnd('\\').TrimEnd('/');
            string debugPath = @"GitExtensions\bin\Debug";
            int    len       = debugPath.Length;
            var    path      = gitExtDir.Substring(gitExtDir.Length - len);
            if (debugPath.Replace('\\', '/').Equals(path.Replace('\\', '/')))
            {
                string projectPath = gitExtDir.Substring(0, len + 2);
                return(Path.Combine(projectPath, "Bin"));
            }
#endif
#endif

            return(GetGitExtensionsDirectory());
        }
Example #3
0
 //for repair only
 public static void SetInstallDir(string dir)
 {
     VersionIndependentRegKey.SetValue("InstallDir", dir);
 }
Example #4
0
 private static void WriteStringRegValue(string key, string value)
 {
     VersionIndependentRegKey.SetValue(key, value);
 }
Example #5
0
 private static string ReadStringRegValue(string key, string defaultValue)
 {
     return((string)VersionIndependentRegKey.GetValue(key, defaultValue));
 }
Example #6
0
 private static void WriteBoolRegKey(string key, bool value)
 {
     VersionIndependentRegKey.SetValue(key, value ? "true" : "false");
 }