Exemplo n.º 1
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="InstallFile"/> class.
 /// This Constructor creates a new InstallFile instance.
 /// </summary>
 /// <param name="fileName">The fileName of the File.</param>
 /// <param name="sourceFileName">Source file name.</param>
 /// <param name="info">An INstallerInfo instance.</param>
 /// -----------------------------------------------------------------------------
 public InstallFile(string fileName, string sourceFileName, InstallerInfo info)
 {
     this.Encoding = TextEncoding.UTF8;
     this.ParseFileName(fileName);
     this.SourceFileName = sourceFileName;
     this.InstallerInfo  = info;
 }
Exemplo n.º 2
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance
 /// </summary>
 /// <param name="fileName">The fileName of the File</param>
 /// <param name="sourceFileName">Source file name.</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// -----------------------------------------------------------------------------
 public InstallFile(string fileName, string sourceFileName, InstallerInfo info)
 {
     Encoding = TextEncoding.UTF8;
     ParseFileName(fileName);
     SourceFileName = sourceFileName;
     InstallerInfo  = info;
 }
Exemplo n.º 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// This Constructor creates a new Installer instance from a PackageInfo object
        /// </summary>
        /// <param name="package">The PackageInfo instance</param>
        /// <param name="physicalSitePath">The physical path to the root of the site</param>
        /// -----------------------------------------------------------------------------
        public Installer(PackageInfo package, string physicalSitePath)
        {
            Packages      = new SortedList <int, PackageInstaller>();
            InstallerInfo = new InstallerInfo(package, physicalSitePath);

            Packages.Add(Packages.Count, new PackageInstaller(package));
        }
Exemplo n.º 4
0
 public Installer(string manifest, string physicalSitePath, bool loadManifest)
 {
     Packages      = new SortedList <int, PackageInstaller>();
     InstallerInfo = new InstallerInfo(physicalSitePath, InstallMode.ManifestOnly);
     if (loadManifest)
     {
         ReadManifest(new FileStream(manifest, FileMode.Open, FileAccess.Read));
     }
 }
Exemplo n.º 5
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// This Constructor creates a new Installer instance from a string representing
        /// the physical path to the temporary install folder and a string representing 
        /// the physical path to the root of the site
        /// </summary>
        /// <param name="tempFolder">The physical path to the zip file containg the package</param>
        /// <param name="manifest">The manifest filename</param>
        /// <param name="physicalSitePath">The physical path to the root of the site</param>
        /// <param name="loadManifest">Flag that determines whether the manifest will be loaded</param>
        /// -----------------------------------------------------------------------------
        public Installer(string tempFolder, string manifest, string physicalSitePath, bool loadManifest)
        {
            Packages = new SortedList<int, PackageInstaller>();
            //Called from Interactive installer - default IgnoreWhiteList to false
            InstallerInfo = new InstallerInfo(tempFolder, manifest, physicalSitePath) { IgnoreWhiteList = false };

            if (loadManifest)
            {
                ReadManifest(true);
            }
        }
Exemplo n.º 6
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// This Constructor creates a new Installer instance from a Stream and a
        /// string representing the physical path to the root of the site
        /// </summary>
        /// <param name="inputStream">The Stream to use to create this InstallerInfo instance</param>
        /// <param name="physicalSitePath">The physical path to the root of the site</param>
        /// <param name="loadManifest">Flag that determines whether the manifest will be loaded</param>
        /// <param name="deleteTemp">Whether delete the temp folder.</param>
        /// -----------------------------------------------------------------------------
        public Installer(Stream inputStream, string physicalSitePath, bool loadManifest, bool deleteTemp)
        {
            Packages = new SortedList <int, PackageInstaller>();
            //Called from Batch installer - default IgnoreWhiteList to true
            InstallerInfo = new InstallerInfo(inputStream, physicalSitePath)
            {
                IgnoreWhiteList = true
            };

            if (loadManifest)
            {
                ReadManifest(deleteTemp);
            }
        }
Exemplo n.º 7
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// This Constructor creates a new Installer instance from a string representing
        /// the physical path to the temporary install folder and a string representing
        /// the physical path to the root of the site
        /// </summary>
        /// <param name="tempFolder">The physical path to the zip file containg the package</param>
        /// <param name="manifest">The manifest filename</param>
        /// <param name="physicalSitePath">The physical path to the root of the site</param>
        /// <param name="loadManifest">Flag that determines whether the manifest will be loaded</param>
        /// -----------------------------------------------------------------------------
        public Installer(string tempFolder, string manifest, string physicalSitePath, bool loadManifest)
        {
            Packages = new SortedList <int, PackageInstaller>();
            //Called from Interactive installer - default IgnoreWhiteList to false
            InstallerInfo = new InstallerInfo(tempFolder, manifest, physicalSitePath)
            {
                IgnoreWhiteList = false
            };

            if (loadManifest)
            {
                ReadManifest(true);
            }
        }
Exemplo n.º 8
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance from a ZipInputStream and a ZipEntry
 /// </summary>
 /// <remarks>The ZipInputStream is read into a byte array (Buffer), and the ZipEntry is used to
 /// set up the properties of the InstallFile class.</remarks>
 /// <param name="zip">The ZipInputStream</param>
 /// <param name="entry">The ZipEntry</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// -----------------------------------------------------------------------------
 public InstallFile(ZipInputStream zip, ZipEntry entry, InstallerInfo info)
 {
     Encoding = TextEncoding.UTF8;
     InstallerInfo = info;
     ReadZip(zip, entry);
 }
Exemplo n.º 9
0
        public static XPathNavigator ConvertLegacyNavigator(XPathNavigator rootNav, InstallerInfo info)
        {
            XPathNavigator nav = null;

            var packageType = Null.NullString;
            if (rootNav.Name == "dotnetnuke")
            {
                packageType = Util.ReadAttribute(rootNav, "type");
            }
            else if (rootNav.Name.ToLower() == "languagepack")
            {
                packageType = "LanguagePack";
            }

            XPathDocument legacyDoc;
            string legacyManifest;
            switch (packageType.ToLower())
            {
                case "module":
                    var sb = new StringBuilder();
                    var writer = XmlWriter.Create(sb, XmlUtils.GetXmlWriterSettings(ConformanceLevel.Fragment));

                    //Write manifest start element
                    PackageWriterBase.WriteManifestStartElement(writer);

                    //Legacy Module - Process each folder
                    foreach (XPathNavigator folderNav in rootNav.Select("folders/folder"))
                    {
                        var modulewriter = new ModulePackageWriter(folderNav, info);
                        modulewriter.WriteManifest(writer, true);
                    }

                    //Write manifest end element
                    PackageWriterBase.WriteManifestEndElement(writer);

                    //Close XmlWriter
                    writer.Close();

                    //Load manifest into XPathDocument for processing
                    legacyDoc = new XPathDocument(new StringReader(sb.ToString()));

                    //Parse the package nodes
                    nav = legacyDoc.CreateNavigator().SelectSingleNode("dotnetnuke");
                    break;
                case "languagepack":
                    //Legacy Language Pack
                    var languageWriter = new LanguagePackWriter(rootNav, info);
                    info.LegacyError = languageWriter.LegacyError;
                    if (string.IsNullOrEmpty(info.LegacyError))
                    {
                        legacyManifest = languageWriter.WriteManifest(false);
                        legacyDoc = new XPathDocument(new StringReader(legacyManifest));

                        //Parse the package nodes
                        nav = legacyDoc.CreateNavigator().SelectSingleNode("dotnetnuke");
                    }
                    break;
                case "skinobject":
                    //Legacy Skin Object
                    var skinControlwriter = new SkinControlPackageWriter(rootNav, info);
                    legacyManifest = skinControlwriter.WriteManifest(false);
                    legacyDoc = new XPathDocument(new StringReader(legacyManifest));

                    //Parse the package nodes
                    nav = legacyDoc.CreateNavigator().SelectSingleNode("dotnetnuke");
                    break;
            }

            return nav;
        }
Exemplo n.º 10
0
 public Installer(string manifest, string physicalSitePath, bool loadManifest)
 {
     Packages = new SortedList<int, PackageInstaller>();
     InstallerInfo = new InstallerInfo(physicalSitePath, InstallMode.ManifestOnly);
     if (loadManifest)
     {
         ReadManifest(new FileStream(manifest, FileMode.Open, FileAccess.Read));
     }
 }
Exemplo n.º 11
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// This Constructor creates a new Installer instance from a PackageInfo object
        /// </summary>
        /// <param name="package">The PackageInfo instance</param>
        /// <param name="physicalSitePath">The physical path to the root of the site</param>
        /// -----------------------------------------------------------------------------
        public Installer(PackageInfo package, string physicalSitePath)
        {
            Packages = new SortedList<int, PackageInstaller>();
            InstallerInfo = new InstallerInfo(package, physicalSitePath);

            Packages.Add(Packages.Count, new PackageInstaller(package));
        }
Exemplo n.º 12
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// This Constructor creates a new Installer instance from a Stream and a
        /// string representing the physical path to the root of the site
        /// </summary>
        /// <param name="inputStream">The Stream to use to create this InstallerInfo instance</param>
        /// <param name="physicalSitePath">The physical path to the root of the site</param>
        /// <param name="loadManifest">Flag that determines whether the manifest will be loaded</param>
        /// <param name="deleteTemp">Whether delete the temp folder.</param>
        /// -----------------------------------------------------------------------------
        public Installer(Stream inputStream, string physicalSitePath, bool loadManifest, bool deleteTemp)
        {
            Packages = new SortedList<int, PackageInstaller>();
            //Called from Batch installer - default IgnoreWhiteList to true
            InstallerInfo = new InstallerInfo(inputStream, physicalSitePath) { IgnoreWhiteList = true };

            if (loadManifest)
            {
                ReadManifest(deleteTemp);
            }
        }
Exemplo n.º 13
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance
 /// </summary>
 /// <param name="fileName">The fileName of the File</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// <history>
 /// 	[cnurse]	07/31/2007  created
 /// </history>
 /// -----------------------------------------------------------------------------
 public InstallFile(string fileName, InstallerInfo info)
 {
     ParseFileName(fileName);
     _InstallerInfo = info;
 }
Exemplo n.º 14
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="InstallFile"/> class.
 /// This Constructor creates a new InstallFile instance from a ZipInputStream and a ZipEntry.
 /// </summary>
 /// <remarks>The ZipInputStream is read into a byte array (Buffer), and the ZipEntry is used to
 /// set up the properties of the InstallFile class.</remarks>
 /// <param name="zip">The ZipInputStream.</param>
 /// <param name="entry">The ZipEntry.</param>
 /// <param name="info">An INstallerInfo instance.</param>
 /// -----------------------------------------------------------------------------
 public InstallFile(ZipInputStream zip, ZipEntry entry, InstallerInfo info)
 {
     this.Encoding      = TextEncoding.UTF8;
     this.InstallerInfo = info;
     this.ReadZip(zip, entry);
 }
Exemplo n.º 15
0
        public static XPathNavigator ConvertLegacyNavigator(XPathNavigator rootNav, InstallerInfo info)
        {
            XPathNavigator nav = null;

            var packageType = Null.NullString;

            if (rootNav.Name == "dotnetnuke")
            {
                packageType = Util.ReadAttribute(rootNav, "type");
            }
            else if (rootNav.Name.ToLower() == "languagepack")
            {
                packageType = "LanguagePack";
            }

            XPathDocument legacyDoc;
            string        legacyManifest;

            switch (packageType.ToLower())
            {
            case "module":
                var sb     = new StringBuilder();
                var writer = XmlWriter.Create(sb, XmlUtils.GetXmlWriterSettings(ConformanceLevel.Fragment));

                //Write manifest start element
                PackageWriterBase.WriteManifestStartElement(writer);

                //Legacy Module - Process each folder
                foreach (XPathNavigator folderNav in rootNav.Select("folders/folder"))
                {
                    var modulewriter = new ModulePackageWriter(folderNav, info);
                    modulewriter.WriteManifest(writer, true);
                }

                //Write manifest end element
                PackageWriterBase.WriteManifestEndElement(writer);

                //Close XmlWriter
                writer.Close();

                //Load manifest into XPathDocument for processing
                legacyDoc = new XPathDocument(new StringReader(sb.ToString()));

                //Parse the package nodes
                nav = legacyDoc.CreateNavigator().SelectSingleNode("dotnetnuke");
                break;

            case "languagepack":
                //Legacy Language Pack
                var languageWriter = new LanguagePackWriter(rootNav, info);
                info.LegacyError = languageWriter.LegacyError;
                if (string.IsNullOrEmpty(info.LegacyError))
                {
                    legacyManifest = languageWriter.WriteManifest(false);
                    legacyDoc      = new XPathDocument(new StringReader(legacyManifest));

                    //Parse the package nodes
                    nav = legacyDoc.CreateNavigator().SelectSingleNode("dotnetnuke");
                }
                break;

            case "skinobject":
                //Legacy Skin Object
                var skinControlwriter = new SkinControlPackageWriter(rootNav, info);
                legacyManifest = skinControlwriter.WriteManifest(false);
                legacyDoc      = new XPathDocument(new StringReader(legacyManifest));

                //Parse the package nodes
                nav = legacyDoc.CreateNavigator().SelectSingleNode("dotnetnuke");
                break;
            }

            return(nav);
        }
Exemplo n.º 16
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance
 /// </summary>
 /// <param name="fileName">The fileName of the File</param>
 /// <param name="sourceFileName">Source file name.</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// <history>
 /// 	[cnurse]	07/31/2007  created
 /// </history>
 /// -----------------------------------------------------------------------------
 public InstallFile(string fileName, string sourceFileName, InstallerInfo info)
 {
     ParseFileName(fileName);
     _SourceFileName = sourceFileName;
     _InstallerInfo = info;
 }
Exemplo n.º 17
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance
 /// </summary>
 /// <param name="fileName">The fileName of the File</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// -----------------------------------------------------------------------------
 public InstallFile(string fileName, InstallerInfo info)
 {
     Encoding = TextEncoding.UTF8;
     ParseFileName(fileName);
     InstallerInfo = info;
 }
Exemplo n.º 18
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance from a ZipInputStream and a ZipEntry
 /// </summary>
 /// <remarks>The ZipInputStream is read into a byte array (Buffer), and the ZipEntry is used to
 /// set up the properties of the InstallFile class.</remarks>
 /// <param name="zip">The ZipInputStream</param>
 /// <param name="entry">The ZipEntry</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// <history>
 ///     [cnurse]	07/24/2007  created
 /// </history>
 /// -----------------------------------------------------------------------------
 public InstallFile(ZipInputStream zip, ZipEntry entry, InstallerInfo info)
 {
     _InstallerInfo = info;
     ReadZip(zip, entry);
 }
Exemplo n.º 19
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance
 /// </summary>
 /// <param name="fileName">The fileName of the File</param>
 /// <param name="sourceFileName">Source file name.</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// <history>
 ///     [cnurse]	07/31/2007  created
 /// </history>
 /// -----------------------------------------------------------------------------
 public InstallFile(string fileName, string sourceFileName, InstallerInfo info)
 {
     ParseFileName(fileName);
     _SourceFileName = sourceFileName;
     _InstallerInfo  = info;
 }
Exemplo n.º 20
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance
 /// </summary>
 /// <param name="fileName">The fileName of the File</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// <history>
 ///     [cnurse]	07/31/2007  created
 /// </history>
 /// -----------------------------------------------------------------------------
 public InstallFile(string fileName, InstallerInfo info)
 {
     ParseFileName(fileName);
     _InstallerInfo = info;
 }
Exemplo n.º 21
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// This Constructor creates a new InstallFile instance from a ZipInputStream and a ZipEntry
 /// </summary>
 /// <remarks>The ZipInputStream is read into a byte array (Buffer), and the ZipEntry is used to
 /// set up the properties of the InstallFile class.</remarks>
 /// <param name="zip">The ZipInputStream</param>
 /// <param name="entry">The ZipEntry</param>
 /// <param name="info">An INstallerInfo instance</param>
 /// <history>
 /// 	[cnurse]	07/24/2007  created
 /// </history>
 /// -----------------------------------------------------------------------------
 public InstallFile(ZipInputStream zip, ZipEntry entry, InstallerInfo info)
 {
     _InstallerInfo = info;
     ReadZip(zip, entry);
 }