winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Upgrade Microsoft Store apps with `winget upgrade`

Open felipecrs opened this issue 1 year ago • 19 comments

Description of the new feature / enhancement

I have some strange habit of turning on my computer then running winget upgrade --all as the first thing to ensure I'm up-to-date.

However, that isn't enough. I have to go to Windows Update settings, and check and install updates from there. Although this has nothing to do with WinGet, I use PSWindowsUpdate for the task. It works great.

Then, I have to open Microsoft Store, head the installed apps list, click in Update, and hope that it works.

Now, I'm wondering... if WinGet can install Microsoft Store apps, why shouldn't it be able to update them?

It would be so cool!

And I think I'm not the only one looking for something like it, when I Google Update microsoft store apps from powershell, there are plenty of people asking for some solution while none exist so far, it seems.

And I'm sorry if this is a duplicate, I searched for existing issues before opening.

Proposed technical implementation details

I'll leave that up to you, but I'd say that this should probably come enabled by default when running winget upgrade, including --all, the same way msstore is enabled by default when running winget install.

Maybe I could use winget upgrade --all -s winget or winget upgrade --all -s msstore to filter out if I need?

felipecrs avatar Jan 14 '23 00:01 felipecrs

It's related to the version information from the Microsoft Store. Most packages are reporting version "Unknown" in the manifest. Some of the newer Win32 Apps in the store do have version information in winget show output, but not the endpoint being used to check for newer versions. The work is in progress. The traditional Microsoft Store apps still show "Unknown". Once the version information is available, WinGet will be able to upgrade them.

denelon avatar Jan 17 '23 19:01 denelon

I forgot to add. If you use WinGet to install a package from the "msstore" source, it is linked in winget list. If you run winget upgrade --all you get prompted about "unknown versions" if you run winget upgrade --all --include-unknown the packages with unknown versions will be included. It may be a "duplicate" install of the same version, but if a newer one is present, it will get upgraded.

Note, if the source also displays "unknown" it will not upgrade "unknown" to "unknown". You would have to use "--force" to force an upgrade.

https://www.edtittel.com/blog/winget-upgrade-include-unknown-gets-ilustrated.html

denelon avatar Jan 18 '23 00:01 denelon

Oh, that's interesting!

felipecrs avatar Jan 18 '23 00:01 felipecrs

In the mean time, I am using a PowerShell script which I found somewhere in the internet:

Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod

It does the same thing as clicking in the Get updates button in the Microsoft Store.

(sending because it may be useful for someone else)

felipecrs avatar Feb 17 '23 22:02 felipecrs

@felipecrs I assume that WMI/MDM thing does not work if you don't have Intune, right?

FYI: It is possible to write some script code to programmatically (and synchronously) trigger Store updates: https://github.com/microsoft/winget-cli/discussions/1738#discussioncomment-5484927

jazzdelightsme avatar Mar 31 '23 05:03 jazzdelightsme

Yes it works, I use it on my personal computers without Intune or anything special preinstalled.

felipecrs avatar Mar 31 '23 05:03 felipecrs

It's related to the version information from the Microsoft Store. Most packages are reporting version "Unknown" in the manifest. Some of the newer Win32 Apps in the store do have version information in winget show output, but not the endpoint being used to check for newer versions. The work is in progress. The traditional Microsoft Store apps still show "Unknown". Once the version information is available, WinGet will be able to upgrade them.

"Most packages are reporting version "Unknown" in the manifest" - this is happening even if the version is specified in the manifest, I hope this will be fixed soon

bogdan-patraucean avatar May 14 '23 20:05 bogdan-patraucean

@denelon +1 for winget upgrade --all -s <source>

I am aware that not even winget list -s msstore is working properly as of now, but when versioning gets settled winget upgrade --all -s msstore would be a godsend for admins. Extra credit if it updates the store app itself as well.

Hlsgs avatar May 16 '23 11:05 Hlsgs

Is there any update? As a ms-store app developer I would love to detect and trigger updates with winget.

C1rdec avatar Jul 13 '23 03:07 C1rdec

I'm wondering about status of this as well. While I don't run update first thing on logon, every once in a while I do the update routine. I have a script that runs everything in the Terminal, but also opens Win Update and MSStore so I can click the buttons there just in case, as some stuff just refuses to pull updates sometimes. So for me it's running single ps1 script, click 2 buttons and wait.

But I would still imagine a perfect world where single winget command updates everything (like apt would do for Debian/Ubuntu).

And while I'm not much of a programmer, more sysadmin crossing to project manager, hearing "excuse" that package has no version number makes me start considering if I should pull my hair (little I have left) or just fire the guy that said it (with all due respect).

Isn't Microsoft Store made by Microsoft? With all APIs and functionality? And isn't winget an MS project included in same OS as MSStore? So MS Store knows what to update when you click "Get Updates" (though that can also get confused). But different MS team can't query same API and get the list of what's new and update? So you don't have version numbers. So what. You have some other information, same one that "Get Updates" uses.

So, again, sorry for harsh words, you people have been doing great work on winget, but ... Please don't say (publicly) that you can't fetch new updates for Store apps because version info is missing.

Option 1) Use the existing Store mechanic, whichever that may be

Option 2) Force Store team to force version numbering for any new app uploads/releases as of "yesterday". Android and Apple have been forcing very specific versioning requirements onto developers for like ... forever (? haven't been doing that for 3 years+). If MS still doesn't force versions, just change that already.

I am looking at winget to eventually replace any GUI installing on Windows, for admins of all kinds to rejoice in easy app management (in 2025? 2027?). But please don't just throw excuses around for things that are managed by same parent company.

(And I know MS is large corporation, and how it may be difficult to discuss stuff with other teams and departments, but come on... Try?)

Thanks!

luxzg avatar Dec 19 '23 21:12 luxzg

Hi all! It's about one year while this issue is opened. Any news???

Delphi251189 avatar Jan 04 '24 20:01 Delphi251189

+1 for the feature of detecting version (instead of unkown) of msstore apps +1 for the feature that optionally only msstore apps can be updated "--all -s msstore"

Is there a current roadmap?

m-fessler avatar Jan 08 '24 12:01 m-fessler

If this will be implemented, please do not update apps which set UpdateWhileInUse to defer like windows terminal https://github.com/microsoft/terminal/pull/16250/files#diff-e86b4433a9c131fdd5229882b8df6f1005eccfc9be4f128eee05185b7e0f7821R37

soredake avatar Jan 08 '24 19:01 soredake

In the mean time, I am using a PowerShell script which I found somewhere in the internet:

Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod

It does the same thing as clicking in the Get updates button in the Microsoft Store.

(sending because it may be useful for someone else)

this does not execute for a user without local admin rights

tecxx avatar Jan 17 '24 22:01 tecxx

Has there been any update with this?

strixdio avatar Apr 03 '24 19:04 strixdio

I'm wondering about status of this as well. While I don't run update first thing on logon, every once in a while I do the update routine. I have a script that runs everything in the Terminal, but also opens Win Update and MSStore so I can click the buttons there just in case, as some stuff just refuses to pull updates sometimes. So for me it's running single ps1 script, click 2 buttons and wait.

But I would still imagine a perfect world where single winget command updates everything (like apt would do for Debian/Ubuntu).

And while I'm not much of a programmer, more sysadmin crossing to project manager, hearing "excuse" that package has no version number makes me start considering if I should pull my hair (little I have left) or just fire the guy that said it (with all due respect).

Isn't Microsoft Store made by Microsoft? With all APIs and functionality? And isn't winget an MS project included in same OS as MSStore? So MS Store knows what to update when you click "Get Updates" (though that can also get confused). But different MS team can't query same API and get the list of what's new and update? So you don't have version numbers. So what. You have some other information, same one that "Get Updates" uses.

So, again, sorry for harsh words, you people have been doing great work on winget, but ... Please don't say (publicly) that you can't fetch new updates for Store apps because version info is missing.

Option 1) Use the existing Store mechanic, whichever that may be

Option 2) Force Store team to force version numbering for any new app uploads/releases as of "yesterday". Android and Apple have been forcing very specific versioning requirements onto developers for like ... forever (? haven't been doing that for 3 years+). If MS still doesn't force versions, just change that already.

I am looking at winget to eventually replace any GUI installing on Windows, for admins of all kinds to rejoice in easy app management (in 2025? 2027?). But please don't just throw excuses around for things that are managed by same parent company.

(And I know MS is large corporation, and how it may be difficult to discuss stuff with other teams and departments, but come on... Try?)

Thanks!

I could not agree with this more. I'm a huge MS fan and enterprise user. WSL was a huge leap, then Windows terminal then winget. All of a sudden Windows 10/11 feel like knowledge worker and dev machines all in one. Except ..... package management is still an issue in 2024. Why is it so hard to get this to converge?

shockogit avatar May 04 '24 13:05 shockogit