public IPreparedUpdate PrepareUpdate(IPackage package) { if (package == null) { throw new ArgumentNullException("package"); } if (package.Id != _appPackageId) { throw new ArgumentException(String.Format("Parameter Package ID {0} does not match expected package ID {1}", package.Id, _appPackageId), "package"); } AssertCanUpdate(package.Version); var prepDirectory = Path.Combine(_fileSystem.AppDirectory, ".updates", package.Version.ToString()); var preparedFiles = new List <string>(); foreach (var packageFile in package.GetFiles("app")) { var targetPath = Path.Combine(prepDirectory, Get(packageFile.Path, relativeTo: "app")); _fileSystem.AddFile(targetPath, packageFile.GetStream()); preparedFiles.Add(targetPath); } return(new PreparedUpdate(package.Version, preparedFiles)); }
private IPreparedUpdate PrepareUpdate(AppUpdater updater, IExtendedFileSystem fileSystem, IPackage package) { if (package == null) { throw new ArgumentNullException("package"); } if (package.Version < updater.CurrentVersion) { throw new BackwardUpdateException(updater.CurrentVersion, package.Version); } var prepDirectory = Path.Combine(fileSystem.AppDirectory, ".updates", package.Version.ToString()); var preparedFiles = new List <string>(); foreach (var packageFile in package.GetFiles("tools")) { var targetPath = Path.Combine(prepDirectory, Get(packageFile.Path, relativeTo: "app")); fileSystem.AddFile(targetPath, packageFile.GetStream()); preparedFiles.Add(targetPath); } return(new PreparedUpdate(package.Version, preparedFiles)); }
private IPreparedUpdate PrepareUpdate(AppUpdater updater, IExtendedFileSystem fileSystem, IPackage package) { if (package == null) throw new ArgumentNullException("package"); if (package.Version < updater.CurrentVersion) throw new BackwardUpdateException(updater.CurrentVersion, package.Version); var prepDirectory = Path.Combine(fileSystem.AppDirectory, ".updates", package.Version.ToString()); var preparedFiles = new List<string>(); foreach (var packageFile in package.GetFiles("tools")) { var targetPath = Path.Combine(prepDirectory, Get(packageFile.Path, relativeTo: "app")); fileSystem.AddFile(targetPath, packageFile.GetStream()); preparedFiles.Add(targetPath); } return new PreparedUpdate(package.Version, preparedFiles); }