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