Ability for winget to download a Microsoft Store application for specific Windows build #4996
Labels
Command-Download
Issue related to WinGet Download
Issue-Feature
This is a feature request for the Windows Package Manager client.
msstore
Issue related to "msstore" REST source
Description of the new feature / enhancement
I would like to have the possibility to download Microsoft Store application for a specific version. Since by default, winget always downloads the latest version even if incompatible. This disallows to download LPX since one need to download the matching version. Also, for older version of Windows (LTSC) you can stumble upon incompatible application version.
This solves #4995.
The problem
For example, for Microsoft.LanguageExperiencePackfr-FR (9NHMG4BJKMDG): each build has its version with the [build].a.b.c format. The last for 24H2 is 26100.22.41.0 and for Windows 10 21H2/22H2 the last is 19041.79.263.0. However, Winget only download 27754.1.2.0, for the future 25H2. Its manifest confirm it is not compatible with our Windows versions.
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.27547.0" MaxVersionTested="10.0.27754.1000" />
Another example with Microsoft.Windows.Photos (9WZDNCRFJBH4) : for the Windows 10 1809 (LTSC), build 17763, the latest compatible is 2023.10030.27002.0. The last version compatible with this build in Winget downloaded version is 2019.19061.18920.0.
Example solution
I would see for an example of solution the use of the "-v" flag in winget. For now, it is not used for Store downloads.
winget download 9NHMG4BJKMDG -v 22000
This would download the Windows 11 22H2 French LPX.
Another possibility is to make a filter with the platform name
-v "Windows.Desktop=22000"
.Technical implementation details
This would be easily technically implementable without any infrastructure change, only code. Winget calls two API:
The first call is done here MSStoreDownload.cpp and the other here SFSClientImpl.cpp.
Given these APIs winget already have all information at hands. It has all versions but Winget only choose the latest version and ignore the others. It just has to implement a best version for given build algorithm. This algorithm would have to be implemented in these two files.
Thanks, and have a nice day
The text was updated successfully, but these errors were encountered: