Ejemplo n.º 1
0
        void GetMediaPortalPath(ref editorPaths mpPaths)
        {
            string sRegRoot = "SOFTWARE";

            if (IntPtr.Size > 4)
            {
                sRegRoot += "\\Wow6432Node";
            }
            try
            {
                RegistryKey MediaPortalKey = Registry.LocalMachine.OpenSubKey(sRegRoot + "\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MediaPortal\\", false);
                if (MediaPortalKey != null)
                {
                    mpPaths.sMPbaseDir = MediaPortalKey.GetValue("InstallPath").ToString();
                }
                else
                {
                    MediaPortalKey = MediaPortalKey.OpenSubKey(sRegRoot + "\\Team MediaPortal\\MediaPortal\\", false);
                    if (MediaPortalKey != null)
                    {
                        mpPaths.sMPbaseDir = MediaPortalKey.GetValue("ApplicationDir").ToString();
                    }
                    else
                    {
                        mpPaths.sMPbaseDir = null;
                    }
                }
            }
            catch (Exception e)
            {
                Logger.Error("Exception while attempting to read MediaPortal location from registry\n\nMediaPortal must be installed, is MediaPortal Installed?\n\n" + e.Message.ToString());
                mpPaths.sMPbaseDir = null;
            }
        }
Ejemplo n.º 2
0
        private void GetMediaPortalPath(ref editorPaths mpPaths)
        {
            string sRegRoot = "SOFTWARE";

              if (IntPtr.Size > 4)
            sRegRoot += "\\Wow6432Node";

              try
              {

            RegistryKey MediaPortalKey = Registry.LocalMachine.OpenSubKey(sRegRoot + "\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MediaPortal\\", false);
            if (MediaPortalKey != null)
            {
              mpPaths.sMPbaseDir = MediaPortalKey.GetValue("InstallPath").ToString();

            }
            else
            {
              MediaPortalKey = MediaPortalKey.OpenSubKey(sRegRoot + "\\Team MediaPortal\\MediaPortal\\", false);
              if (MediaPortalKey != null)
              {
            mpPaths.sMPbaseDir = MediaPortalKey.GetValue("ApplicationDir").ToString();

              }
              else
            mpPaths.sMPbaseDir = null;
            }
              }
              catch (Exception e)
              {
            helper.showError("Exception while attempting to read MediaPortal location from registry\n\nMediaPortal must be installed, is MediaPortal Installed?\n\n" + e.Message, errorCode.major);
            mpPaths.sMPbaseDir = null;
              }
        }