-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Download MS Store package for target OS #5689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s version) and test update
…Shell, fix attempt to set a null value through COM in Windows PowerShell
Manifest::PlatformEnum requiredPlatform, | ||
const std::optional<Utility::UInt64Version>& targetOSVersion) | ||
{ | ||
UNREFERENCED_PARAMETER(targetOSVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
AuthenticationArguments AuthenticationArguments; | ||
} | ||
|
||
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 13)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the contract version comment in line 5 is still 1.12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctly so; that comment means that it has already been incremented for 1.12.
std::string locale, | ||
AppInstaller::Authentication::AuthenticationArguments authArgs); | ||
|
||
void TargetOSVersion(std::optional<Utility::UInt64Version> targetOSVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we move it to constructor? I don't see it needs to be changed after it's created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that concerned with invariants in an internal type and properties are much more optionally-set friendly. I do dislike large numbers of arguments to functions though.
{ | ||
// Not passing in required platform for dependencies. Dependencies are mostly Windows.Universal. | ||
auto dependencyPackages = PopulateSfsAppFileToMSStoreDownloadFileVector(dependencyEntry.GetFiles(), requiredArchitecture); | ||
auto dependencyPackages = PopulateSfsAppFileToMSStoreDownloadFileVector(dependencyEntry.GetFiles(), requiredArchitecture, Manifest::PlatformEnum::Unknown, targetOSVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for dependency packages to have higher min OS version than main package? Maybe we can pass nullopt for targetOSVersion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are talking about MSIX packages and scenarios where no versions have been removed (security, etc.), then I would say no. There must have been a dependency that was also installable on the target OS version at some time.
Fixes #4996
Change
Adds the ability to specify the target OS version for downloads from the Microsoft Store. This is achieved by filtering the set of applicable platforms in
GetSfsPackageFileSupportedPlatforms
further than the existing platform targeting. Now they must also have a minimum specified OS version >= the target OS version.winget.exe download
has a new parameter--os-version
. This is a UINT64 version (4 part version with 2^16-1 maximum value for each part) that should be given as the target OS version.COM
DownloadOptions
has a new propertyTargetOSVersion
, which is a string of the same format as above.PowerShell
Export-WinGetPackage
has a new parameter-TargetOSVersion
, which is also a string of the same format.Also added the previously implemented options to skip the license download (
--skip-license
) and the target platform (--platform
) to COM (SkipMicrosoftStoreLicense
andPlatform
) and PowerShell (-SkipMicrosoftStoreLicense
and-Platform
).Validation
Added a test to the existing ones for specifying a lower target version.
Manually verified that without the parameter provided, for
9NHMG4BJKMDG
(as exemplified in the issue) we download version27920.1.1.0
. Specifying version10.0.22000.0
as the target OS, we download package version22000.52.238.0
which has in it's manifest:Microsoft Reviewers: Open in CodeFlow