protected static bool LoadManifest(string PackageFolder, PackageContentType contentType, out PackageManifest manifest)
        {
            manifest = new PackageManifest(contentType);
              if (!Directory.Exists(PackageFolder))
            return false;

              string[] files = Directory.GetFiles(PackageFolder, PackageManifestName);
              if (files.Length == 0)
              {
            ReportProgress("LoadManifest() did not find " + PackageManifestName + " for package at: " + PackageFolder, LogLevel.Debug);
            return false;
              }

              manifest.ReadXml(files[0]);
              if (!manifest.IsValid())
              {
            ReportProgress(string.Format("{0}::LoadManifest() {1} not valid.", contentType.ToString(), PackageManifestName), LogLevel.Debug);
            return false;
              }

              manifest.Path = PackageFolder;
              ReportProgress(string.Format("{0}::LoadManifest() {1} recognized.", contentType.ToString(), PackageManifestName), LogLevel.Debug);

              return true;
        }
        public override RMA.RhiExec.Engine.PackageInstallState GetInstallState(Package package)
        {
            PackageManifest manifestInstalled = new PackageManifest(m_content_type);
              if (!LoadManifest(this.InstallFolder(InstallerEngine.InstallRoot(this.InstallRoot)), m_content_type, out manifestInstalled))
            return PackageInstallState.NotInstalled;

              PackageManifest manifestNew = new PackageManifest(m_content_type);
              if (!LoadManifest(PackagePath, m_content_type, out manifestNew))
            throw new ManifestFileNotFoundException(PackagePath);

              if (manifestInstalled.VersionNumber > manifestNew.VersionNumber)
            return PackageInstallState.NewerVersionInstalledCurrentUser;
              else if (manifestInstalled.VersionNumber == manifestNew.VersionNumber)
            return PackageInstallState.SameVersionInstalledCurrentUser;
              else if (manifestInstalled.VersionNumber < manifestNew.VersionNumber)
            return PackageInstallState.OlderVersionInstalledCurrentUser;
              else
            return PackageInstallState.NotInstalled;
        }
        protected static bool LoadManifest(string PackageFolder, PackageContentType contentType, out PackageManifest manifest)
        {
            manifest = new PackageManifest(contentType);
            if (!Directory.Exists(PackageFolder))
            {
                return(false);
            }

            string[] files = Directory.GetFiles(PackageFolder, PackageManifestName);
            if (files.Length == 0)
            {
                ReportProgress("LoadManifest() did not find " + PackageManifestName + " for package at: " + PackageFolder, LogLevel.Debug);
                return(false);
            }

            manifest.ReadXml(files[0]);
            if (!manifest.IsValid())
            {
                ReportProgress(string.Format("{0}::LoadManifest() {1} not valid.", contentType.ToString(), PackageManifestName), LogLevel.Debug);
                return(false);
            }

            manifest.Path = PackageFolder;
            ReportProgress(string.Format("{0}::LoadManifest() {1} recognized.", contentType.ToString(), PackageManifestName), LogLevel.Debug);

            return(true);
        }