public void Stage(DeploymentStager stager, XElement xmlElement)
        {
            FileInfo file = new FileInfo(path);

            // Get the pre-compress data.
            hash = FileVerification.GetSHA1Hash(path);
            size = file.Length;

            // Compress.
            if (!Directory.Exists("staging")) Directory.CreateDirectory("staging");
            string compressPath = "staging\\" + file.Name + ".lzma";
            SevenzipCompresser compresser = new SevenzipCompresser(path);
            int ExitCode = compresser.compress(compressPath);

            // Get the data for the compressed file.
            FileInfo archive = new FileInfo(compressPath);
            downloadHash = FileVerification.GetSHA1Hash(compressPath);
            downloadSize = archive.Length;

            // Update the XML.
            xmlElement.SetAttributeValue("hash", hash);
            xmlElement.SetAttributeValue("downloadHash", downloadHash);
            xmlElement.SetAttributeValue("size", size);
            xmlElement.SetAttributeValue("downloadSize", downloadSize);
        }
        public void Stage(DeploymentStager stager, XElement xmlElement)
        {
            FileInfo file = new FileInfo(path);

            // Get the pre-compress data.
            hash = FileVerification.GetSHA1Hash(path);
            size = file.Length;

            // Compress.
            if (!Directory.Exists("staging"))
            {
                Directory.CreateDirectory("staging");
            }
            string             compressPath = "staging\\" + file.Name + ".lzma";
            SevenzipCompresser compresser   = new SevenzipCompresser(path);
            int ExitCode = compresser.compress(compressPath);

            // Get the data for the compressed file.
            FileInfo archive = new FileInfo(compressPath);

            downloadHash = FileVerification.GetSHA1Hash(compressPath);
            downloadSize = archive.Length;

            // Update the XML.
            xmlElement.SetAttributeValue("hash", hash);
            xmlElement.SetAttributeValue("downloadHash", downloadHash);
            xmlElement.SetAttributeValue("size", size);
            xmlElement.SetAttributeValue("downloadSize", downloadSize);
        }
示例#3
0
        static void Main(string[] args)
        {
            DeploymentStager StagingTool = new DeploymentStager();

            try
            {
                StagingTool.Run();
            }
            catch (Exception e)
            {
                Console.WriteLine(String.Format("ERROR: {0}", e.Message));
                StreamWriter log = File.AppendText(GenericLogFilename);
                log.WriteLine("{0}", e);
                log.Close();
            }

            // Pause for user interaction before closing.
            Console.Write("Press any key to exit.");
            Console.ReadKey(true);
        }
        static void Main(string[] args)
        {
            DeploymentStager StagingTool = new DeploymentStager();

            try
            {
                StagingTool.Run();
            }
            catch (Exception e)
            {
                Console.WriteLine(String.Format("ERROR: {0}", e.Message));
                StreamWriter log = File.AppendText(GenericLogFilename);
                log.WriteLine("{0}", e);
                log.Close();
            }

            // Pause for user interaction before closing.
            Console.Write("Press any key to exit.");
            Console.ReadKey(true);
        }