Exemplo n.º 1
0
        public static async Task <IEnumerable <string> > CopySatelliteFilesAsync(PackageIdentity packageIdentity, PackagePathResolver packagePathResolver,
                                                                                 PackageSaveModes packageSaveMode, CancellationToken token)
        {
            IEnumerable <string> satelliteFilesCopied = Enumerable.Empty <string>();

            if (packageIdentity == null)
            {
                throw new ArgumentNullException("packageIdentity");
            }

            if (packagePathResolver == null)
            {
                throw new ArgumentNullException("packagePathResolver");
            }

            string nupkgFilePath = packagePathResolver.GetInstalledPackageFilePath(packageIdentity);

            if (File.Exists(nupkgFilePath))
            {
                using (var packageStream = File.OpenRead(nupkgFilePath))
                {
                    string language;
                    string runtimePackageDirectory;
                    IEnumerable <ZipArchiveEntry> satelliteFiles;
                    if (PackageHelper.GetSatelliteFiles(packageStream, packageIdentity, packagePathResolver, out language, out runtimePackageDirectory, out satelliteFiles))
                    {
                        // Now, add all the satellite files collected from the package to the runtime package folder(s)
                        satelliteFilesCopied = await PackageHelper.CreatePackageFiles(satelliteFiles, runtimePackageDirectory, packageSaveMode, token);
                    }
                }
            }

            return(satelliteFilesCopied);
        }
Exemplo n.º 2
0
 public FolderNuGetProject(string root)
 {
     if (root == null)
     {
         throw new ArgumentNullException("root");
     }
     Root = root;
     PackagePathResolver = new PackagePathResolver(root);
     PackageSaveMode     = PackageSaveModes.Nupkg;
     InternalMetadata.Add(NuGetProjectMetadataKeys.Name, root);
     InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, NuGetFramework.AnyFramework);
 }
 public FolderNuGetProject(string root)
 {
     if(root == null)
     {
         throw new ArgumentNullException("root");
     }
     Root = root;
     PackagePathResolver = new PackagePathResolver(root);
     PackageSaveMode = PackageSaveModes.Nupkg;
     InternalMetadata.Add(NuGetProjectMetadataKeys.Name, root);
     InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, NuGetFramework.AnyFramework);
 }
Exemplo n.º 4
0
 public static bool IsPackageFile(string packageFileName, PackageSaveModes packageSaveMode)
 {
     if (String.IsNullOrEmpty(packageFileName) || String.IsNullOrEmpty(Path.GetFileName(packageFileName)))
     {
         // This is to ignore archive entries that are not really files
         return(false);
     }
     if (packageSaveMode.HasFlag(PackageSaveModes.Nuspec))
     {
         return(!ExcludePaths.Any(p => packageFileName.StartsWith(p, StringComparison.OrdinalIgnoreCase)));
     }
     else
     {
         return(!IsManifest(packageFileName) && !ExcludePaths.Any(p => packageFileName.StartsWith(p, StringComparison.OrdinalIgnoreCase)));
     }
 }
Exemplo n.º 5
0
        internal static async Task <IEnumerable <string> > CreatePackageFiles(IEnumerable <ZipArchiveEntry> packageFiles, string packageDirectory,
                                                                              PackageSaveModes packageSaveMode, CancellationToken token)
        {
            IEnumerable <ZipFilePair> effectivePackageFiles = await GetPackageFiles(packageFiles, packageDirectory, packageSaveMode, token);

            foreach (var effectivePackageFile in effectivePackageFiles)
            {
                var packageFileFullPath = effectivePackageFile.Item1;
                var entry = effectivePackageFile.Item2;
                using (var inputStream = entry.Open())
                {
                    await CreatePackageFile(packageFileFullPath, inputStream, token);
                }
            }

            return(effectivePackageFiles.Select(pf => pf.Item1));
        }
Exemplo n.º 6
0
 public static bool IsPackageFile(string packageFileName, PackageSaveModes packageSaveMode)
 {
     if (String.IsNullOrEmpty(packageFileName)
         || String.IsNullOrEmpty(Path.GetFileName(packageFileName)))
     {
         // This is to ignore archive entries that are not really files
         return false;
     }
     if (packageSaveMode.HasFlag(PackageSaveModes.Nuspec))
     {
         return !ExcludePaths.Any(p => packageFileName.StartsWith(p, StringComparison.OrdinalIgnoreCase));
     }
     else
     {
         return !IsManifest(packageFileName) && !ExcludePaths.Any(p => packageFileName.StartsWith(p, StringComparison.OrdinalIgnoreCase));
     }
 }
Exemplo n.º 7
0
        public static Task <IEnumerable <ZipFilePair> > GetPackageFiles(IEnumerable <ZipArchiveEntry> packageFiles, string packageDirectory,
                                                                        PackageSaveModes packageSaveMode, CancellationToken token)
        {
            List <ZipFilePair> effectivePackageFiles = new List <ZipFilePair>();

            foreach (var entry in packageFiles)
            {
                string path = ZipArchiveHelper.UnescapePath(entry.FullName);

                if (PackageHelper.IsPackageFile(path, packageSaveMode))
                {
                    var packageFileFullPath = Path.Combine(packageDirectory, path);
                    effectivePackageFiles.Add(new ZipFilePair(packageFileFullPath, entry));
                }
            }

            return(Task.FromResult <IEnumerable <ZipFilePair> >(effectivePackageFiles));
        }
Exemplo n.º 8
0
        private PackageSaveModes CalculatePackageSaveMode(ISettings settings)
        {
            PackageSaveModes retValue = PackageSaveModes.None;

            if (settings != null)
            {
                string packageSaveModeValue = settings.GetConfigValue("PackageSaveMode");
                // TODO: remove following block of code when shipping NuGet version post 2.8
                if (string.IsNullOrEmpty(packageSaveModeValue))
                {
                    packageSaveModeValue = settings.GetConfigValue("SaveOnExpand");
                }
                // end of block of code to remove when shipping NuGet version post 2.8
                if (!string.IsNullOrEmpty(packageSaveModeValue))
                {
                    foreach (var v in packageSaveModeValue.Split(';'))
                    {
                        if (v.Equals(PackageSaveModes.Nupkg.ToString(), StringComparison.OrdinalIgnoreCase))
                        {
                            retValue |= PackageSaveModes.Nupkg;
                        }
                        else if (v.Equals(PackageSaveModes.Nuspec.ToString(), StringComparison.OrdinalIgnoreCase))
                        {
                            retValue |= PackageSaveModes.Nuspec;
                        }
                    }
                }
            }

            if (retValue == PackageSaveModes.None)
            {
                retValue = PackageSaveModes.Nupkg;
            }

            return(retValue);
        }
Exemplo n.º 9
0
 protected PackageRepositoryBase()
 {
     _packageSave = PackageSaveModes.Nupkg;
 }
Exemplo n.º 10
0
        public static async Task<IEnumerable<string>> CopySatelliteFilesAsync(PackageIdentity packageIdentity, PackagePathResolver packagePathResolver,
            PackageSaveModes packageSaveMode, CancellationToken token)
        {
            var satelliteFilesCopied = Enumerable.Empty<string>();
            if (packageIdentity == null)
            {
                throw new ArgumentNullException("packageIdentity");
            }

            if (packagePathResolver == null)
            {
                throw new ArgumentNullException("packagePathResolver");
            }

            var nupkgFilePath = packagePathResolver.GetInstalledPackageFilePath(packageIdentity);
            if (File.Exists(nupkgFilePath))
            {
                using (var packageStream = File.OpenRead(nupkgFilePath))
                {
                    string language;
                    string runtimePackageDirectory;
                    IEnumerable<ZipArchiveEntry> satelliteFiles;
                    if (PackageHelper.GetSatelliteFiles(packageStream, packageIdentity, packagePathResolver, out language, out runtimePackageDirectory, out satelliteFiles))
                    {
                        // Now, add all the satellite files collected from the package to the runtime package folder(s)
                        satelliteFilesCopied = await PackageHelper.CreatePackageFiles(satelliteFiles, runtimePackageDirectory, packageSaveMode, token);
                    }
                }
            }

            return satelliteFilesCopied;
        }
Exemplo n.º 11
0
        internal static async Task<IEnumerable<string>> CreatePackageFiles(IEnumerable<ZipArchiveEntry> packageFiles, string packageDirectory,
            PackageSaveModes packageSaveMode, CancellationToken token)
        {
            var effectivePackageFiles = await GetPackageFiles(packageFiles, packageDirectory, packageSaveMode, token);
            foreach (var effectivePackageFile in effectivePackageFiles)
            {
                var packageFileFullPath = effectivePackageFile.Item1;
                var entry = effectivePackageFile.Item2;
                using (var inputStream = entry.Open())
                {
                    await CreatePackageFile(packageFileFullPath, inputStream, token);
                }
            }

            return effectivePackageFiles.Select(pf => pf.Item1);
        }
Exemplo n.º 12
0
        public static async Task <IEnumerable <string> > ExtractPackageAsync(
            PackageReaderBase packageReader,
            Stream packageStream,
            PackageIdentity packageIdentity,
            PackagePathResolver packagePathResolver,
            PackageExtractionContext packageExtractionContext,
            PackageSaveModes packageSaveMode,
            CancellationToken token)
        {
            if (packageStream == null)
            {
                throw new ArgumentNullException(nameof(packageStream));
            }

            if (packageIdentity == null)
            {
                throw new ArgumentNullException(nameof(packageIdentity));
            }

            if (packagePathResolver == null)
            {
                throw new ArgumentNullException(nameof(packagePathResolver));
            }

            // TODO: Need to handle PackageSaveMode
            // TODO: Support overwriting files also?
            var filesAdded = new List <string>();

            var nuspecReader = new NuspecReader(packageReader.GetNuspec());

            packageIdentity = nuspecReader.GetIdentity();

            var packageDirectoryInfo = Directory.CreateDirectory(packagePathResolver.GetInstallPath(packageIdentity));
            var packageDirectory     = packageDirectoryInfo.FullName;

            foreach (var file in packageReader.GetFiles().Where(file => PackageHelper.IsPackageFile(file, packageSaveMode)))
            {
                token.ThrowIfCancellationRequested();

                var targetPath = Path.Combine(packageDirectory, file);
                Directory.CreateDirectory(Path.GetDirectoryName(targetPath));

                using (var sourceStream = packageReader.GetStream(file))
                {
                    using (var targetStream = new FileStream(targetPath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 1024, useAsync: true))
                    {
                        await sourceStream.CopyToAsync(targetStream);
                    }
                }

                filesAdded.Add(file);
            }

            var nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentity));

            if (packageSaveMode.HasFlag(PackageSaveModes.Nupkg))
            {
                // During package extraction, nupkg is the last file to be created
                // Since all the packages are already created, the package stream is likely positioned at its end
                // Reset it
                if (packageStream.Position != 0)
                {
                    if (!packageStream.CanSeek)
                    {
                        throw new ArgumentException(Strings.PackageStreamShouldBeSeekable);
                    }

                    packageStream.Position = 0;
                }

                filesAdded.Add(await PackageHelper.CreatePackageFile(nupkgFilePath, packageStream, token));
            }

            // Now, copy satellite files unless requested to not copy them
            if (packageExtractionContext == null || packageExtractionContext.CopySatelliteFiles)
            {
                PackageIdentity runtimeIdentity;
                string          packageLanguage;
                var             isSatellitePackage = PackageHelper.IsSatellitePackage(nuspecReader, out runtimeIdentity, out packageLanguage);

                // Short-circuit this if the package is not a satellite package.
                if (isSatellitePackage)
                {
                    filesAdded.AddRange(await CopySatelliteFilesAsync(packageIdentity, packagePathResolver, packageSaveMode, token));
                }
            }

            return(filesAdded);
        }
Exemplo n.º 13
0
        /// <summary>
        /// This returns all the installed package files (does not include satellite files)
        /// </summary>
        /// <param name="packageIdentity"></param>
        /// <param name="packagePathResolver"></param>
        /// <param name="packageDirectory"></param>
        /// <param name="packageSaveMode"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public static async Task<IEnumerable<ZipFilePair>> GetInstalledPackageFiles(Stream packageStream,
            PackageIdentity packageIdentity,
            PackagePathResolver packagePathResolver,
            PackageSaveModes packageSaveMode,
            CancellationToken token)
        {
            var installedPackageFiles = new List<ZipFilePair>();
            var packageDirectory = packagePathResolver.GetInstalledPath(packageIdentity);
            if (!String.IsNullOrEmpty(packageDirectory))
            {
                var zipArchive = new ZipArchive(packageStream);
                var packageFiles = await GetPackageFiles(zipArchive.Entries, packageDirectory, packageSaveMode, token);
                installedPackageFiles.AddRange(GetInstalledPackageFiles(packageFiles));
            }

            return installedPackageFiles;
        }
Exemplo n.º 14
0
        public static async Task<Tuple<string, IEnumerable<ZipFilePair>>> GetInstalledSatelliteFiles(Stream packageStream,
            PackageIdentity packageIdentity,
            PackagePathResolver packagePathResolver,
            PackageSaveModes packageSaveMode,
            CancellationToken token)
        {
            var installedSatelliteFiles = new List<ZipFilePair>();
            string language;
            string runtimePackageDirectory;
            IEnumerable<ZipArchiveEntry> satelliteFileEntries;
            if (GetSatelliteFiles(packageStream, packageIdentity, packagePathResolver, out language, out runtimePackageDirectory, out satelliteFileEntries))
            {
                var satelliteFiles = await GetPackageFiles(satelliteFileEntries, runtimePackageDirectory, packageSaveMode, token);
                installedSatelliteFiles.AddRange(GetInstalledPackageFiles(satelliteFiles));
            }

            return new Tuple<string, IEnumerable<ZipFilePair>>(runtimePackageDirectory, installedSatelliteFiles);
        }
Exemplo n.º 15
0
 protected PackageRepositoryBase()
 {
     _packageSave = PackageSaveModes.Nupkg;
 }
Exemplo n.º 16
0
        public static Task<IEnumerable<ZipFilePair>> GetPackageFiles(IEnumerable<ZipArchiveEntry> packageFiles, string packageDirectory,
            PackageSaveModes packageSaveMode, CancellationToken token)
        {
            var effectivePackageFiles = new List<ZipFilePair>();
            foreach (var entry in packageFiles)
            {
                var path = ZipArchiveHelper.UnescapePath(entry.FullName);

                if (IsPackageFile(path, packageSaveMode))
                {
                    var packageFileFullPath = Path.Combine(packageDirectory, path);
                    effectivePackageFiles.Add(new ZipFilePair(packageFileFullPath, entry));
                }
            }

            return Task.FromResult<IEnumerable<ZipFilePair>>(effectivePackageFiles);
        }
Exemplo n.º 17
0
        public static async Task <IEnumerable <string> > ExtractPackageAsync(Stream packageStream, PackageIdentity packageIdentity,
                                                                             PackagePathResolver packagePathResolver,
                                                                             PackageExtractionContext packageExtractionContext,
                                                                             PackageSaveModes packageSaveMode,
                                                                             CancellationToken token)
        {
            List <string> filesAdded = new List <string>();

            if (packageStream == null)
            {
                throw new ArgumentNullException("packageStream");
            }

            if (!packageStream.CanSeek)
            {
                throw new ArgumentException(Strings.PackageStreamShouldBeSeekable);
            }

            if (packageIdentity == null)
            {
                throw new ArgumentNullException("packageIdentity");
            }

            if (packagePathResolver == null)
            {
                throw new ArgumentNullException("packagePathResolver");
            }

            // TODO: Need to handle PackageSaveMode
            // TODO: Support overwriting files also?
            long nupkgStartPosition = packageStream.Position;
            var  zipArchive         = new ZipArchive(packageStream);

            // default to non-legacy paths
            bool useLegacyPaths = packageExtractionContext == null ? false : packageExtractionContext.UseLegacyPackageInstallPath;

            var          packageReader            = new PackageReader(zipArchive);
            var          nuspecReader             = new NuspecReader(packageReader.GetNuspec());
            NuGetVersion packageVersionFromNuspec = nuspecReader.GetVersion();

            var    packageDirectoryInfo = Directory.CreateDirectory(packagePathResolver.GetInstallPath(new PackageIdentity(packageIdentity.Id, packageVersionFromNuspec), useLegacyPaths));
            string packageDirectory     = packageDirectoryInfo.FullName;

            filesAdded.AddRange(await PackageHelper.CreatePackageFiles(zipArchive.Entries, packageDirectory, packageSaveMode, token));

            string nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentity));

            if (packageSaveMode.HasFlag(PackageSaveModes.Nupkg))
            {
                // During package extraction, nupkg is the last file to be created
                // Since all the packages are already created, the package stream is likely positioned at its end
                // Reset it to the nupkgStartPosition
                packageStream.Seek(nupkgStartPosition, SeekOrigin.Begin);
                filesAdded.Add(await PackageHelper.CreatePackageFile(nupkgFilePath, packageStream, token));
            }

            // Now, copy satellite files unless requested to not copy them
            if (packageExtractionContext == null || packageExtractionContext.CopySatelliteFiles)
            {
                filesAdded.AddRange(await CopySatelliteFilesAsync(packageIdentity, packagePathResolver, packageSaveMode, token));
            }

            return(filesAdded);
        }
Exemplo n.º 18
0
        public static async Task<IEnumerable<string>> ExtractPackageAsync(
            PackageReaderBase packageReader,
            Stream packageStream,
            PackageIdentity packageIdentity,
            PackagePathResolver packagePathResolver,
            PackageExtractionContext packageExtractionContext,
            PackageSaveModes packageSaveMode,
            CancellationToken token)
        {
            if (packageStream == null)
            {
                throw new ArgumentNullException(nameof(packageStream));
            }

            if (packageIdentity == null)
            {
                throw new ArgumentNullException(nameof(packageIdentity));
            }

            if (packagePathResolver == null)
            {
                throw new ArgumentNullException(nameof(packagePathResolver));
            }

            // TODO: Need to handle PackageSaveMode
            // TODO: Support overwriting files also?
            var filesAdded = new List<string>();

            var nuspecReader = new NuspecReader(packageReader.GetNuspec());
            packageIdentity = nuspecReader.GetIdentity();

            var packageDirectoryInfo = Directory.CreateDirectory(packagePathResolver.GetInstallPath(packageIdentity));
            var packageDirectory = packageDirectoryInfo.FullName;

            foreach (var file in packageReader.GetFiles().Where(file => PackageHelper.IsPackageFile(file, packageSaveMode)))
            {
                token.ThrowIfCancellationRequested();

                var targetPath = Path.Combine(packageDirectory, file);
                Directory.CreateDirectory(Path.GetDirectoryName(targetPath));

                using (var sourceStream = packageReader.GetStream(file))
                {
                    using (var targetStream = new FileStream(targetPath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize: 1024, useAsync: true))
                    {
                        await sourceStream.CopyToAsync(targetStream);
                    }
                }

                filesAdded.Add(file);
            }

            var nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentity));
            if (packageSaveMode.HasFlag(PackageSaveModes.Nupkg))
            {
                // During package extraction, nupkg is the last file to be created
                // Since all the packages are already created, the package stream is likely positioned at its end
                // Reset it
                if (packageStream.Position != 0)
                {
                    if (!packageStream.CanSeek)
                    {
                        throw new ArgumentException(Strings.PackageStreamShouldBeSeekable);
                    }

                    packageStream.Position = 0;

                }

                filesAdded.Add(await PackageHelper.CreatePackageFile(nupkgFilePath, packageStream, token));
            }

            // Now, copy satellite files unless requested to not copy them
            if (packageExtractionContext == null || packageExtractionContext.CopySatelliteFiles)
            {
                PackageIdentity runtimeIdentity;
                string packageLanguage;
                var isSatellitePackage = PackageHelper.IsSatellitePackage(nuspecReader, out runtimeIdentity, out packageLanguage);

                // Short-circuit this if the package is not a satellite package.
                if (isSatellitePackage)
                {
                    filesAdded.AddRange(await CopySatelliteFilesAsync(packageIdentity, packagePathResolver, packageSaveMode, token));
                }
            }

            return filesAdded;
        }
Exemplo n.º 19
0
        /// <summary>
        /// This returns all the installed package files (does not include satellite files)
        /// </summary>
        /// <param name="packageIdentity"></param>
        /// <param name="packagePathResolver"></param>
        /// <param name="packageDirectory"></param>
        /// <param name="packageSaveMode"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public static async Task <IEnumerable <ZipFilePair> > GetInstalledPackageFiles(Stream packageStream,
                                                                                       PackageIdentity packageIdentity,
                                                                                       PackagePathResolver packagePathResolver,
                                                                                       PackageSaveModes packageSaveMode,
                                                                                       CancellationToken token)
        {
            List <ZipFilePair> installedPackageFiles = new List <ZipFilePair>();
            string             packageDirectory      = packagePathResolver.GetInstalledPath(packageIdentity);

            if (!String.IsNullOrEmpty(packageDirectory))
            {
                var zipArchive   = new ZipArchive(packageStream);
                var packageFiles = await GetPackageFiles(zipArchive.Entries, packageDirectory, packageSaveMode, token);

                installedPackageFiles.AddRange(GetInstalledPackageFiles(packageFiles));
            }

            return(installedPackageFiles);
        }
Exemplo n.º 20
0
        public static async Task<IEnumerable<string>> ExtractPackageAsync(
            Stream packageStream,
            PackageIdentity packageIdentity,
            PackagePathResolver packagePathResolver,
            PackageExtractionContext packageExtractionContext,
            PackageSaveModes packageSaveMode,
            CancellationToken token)
        {
            var filesAdded = new List<string>();
            if (packageStream == null)
            {
                throw new ArgumentNullException(nameof(packageStream));
            }

            if (!packageStream.CanSeek)
            {
                throw new ArgumentException(Strings.PackageStreamShouldBeSeekable);
            }

            if (packageIdentity == null)
            {
                throw new ArgumentNullException(nameof(packageIdentity));
            }

            if (packagePathResolver == null)
            {
                throw new ArgumentNullException(nameof(packagePathResolver));
            }

            // TODO: Need to handle PackageSaveMode
            // TODO: Support overwriting files also?
            var zipArchive = new ZipArchive(packageStream);

            var packageReader = new PackageReader(zipArchive);
            var nuspecReader = new NuspecReader(packageReader.GetNuspec());
            packageIdentity = nuspecReader.GetIdentity();

            var packageDirectoryInfo = Directory.CreateDirectory(packagePathResolver.GetInstallPath(packageIdentity));
            var packageDirectory = packageDirectoryInfo.FullName;

            filesAdded.AddRange(await PackageHelper.CreatePackageFiles(zipArchive.Entries, packageDirectory, packageSaveMode, token));

            var nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentity));
            if (packageSaveMode.HasFlag(PackageSaveModes.Nupkg))
            {
                // During package extraction, nupkg is the last file to be created
                // Since all the packages are already created, the package stream is likely positioned at its end
                // Reset it
                packageStream.Seek(0, SeekOrigin.Begin);
                filesAdded.Add(await PackageHelper.CreatePackageFile(nupkgFilePath, packageStream, token));
            }

            // Now, copy satellite files unless requested to not copy them
            if (packageExtractionContext == null
                || packageExtractionContext.CopySatelliteFiles)
            {
                filesAdded.AddRange(await CopySatelliteFilesAsync(packageIdentity, packagePathResolver, packageSaveMode, token));
            }

            return filesAdded;
        }
Exemplo n.º 21
0
        public static async Task <Tuple <string, IEnumerable <ZipFilePair> > > GetInstalledSatelliteFiles(Stream packageStream,
                                                                                                          PackageIdentity packageIdentity,
                                                                                                          PackagePathResolver packagePathResolver,
                                                                                                          PackageSaveModes packageSaveMode,
                                                                                                          CancellationToken token)
        {
            List <ZipFilePair>            installedSatelliteFiles = new List <ZipFilePair>();
            string                        language;
            string                        runtimePackageDirectory;
            IEnumerable <ZipArchiveEntry> satelliteFileEntries;

            if (PackageHelper.GetSatelliteFiles(packageStream, packageIdentity, packagePathResolver, out language, out runtimePackageDirectory, out satelliteFileEntries))
            {
                var satelliteFiles = await GetPackageFiles(satelliteFileEntries, runtimePackageDirectory, packageSaveMode, token);

                installedSatelliteFiles.AddRange(GetInstalledPackageFiles(satelliteFiles));
            }

            return(new Tuple <string, IEnumerable <ZipFilePair> >(runtimePackageDirectory, installedSatelliteFiles));
        }