Skip to content

Allow winget to install MS Store packages without account#2095

Merged
yao-msft merged 10 commits intomicrosoft:masterfrom
zachcwillson:users/zwillson/fix-1585
Apr 26, 2022
Merged

Allow winget to install MS Store packages without account#2095
yao-msft merged 10 commits intomicrosoft:masterfrom
zachcwillson:users/zwillson/fix-1585

Conversation

@zachcwillson
Copy link
Copy Markdown
Contributor

@zachcwillson zachcwillson commented Apr 14, 2022


  • Updates comment when enr.Status() == GetEntitlementStatus::NoStoreAccount to indicate it is okay to not have a store account.
  • Updates the return statement of GetFreeUserEntitlement to return true if enr.Status() == GetEntitlementStatus::NoStoreAccount
Microsoft Reviewers: Open in CodeFlow

zachcwillson and others added 2 commits April 13, 2022 20:54
update log message for NoStoreAccount and add or check for return statement to return true for GetFreeUserEntitlement if status was no store account
Fix formatting and return statement
@ghost ghost added the Issue-Feature This is a feature request for the Windows Package Manager client. label Apr 14, 2022
@zachcwillson zachcwillson marked this pull request as ready for review April 14, 2022 16:03
@zachcwillson zachcwillson requested a review from a team as a code owner April 14, 2022 16:03
@JohnMcPMS
Copy link
Copy Markdown
Member

We've been told that we should call GetFreeDeviceEntitlementAsync. I would assume that this would be in response to a GetEntitlementStatus::NoStoreAccount from the user function, or simply called first.

Address feedback around usage of GetFreeDeviceEntitlementAsync, moved state checking logic to its own method
@zachcwillson
Copy link
Copy Markdown
Contributor Author

Thanks for the tip @JohnMcPMS :)

Update to make logging clear over which entitlement type failed or succeeded
Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
@ghost ghost added the Needs-Author-Feedback Issue needs attention from issue or PR author label Apr 14, 2022
Co-authored-by: JohnMcPMS <johnmcp@microsoft.com>
@ghost ghost removed the Needs-Author-Feedback Issue needs attention from issue or PR author label Apr 15, 2022
zachcwillson and others added 2 commits April 14, 2022 17:30
Co-authored-by: JohnMcPMS <johnmcp@microsoft.com>
Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
Copy link
Copy Markdown
Contributor Author

@zachcwillson zachcwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed feedback

@yao-msft
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
@zachcwillson
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 2095 in repo microsoft/winget-cli

@yao-msft
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

context.Reporter.Info() << Resource::String::MSStoreInstallGetEntitlementNoStoreAccount << std::endl;
AICLI_LOG(CLI, Error, << "Get entitlement failed. No Store account.");
AICLI_LOG(CLI, Error, << "Get device entitlement.");
result = installManager.GetFreeUserEntitlementAsync(productId, winrt::hstring(), winrt::hstring()).get();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User

Device

Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
@yao-msft
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
Comment thread src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp Outdated
Copy link
Copy Markdown
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to drop my "request changes" without approving. I agree with the code parts, just a few log lines that are mistargeted.

@JohnMcPMS
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@yao-msft yao-msft merged commit 7355518 into microsoft:master Apr 26, 2022
@alexchandel
Copy link
Copy Markdown

Did this not make it into 22H2?

@yao-msft
Copy link
Copy Markdown
Contributor

yao-msft commented Feb 1, 2023

Did this not make it into 22H2?

This is included in winget v1.3 stable release and later. Though winget is pre-installed in Windosw, all updates are distributed through Microsoft Store. They are available in our Github releases too https://github.com/microsoft/winget-cli/releases

@alexchandel
Copy link
Copy Markdown

So when will a version of winget be pre-installed on Windows that doesn't require an account at first use? Windows 12?

@denelon
Copy link
Copy Markdown
Collaborator

denelon commented May 3, 2023

@alexchandel Windows has a long release cycle. We do check in the "latest" stable version of WinGet into the OS for the next release, but it's often the case that a newer version is available by the time the OS is available to the public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue-Feature This is a feature request for the Windows Package Manager client.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow winget to install MS Store packages without account just like the MS Store

5 participants