/// ----------------------------------------------------------------------------- /// <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; }
/// ----------------------------------------------------------------------------- /// <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; }
/// ----------------------------------------------------------------------------- /// <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)); }
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)); } }
/// ----------------------------------------------------------------------------- /// <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); } }
/// ----------------------------------------------------------------------------- /// <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); } }
/// ----------------------------------------------------------------------------- /// <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); } }
/// ----------------------------------------------------------------------------- /// <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); }
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; }
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)); } }
/// ----------------------------------------------------------------------------- /// <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)); }
/// ----------------------------------------------------------------------------- /// <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); } }
/// ----------------------------------------------------------------------------- /// <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; }
/// ----------------------------------------------------------------------------- /// <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); }
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); }
/// ----------------------------------------------------------------------------- /// <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; }
/// ----------------------------------------------------------------------------- /// <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; }
/// ----------------------------------------------------------------------------- /// <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); }