public override async Task <FileSystemInfo> DownloadAsync(DirectoryInfo folder = null)
        {
            FileInfo downloadFile = (FileInfo)DownloadItem;

            if (IsWinGet)
            {
                // Find the package URI
                await PopulatePackageUri();

                if (Status.IsLessThan(PackageStatus.DownloadReady))
                {
                    return(null);
                }

                // Download package
                downloadFile = (FileInfo)await InternalPackage.DownloadAsync(folder);

                Status = InternalPackage.Status;

                // Set the proper file type and extension
                string filename = Path.GetFileName(PackageUri.ToString());
                downloadFile.MoveRename(filename);
            }
            else
            {
                try
                {
                    // Get system and package info
                    string[] categoryIds = new[] { Model.Skus[0].FulfillmentData.WuCategoryId };
                    var      sysInfo     = Handlers.MicrosoftStore.Win32Helper.GetSystemInfo();
                    folder ??= StorageHelper.GetTempDirectory();

                    // Get update data
                    WeakReferenceMessenger.Default.Send(new PackageFetchStartedMessage(this));
                    var updates = await WindowsUpdateLib.FE3Handler.GetUpdates(categoryIds, sysInfo, "", WindowsUpdateLib.FileExchangeV3UpdateFilter.Application);

                    if (updates == null || !updates.Any())
                    {
                        WeakReferenceMessenger.Default.Send(new ErrorMessage(
                                                                WebException.Create(404, "No packages are available for " + ShortTitle), this, ErrorType.PackageFetchFailed));
                        return(null);
                    }
                    WeakReferenceMessenger.Default.Send(new SuccessMessage(null, this, SuccessType.PackageFetchCompleted));

                    // Set up progress handler
                    void DownloadProgress(DownloadLib.GeneralDownloadProgress progress)
                    {
                        var status = progress.DownloadedStatus[0];

                        WeakReferenceMessenger.Default.Send(
                            new PackageDownloadProgressMessage(this, status.DownloadedBytes, status.File.FileSize));
                    }

                    // Start download
                    WeakReferenceMessenger.Default.Send(new PackageDownloadStartedMessage(this));
                    string[] files = await MSStoreDownloader.DownloadPackageAsync(updates, folder, new DownloadProgress(DownloadProgress));

                    if (files == null || files.Length == 0)
                    {
                        throw new Exception("Failed to download pacakges using WindowsUpdateLib");
                    }
                    Status = InternalPackage.Status = PackageStatus.Downloaded;

                    InternalPackage.DownloadItem = downloadFile = new(Path.Combine(folder.FullName, files[0]));
                    await((ModernPackage <ProductDetails>)InternalPackage).GetInstallerType();
                    Type = InternalPackage.Type;
                }
                catch (Exception ex)
                {
                    WeakReferenceMessenger.Default.Send(new ErrorMessage(ex, this, ErrorType.PackageDownloadFailed));
                    return(null);
                }
            }

            if (Status.IsLessThan(PackageStatus.Downloaded))
            {
                return(null);
            }

            DownloadItem = downloadFile;
            WeakReferenceMessenger.Default.Send(SuccessMessage.CreateForPackageDownloadCompleted(this));
            return(DownloadItem);
        }