Exemplo n.º 1
0
        public void Extract(string inputFile, string outputDir)
        {
            PSArcXmlFile xml = new PSArcXmlFile(PSArcXmlFile.XmlFileType.Extract);

            xml.OutputFileName = outputDir;
            xml.AddPakToExtract(inputFile);
            Extract(xml);
        }
Exemplo n.º 2
0
        public void Extract(string inputFile, string outputDir, params string[] archiveFiles)
        {
            PSArcXmlFile xml = new PSArcXmlFile(PSArcXmlFile.XmlFileType.Extract | PSArcXmlFile.XmlFileType.ByFile);

            xml.OutputFileName = outputDir;
            xml.AddPakToExtract(inputFile);
            foreach (string s in archiveFiles)
            {
                xml.AddFileToExtract(s);
            }
            Extract(xml);
        }
Exemplo n.º 3
0
        private string writeXmlToFile(PSArcXmlFile xmlFile)
        {
            string tempFilePath = Path.GetTempFileName();

            using (FileStream fs = File.Open(tempFilePath, FileMode.Create, FileAccess.ReadWrite))
                using (StreamWriter sr = new StreamWriter(fs))
                {
                    sr.Write(xmlFile.ToString());
                    sr.Flush();
                }
#if DEBUG
            Console.WriteLine(xmlFile.ToString());
#endif
            return(tempFilePath);
        }
Exemplo n.º 4
0
        public void Create(string outputPath, string inputDirectory)
        {
            PSArcXmlFile xml = new PSArcXmlFile(PSArcXmlFile.XmlFileType.Create | PSArcXmlFile.XmlFileType.ByFile);

            xml.OutputFileName = outputPath;
            xml.InputDirectory = inputDirectory;
            foreach (string s in getFiles(inputDirectory))
            {
                xml.AddFileToPack(s);
            }
            Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
            logAndUpdate("Starting PSARC.", currentOpItemCount, currentOpTotalItems);
            string outputMsg = executeWithXml(writeXmlToFile(xml));

            CreateCommandComplete?.Invoke(new CreateCommandEventArgs(outputMsg));
            logAndUpdate("Done.", 0, 0);
        }
Exemplo n.º 5
0
 public void Extract(PSArcXmlFile xmlFile)
 {
     Extract(writeXmlToFile(xmlFile));
 }