private void InstallEntry(ParallelReadableZipArchiveEntry entry, string targetPath) { var directoryName = Path.GetDirectoryName(targetPath); Directory.CreateDirectory(directoryName); entry.ExtractToFile(targetPath, true); }
public FileWithVersionInNameUpgradeAction(ParallelReadableZipArchiveEntry installedEntry, Version installedVersion, ParallelReadableZipArchiveEntry newEntry, Version newVersion, string targetPath) { this.installedEntry = installedEntry; this.installedVersion = installedVersion; this.newEntry = newEntry; this.newVersion = newVersion; this.rootPathOfApplication = targetPath; }
public Version GetVersion(ParallelReadableZipArchiveEntry entry) { int startIndex = entry.FullName.IndexOf(fileDeploymentKey + "/") + fileDeploymentKey.Length + 1; int endIndex = entry.FullName.IndexOf("/", startIndex); string version = entry.FullName.Substring(startIndex, endIndex - startIndex); return(new Version(version)); }
private void UpgradeEntry(ParallelReadableZipArchiveEntry entry, string targetPath) { if (File.Exists(targetPath)) { var existingFileLastWriteTime = File.GetLastWriteTimeUtc(targetPath); var entryLastWriteTime = entry.LastWriteTime.UtcDateTime; if (existingFileLastWriteTime.Equals(entryLastWriteTime)) { return; } } InstallEntry(entry, targetPath); }
public FileWithVersionInNameRemoveAction(ParallelReadableZipArchiveEntry zipArchiveEntry, Version version, string targetPath) { this.targetPath = targetPath; this.version = version; }
public void AddRemovedEntry(ParallelReadableZipArchiveEntry removedEntry, string removedEntryRelativeFullName) { var targetPath = GetTargetPath(removedEntryRelativeFullName); deploymentComponents.Add(new FileRemoveAction(removedEntry, targetPath)); }
public void AddNewEntry(ParallelReadableZipArchiveEntry newEntry, string newEntryRelativeFullName) { var targetPath = GetTargetPath(newEntryRelativeFullName); deploymentComponents.Add(new FileUpgradeAction(newEntry, targetPath)); }
private void RemoveEntry(ParallelReadableZipArchiveEntry entry, string targetPath) { File.Delete(targetPath); }
public FileRemoveAction(ParallelReadableZipArchiveEntry zipArchiveEntry, string targetPath) { entry = zipArchiveEntry; this.targetPath = targetPath; }
public string GetRelativePathWithOutKeyAndVersion(ParallelReadableZipArchiveEntry entry, string key, Version version) { string relativePath = entry.FullName.Remove(0, key.Length + 1 + version.ToString().Length + 1); return(relativePath); }
private bool ResponsibleFor(ParallelReadableZipArchiveEntry entry) { return(entry.FullName.StartsWith(fileDeploymentKey, StringComparison.OrdinalIgnoreCase)); }
private void AddRemovedEntry(ParallelReadableZipArchiveEntry removedEntry, Version removedVersion, string removedEntryRelativeFullName) { var targetPath = GetTargetPath(removedEntryRelativeFullName); deploymentComponents.Add(new FileWithVersionInNameRemoveAction(removedEntry, removedVersion, targetPath)); }
private void AddNewEntry(ParallelReadableZipArchiveEntry newEntry, Version newVersion, string newEntryRelativeFullName) { var targetPath = GetTargetPath(newEntryRelativeFullName); deploymentComponents.Add(new FileWithVersionInNameInstallAction(newEntry, newVersion, targetPath)); }
public FileUpgradeAction(ParallelReadableZipArchiveEntry zipArchiveEntry, string targetPath) { entry = zipArchiveEntry; this.rootPathOfApplication = targetPath; }
public string GetRelativePathWithOutKey(ParallelReadableZipArchiveEntry entry, string key) { string relativePath = entry.FullName.Remove(0, key.Length + 1); return(relativePath); }