public IEnumerable <string> GetInstalledFiles(PackageId packageId, bool nonSharedFilesOnly)
        {
            var packageInfo = ProductPackages.FirstOrDefault(x => x.Configuration.Id.IsSamePackage(packageId));

            if (packageInfo == null)
            {
                return new string[] {}
            }
            ;

            if (!nonSharedFilesOnly)
            {
                return(packageInfo.Files);
            }

            return(packageInfo.Files.Where(
                       file => !ProductPackages.Any(x => x != packageInfo && x.Files.Contains(file))).ToList());
        }
        /// <summary>
        /// Returns package's installed files
        /// </summary>
        /// <param name="packageId">Package ID</param>
        /// <param name="nonSharedFilesOnly">When true, instructs function to return only the files which are unique for the package</param>
        /// <returns>Files list</returns>
        public IReadOnlyCollection <IPackageFile> GetInstalledFiles(PackageId packageId, bool nonSharedFilesOnly)
        {
            var packageInfo = ProductPackages.FirstOrDefault(x => x.Configuration.Id.IsSamePackage(packageId));

            if (packageInfo == null)
            {
                return(new List <PackageFileInfo>(new PackageFileInfo[] {}));
            }

            var files = !nonSharedFilesOnly
                ? packageInfo.Files
                : packageInfo.Files.Where(file => !ProductPackages.Any(x => x != packageInfo && x.Files.Any(file.IsSameFile)))
                        .ToList();

            if (string.IsNullOrWhiteSpace(_productPath))
            {
                return(files);
            }

            return(files.Select(
                       x => Path.IsPathRooted(x.FileName) ? x : new PackageFileInfo(Path.Combine(_productPath, x.FileName)))
                   .ToList());
        }