Ejemplo n.º 1
0
        protected override DetectedLocations getPaths(LocationRegistry get_me)
        {
            DetectedLocations return_me = new DetectedLocations();

            RegistryHandler reg;

            // This handles if the root is a registry key
            if (get_me.Key != null)
            {
                reg = new RegistryHandler(get_me.Root, get_me.Key, false);

                if (reg.key_found)
                {
                    try {
                        string path;
                        if (get_me.Value == null)
                        {
                            path = reg.getValue("");
                        }
                        else
                        {
                            path = reg.getValue(get_me.Value);
                        }

                        if (path != null)
                        {
                            if (path.Contains("/"))
                            {
                                path = path.Split('/')[0].Trim();
                            }

                            if (path.Contains("\""))
                            {
                                path = path.Trim('\"').Trim();
                            }

                            if (Path.HasExtension(path))
                            {
                                path = Path.GetDirectoryName(path);
                            }

                            path = get_me.modifyPath(path);
                            if (Directory.Exists(path))
                            {
                                return_me.AddRange(Core.locations.interpretPath(new DirectoryInfo(path).FullName));
                            }
                        }
                    } catch (Exception e) {
                        throw new TranslateableException("RegistryKeyLoadError", e);
                    }
                }
            }
            return(return_me);
        }
Ejemplo n.º 2
0
 protected virtual DetectedLocations getPaths(LocationRegistry get_me)
 {
     return(new DetectedLocations());
 }