public PackageInstaller(PackageInfo package)
 {
     this.Package = package;
     if (!string.IsNullOrEmpty(package.Manifest))
     {
         XPathDocument  doc = new XPathDocument(new StringReader(package.Manifest));
         XPathNavigator nav = doc.CreateNavigator().SelectSingleNode("package");
         ReadComponents(nav);
     }
     else
     {
         ComponentInstallerBase installer = InstallerFactory.GetInstaller(package.PackageType);
         if (installer != null)
         {
             installer.Package = package;
             installer.Type    = package.PackageType;
             ComponentInstallers.Add(0, installer);
         }
     }
 }
 private void ReadComponents(XPathNavigator manifestNav)
 {
     foreach (XPathNavigator componentNav in manifestNav.CreateNavigator().Select("components/component"))
     {
         int    order = ComponentInstallers.Count;
         string type  = componentNav.GetAttribute("type", "");
         if (InstallMode == InstallMode.Install)
         {
             string installOrder = componentNav.GetAttribute("installOrder", "");
             if (!string.IsNullOrEmpty(installOrder))
             {
                 order = int.Parse(installOrder);
             }
         }
         else
         {
             string unInstallOrder = componentNav.GetAttribute("unInstallOrder", "");
             if (!string.IsNullOrEmpty(unInstallOrder))
             {
                 order = int.Parse(unInstallOrder);
             }
         }
         if (Package.InstallerInfo != null)
         {
             Log.AddInfo(Util.DNN_ReadingComponent + " - " + type);
         }
         ComponentInstallerBase installer = InstallerFactory.GetInstaller(componentNav, Package);
         if (installer == null)
         {
             Log.AddFailure(Util.EXCEPTION_InstallerCreate);
         }
         else
         {
             ComponentInstallers.Add(order, installer);
             this.Package.InstallerInfo.AllowableFiles += ", " + installer.AllowableFiles;
         }
     }
 }