Ejemplo n.º 1
0
        internal static string GetOfficeVersion(byte[] bytes, string hivePath)
        {
            NamedKey OfficeKey = null;

            try
            {
                OfficeKey = NamedKey.Get(bytes, hivePath, @"Software\Microsoft\Office");
            }
            catch
            {
                throw new Exception(String.Format("Microsoft Office is not installed on this system"));
            }

            foreach (NamedKey nk in OfficeKey.GetSubKeys(bytes))
            {
                if (nk.Name.Contains(@".0"))
                {
                    if (nk.Name != "8.0")
                    {
                        return(nk.FullName.Split('\\')[4]);
                    }
                }
            }

            throw new Exception("Could not locate the Microsoft Office registry key");
        }
Ejemplo n.º 2
0
        internal static NamedKey GetOfficeKey(byte[] bytes, string path)
        {
            string key = @"Software\Microsoft\Office";

            NamedKey OfficeKey = null;

            try
            {
                OfficeKey = NamedKey.Get(bytes, path, key);
            }
            catch
            {
                throw new Exception(String.Format("Microsoft Office is not installed on this system"));
            }

            foreach (NamedKey nk in OfficeKey.GetSubKeys(bytes))
            {
                if (nk.Name.Contains(@".0"))
                {
                    if (nk.Name != "8.0")
                    {
                        return(nk);
                    }
                }
            }

            throw new Exception("Could not locate the Microsoft Office registry key");
        }
Ejemplo n.º 3
0
 public static NamedKey Get(string path, string key)
 {
     return(NamedKey.Get(RegistryHelper.GetHiveBytes(path), path, key.TrimEnd('\\')));
 }
Ejemplo n.º 4
0
 public static NamedKey Get(string path, string key)
 {
     return(NamedKey.Get(Helper.GetHiveBytes(path), path, key));
 }