You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make it possible to install apps from the Store #30
There should be a way to improve the scripts to make it possible to install apps directly from the Store. Example: when I repave my dev machines, i install some apps like "Open Live Writer", Paint.NET, Spotify, some Edge extensions e a few other Store apps I use regularly.
It looks like the current scripts already install some appx files that supposedly come from the store, but the process it uses to do so seems to be a hack. It downloads the appx from a minified shortened url and then sideloads it. As far as I could tell, there is no way to get a fixed url to the appx files I want from the Store and do the same, as the urls have information as version in them. I also don't know if installing an app this way has any side effects on how the app is updated from the Store from that point forward, if at all, since it was sideloaded.
The optimal option would be to call some official Windows API passing the Store ID for the app we want to install and let it do it's thing by installing from the Store instead of sideloading. If the user doesn't already "own" the app, it could ask to confirm the purchase (even if free) or have a flag to do it if necessary (similar to the "-y" in Chocolatey).
(due to this example there are extra bits on the end and thus require the below)
Expand-Archive ~/Ubuntu.zip ~/Ubuntu
Distro.exe where Distro in this case = Ubuntu
We also have curl and tar available in Windows now. Don't see tar being very useful other than for Linux distros (or any tar files that somehow make it into the Store) but curl does sorta replace (but not entirely) Invoke-WebRequest
Nikita Ushakov (@DarthSpock) this doesn't address the issue I presented. This command is simply downloading something from somewhere. I want to install something from the Store, preferably using official Store APIs in my computer.
The .ps1 scripts here use this to download the .appx file from somewhere and then sideload them. My concerns with this are twofold:
The .appx download origin is not the Store (maybe the files in the script is the same file that is in the Store, but it is not coming from the same url the Store uses)
The .appx is being sideloaded. I'm not sure, but I think it will not get updated if the developer updates it in the Store. (please correct me if I'm wrong)
How do I install, for example, "Paint.NET" from the Store using scripting? Is it possible to generate an official download url for a Store .appx and use the combination Invoke-WebRequest + Add-AppxPackage to install it and still get updates? Do I need to know the app version in the Store to get the url or can I get a "default" url for the app that will always point to the latest version? How would I generate such urls for the apps I want/need to install when I repave?
An even better solution would be to have something like Acquire-StorePackage, where you would pass the app name, key or guid (or something) and it would install it from the Store. I understand that this request is more for the Windows Store team than for the champions in this repo, but I suppose the relevant people might see this and take pity on us folks trying to automate things...
Reacted by Thomas Lee, Mike Campbell, Tianrong Zhang, Reilly Wood, Jorge Morales, Tukusej’s Sirs, Oscar Beaumont, Mark Strasser and Jorge Sabino
Reading some documentation while replying to Nikita Ushakov (@DarthSpock)'s comment, I found a few articles using a combination of Get-AppxPackage + Add-AppxPackage to reinstall apps the current user removed or that got "lost" in some Insiders update. It got me thinking:
If I use Get-AppxPackage on my machine before repaving it to get and save the manifest files for the apps I will want to get back after the repave, it might be possible to use Add-AppxPackage later pointing to the saved manifests and have the apps reinstalled. I'll have to investigate that on my next repave (might be time to do it on my old Surface Pro 2 anyway). If I find the time over the weekend, I'll let you know of my findings.
I'm now also thinking of using Remove-AppxPackage in my script to remove some unwanted apps that Microsoft now insists on pushing to users (I am looking at you Candy Crush...)
Reacted by Jorge Morales, Tukusej’s Sirs and Oscar Beaumont
So the https://aka.ms/wsl-ubuntu-1604 is from the Store but automatically provides the option to install the appx without the need to go through the Store to get it. As far as getting updates goes, well if you're in a corporate network, you probably won't get them if you don't have Store access. Which makes standalone appx for different apps extremely useful. In larger organizations, there is typically a workstation that will have access in order to obtain certain apps and will go through a test, then update phase. We can't assume all devs will have access to the Store so while this may not fit your specific needs, it will address somebody else's.
Nikita Ushakov (@DarthSpock) Yep, I understand and agree this is a valid approach, but catering only to big companies isn't how things should work anymore. Specially in the dev circles, we have more and more hobbyists, remote workers and BYOD friendly companies.
What I am asking here (hoping actually) is for someone from Microsoft to acknowledge and address (or at least start the process of addressing) the need for APIs that will allow end users and IT managers to install apps from the Store in an automated way.
Of course, I also understand these kinds of APIs may be posed as a security threat and need to be properly implemented so as to not be abused by malicious actors (malware, viruses, rogue programs, hackers, disgruntled employees, bored/grounded kids, ...).
Anyway, hoping for a better automation story here and really excited by the mere existence of this repo. We are making progress ;)
Reacted by Gary Ewan Park, Chad Tolkien, escalonn, Sudhanshu, Jorge Morales and Tukusej’s Sirs
Yes, I think this project needs to address both scenarios. Those who can use the Store and those can't. I'm still looking forward to the day when we can honestly get all dev work done using a combo of WSL and Windows but unfortunately the dev community targetted doesn't include anything GUI or hardware related if it's for Linux, which is a shame in my mind. If they could get AMD/NVIDIA/Intel onto WSL, well now, they would be able to bring in far more profit and the rest of us would have the advantage of fully harnessing our hardware for WSL (thus drastically improving performance).
Thanks for discussing & sharing your thoughts on this.
As Nikita Ushakov (@DarthSpock) points out, to temporarily circumvent this limitation, we re-publish Store WSL distros on our CDN, but this isn't a scalable way to deal with the issue.
We regularly make the request to the Store team for a way to install Store packages via the command-line, and encourage you to do the same via Feedback Hub - your voices often carry more weight than ours ;)
Reacted by Kelps Leite de Sousa, Chad Tolkien, Andrew Harper, Rafael Dowling Goodman, Shmueli Englard, nzbart, escalonn, Ivan Semkin, Dogan Yavuz, Alexandre Nédélec and 7 more
We regularly make the request to the Store team for a way to install Store packages via the command-line
Where on the Feedback Hub would you recommend providing input or similarly, would a UWP UserVoice be appropiate? This is bearing in mind it would need to encompass more than just WSL Distros. (We'll need a make a list of commonly used apps)
Nikita Ushakov (@DarthSpock) I think the apis should allow installing apps directly from the Store, no matter what kind of app it is, so not only WSL or a specific kind/category. It should behave with the same restrictions you would get when using the Store app, so if an app is blocked by a policy or unavailable to the user, it also would be blocked via scripts. Any powershell commands created for this should use the same code the Store already uses, to ensure all the same rules apply.
I would also add some security features like: by default the command only installs apps the user already owns or apps that are free (there should be argument flags to override this behavior, of course). If the user doesn't own the app, the Store purchase UI should be displayed to confirme the purchase (there could be a flag that dispenses this step if the app is free, but it shouldn't be on by default).
Kelps Leite de Sousa (@kelps) Nothing you said is opposite of what I was saying. I'm in full agreement, there should be APIs for installing from the store. But if those APIs require connectivity to the Store itself, it will most likely be blocked on most corporate networks. But it also might be an easier sell to corporations to allow API connectivity for command-line only access vice giving users Store access (not to mention no admin account should have web access whatsoever including the API connectivity). This access could then be created as a security group in AD that only those who require it would be granted access to it.
This old issue remains relevant, and I found it by searching for a solution to a problem that impacts my daily job. I install Windows 10 from scratch frequently using an answer file for unattended install. One of the apps I need to install is Windbg Preview (from the microsoft store). Not having a proper way to install this in an unattended manner creates waste every time I do an OS install, where I have had to "fix" the computer by interactively installing the app from the microsoft store.
I am unable to view the content of the feedback hub issue that is mentioned in #30 (comment). Kelps Leite de Sousa (@kelps), did you ever get a helpful resolution within your feedback hub issue?
Jeff Juliano (@jjulianoatnv) No, I did not get any resolution to this. Unfortunately my feedback had only 22 Upvotes (+ another 13 upvotes in the first feedback I created in the wrong category).
Maybe with more votes, someone might prioritize it. One can aways hope...
Thanks for responding. FWIW, when I click your link to feedback hub I get, "Your account doesn't have access to this feedback."
I'm planning to file my own separate feedback later this week.
Weird. I just opened both feedbacks here. I don't get why we can only see and vote on feedbacks with the Feedback Hub app (this could and should be a website, at least for viewing and voting on feedbacks). Try from another computer, but if it doesn't work and you end up creating a new feedback, add a link to mine in yours and put your link here too so I and others can upvote it as well. I'll add a comment to mine with a link to yours when I have it. Maybe they get grouped together this way...
You can absolutely download the .appx files and their dependencies from the Microsoft Store via PowerShell in a completely automated fashion, as long as the app is already installed on your computer. It's not because you need the package contents, it's because you need the app info to force the Store to re-download the .appx files and keep them permanently.
Installing a new app from PowerShell from the store is a bit tricky. I am currently working on it.
Reacted by Rob Reynolds, Jorge Morales and Josh Seyer
I created CLI tools for download app from store but it required start Appium server locally to automate stuff. Some app from Microsoft app are not available on winget or chocolatey. https://github.com/manhinhang/ms-store-install-cli
Andrew (@manhinhang) Appreciate your effort here, but driving the Microsoft Store via UI automation is likely to be very error prone and fragile.
As WSLUser and others have stated and as I can confirm, installation via winget will be the preferred approach. Appreciate everyone's patience, but it'll be worth the wait ;)
Reacted by Jorge Morales and Cameron Tacklind
Floccinaucinihilipilification11 commented on Jul 1, 2020
Activity
yodurr commentedon May 8, 2018
Love this feedback, thank you.
WSLUser commentedon May 10, 2018
So in Windows proper we do have this Powershell command (The example comes from https://docs.microsoft.com/en-us/windows/wsl/install-on-server):
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.zip -UseBasicParsing(due to this example there are extra bits on the end and thus require the below)
Expand-Archive ~/Ubuntu.zip ~/UbuntuDistro.exewhere Distro in this case = UbuntuWe also have
curlandtaravailable in Windows now. Don't seetarbeing very useful other than for Linux distros (or any tar files that somehow make it into the Store) butcurldoes sorta replace (but not entirely)Invoke-WebRequestkelps commentedon May 10, 2018
Nikita Ushakov (@DarthSpock) this doesn't address the issue I presented. This command is simply downloading something from somewhere. I want to install something from the Store, preferably using official Store APIs in my computer.
The .ps1 scripts here use this to download the .appx file from somewhere and then sideload them. My concerns with this are twofold:
How do I install, for example, "Paint.NET" from the Store using scripting? Is it possible to generate an official download url for a Store .appx and use the combination
Invoke-WebRequest+Add-AppxPackageto install it and still get updates? Do I need to know the app version in the Store to get the url or can I get a "default" url for the app that will always point to the latest version? How would I generate such urls for the apps I want/need to install when I repave?An even better solution would be to have something like
Acquire-StorePackage, where you would pass the app name, key or guid (or something) and it would install it from the Store. I understand that this request is more for the Windows Store team than for the champions in this repo, but I suppose the relevant people might see this and take pity on us folks trying to automate things...kelps commentedon May 10, 2018
Reading some documentation while replying to Nikita Ushakov (@DarthSpock)'s comment, I found a few articles using a combination of
Get-AppxPackage+Add-AppxPackageto reinstall apps the current user removed or that got "lost" in some Insiders update. It got me thinking:If I use
Get-AppxPackageon my machine before repaving it to get and save the manifest files for the apps I will want to get back after the repave, it might be possible to useAdd-AppxPackagelater pointing to the saved manifests and have the apps reinstalled. I'll have to investigate that on my next repave (might be time to do it on my old Surface Pro 2 anyway). If I find the time over the weekend, I'll let you know of my findings.I'm now also thinking of using
Remove-AppxPackagein my script to remove some unwanted apps that Microsoft now insists on pushing to users (I am looking at you Candy Crush...)WSLUser commentedon May 11, 2018
So the https://aka.ms/wsl-ubuntu-1604 is from the Store but automatically provides the option to install the appx without the need to go through the Store to get it. As far as getting updates goes, well if you're in a corporate network, you probably won't get them if you don't have Store access. Which makes standalone appx for different apps extremely useful. In larger organizations, there is typically a workstation that will have access in order to obtain certain apps and will go through a test, then update phase. We can't assume all devs will have access to the Store so while this may not fit your specific needs, it will address somebody else's.
gep13 commentedon May 11, 2018
Kelps Leite de Sousa (@kelps) can you perhaps to the documentation that you were looking at? Thanks!
kelps commentedon May 11, 2018
Gary Ewan Park (@gep13), maybe "documentation" isn't a proper way to classify them. How about "tech articles"? Here are a couple:
How to reinstall default apps in Windows 10
Adding and Removing Windows 10 Apps with PowerShell
gep13 commentedon May 11, 2018
Kelps Leite de Sousa (@kelps) thanks for providing those links, appreciate it!
kelps commentedon May 11, 2018
Nikita Ushakov (@DarthSpock) Yep, I understand and agree this is a valid approach, but catering only to big companies isn't how things should work anymore. Specially in the dev circles, we have more and more hobbyists, remote workers and BYOD friendly companies.
What I am asking here (hoping actually) is for someone from Microsoft to acknowledge and address (or at least start the process of addressing) the need for APIs that will allow end users and IT managers to install apps from the Store in an automated way.
Of course, I also understand these kinds of APIs may be posed as a security threat and need to be properly implemented so as to not be abused by malicious actors (malware, viruses, rogue programs, hackers, disgruntled employees, bored/grounded kids, ...).
Anyway, hoping for a better automation story here and really excited by the mere existence of this repo. We are making progress ;)
WSLUser commentedon May 11, 2018
Yes, I think this project needs to address both scenarios. Those who can use the Store and those can't. I'm still looking forward to the day when we can honestly get all dev work done using a combo of WSL and Windows but unfortunately the dev community targetted doesn't include anything GUI or hardware related if it's for Linux, which is a shame in my mind. If they could get AMD/NVIDIA/Intel onto WSL, well now, they would be able to bring in far more profit and the rest of us would have the advantage of fully harnessing our hardware for WSL (thus drastically improving performance).
bitcrazed commentedon May 15, 2018
Thanks for discussing & sharing your thoughts on this.
As Nikita Ushakov (@DarthSpock) points out, to temporarily circumvent this limitation, we re-publish Store WSL distros on our CDN, but this isn't a scalable way to deal with the issue.
We regularly make the request to the Store team for a way to install Store packages via the command-line, and encourage you to do the same via Feedback Hub - your voices often carry more weight than ours ;)
WSLUser commentedon May 15, 2018
Where on the Feedback Hub would you recommend providing input or similarly, would a UWP UserVoice be appropiate? This is bearing in mind it would need to encompass more than just WSL Distros. (We'll need a make a list of commonly used apps)
kelps commentedon May 15, 2018
I am almost sure I had already added this feedback using the Feedback Hub app a long time ago (certainly more than a year).
I didn't find it, so I created a new one in the following link. Upvotes are appreciated. Provide a way (scripting api/commands) for users to install/remove Store apps via command-line scripts
kelps commentedon May 15, 2018
Nikita Ushakov (@DarthSpock) I think the apis should allow installing apps directly from the Store, no matter what kind of app it is, so not only WSL or a specific kind/category. It should behave with the same restrictions you would get when using the Store app, so if an app is blocked by a policy or unavailable to the user, it also would be blocked via scripts. Any powershell commands created for this should use the same code the Store already uses, to ensure all the same rules apply.
I would also add some security features like: by default the command only installs apps the user already owns or apps that are free (there should be argument flags to override this behavior, of course). If the user doesn't own the app, the Store purchase UI should be displayed to confirme the purchase (there could be a flag that dispenses this step if the app is free, but it shouldn't be on by default).
WSLUser commentedon May 15, 2018
Kelps Leite de Sousa (@kelps) Nothing you said is opposite of what I was saying. I'm in full agreement, there should be APIs for installing from the store. But if those APIs require connectivity to the Store itself, it will most likely be blocked on most corporate networks. But it also might be an easier sell to corporations to allow API connectivity for command-line only access vice giving users Store access (not to mention no admin account should have web access whatsoever including the API connectivity). This access could then be created as a security group in AD that only those who require it would be granted access to it.
15 remaining items
acting on feedback from @bitcrazed by removing most of the pauses and…
jjulianoatnv commentedon Aug 26, 2019
This old issue remains relevant, and I found it by searching for a solution to a problem that impacts my daily job. I install Windows 10 from scratch frequently using an answer file for unattended install. One of the apps I need to install is Windbg Preview (from the microsoft store). Not having a proper way to install this in an unattended manner creates waste every time I do an OS install, where I have had to "fix" the computer by interactively installing the app from the microsoft store.
I am unable to view the content of the feedback hub issue that is mentioned in #30 (comment). Kelps Leite de Sousa (@kelps), did you ever get a helpful resolution within your feedback hub issue?
kelps commentedon Aug 26, 2019
Jeff Juliano (@jjulianoatnv) No, I did not get any resolution to this. Unfortunately my feedback had only 22 Upvotes (+ another 13 upvotes in the first feedback I created in the wrong category).
Maybe with more votes, someone might prioritize it. One can aways hope...
jjulianoatnv commentedon Aug 26, 2019
Thanks for responding. FWIW, when I click your link to feedback hub I get, "Your account doesn't have access to this feedback."
I'm planning to file my own separate feedback later this week.
kelps commentedon Aug 26, 2019
Weird. I just opened both feedbacks here. I don't get why we can only see and vote on feedbacks with the Feedback Hub app (this could and should be a website, at least for viewing and voting on feedbacks). Try from another computer, but if it doesn't work and you end up creating a new feedback, add a link to mine in yours and put your link here too so I and others can upvote it as well. I'll add a comment to mine with a link to yours when I have it. Maybe they get grouped together this way...
Mine is https://aka.ms/AA1bl1g
[-]Make is possible to install apps from the Store [/-][+]Make it possible to install apps from the Store[/+]wireddown commentedon Sep 9, 2019
Same for me :(
VijayS1 commentedon Jan 13, 2020
I have found a temporary solution by allowing the user to manually click the install button in the store app. see my solution here
Floccinaucinihilipilification11 commentedon Jun 30, 2020
You can absolutely download the .appx files and their dependencies from the Microsoft Store via PowerShell in a completely automated fashion, as long as the app is already installed on your computer. It's not because you need the package contents, it's because you need the app info to force the Store to re-download the .appx files and keep them permanently.
Installing a new app from PowerShell from the store is a bit tricky. I am currently working on it.
WSLUser commentedon Jun 30, 2020
Winget would most likely be the best way forward with this
manhinhang commentedon Jul 1, 2020
I created CLI tools for download app from store but it required start
Appiumserver locally to automate stuff. Some app from Microsoft app are not available onwingetorchocolatey.https://github.com/manhinhang/ms-store-install-cli
bitcrazed commentedon Jul 1, 2020
Andrew (@manhinhang) Appreciate your effort here, but driving the Microsoft Store via UI automation is likely to be very error prone and fragile.
As WSLUser and others have stated and as I can confirm, installation via winget will be the preferred approach. Appreciate everyone's patience, but it'll be worth the wait ;)
Floccinaucinihilipilification11 commentedon Jul 1, 2020
Rich Turner (@bitcrazed) You mean, about as error-prone as your average piece of Microsoft software? 🤣🤣🤣
bitcrazed commentedon Jul 1, 2020
jhfjhfjhfgjkhgkjghj (@Floccinaucinihilipilification11) No, even worse than that!

Floccinaucinihilipilification11 commentedon Jul 3, 2020
Searching the MS Store from PowerShell, First Beta
https://dev.to/ledgeruser2/search-microsoft-store-from-powershell-2bjj