镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Make it possible to install apps from the Store #30

Open

Description

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).

Activity

  1. yodurr commented on May 8, 2018

    @yodurr
    Contributor

    Love this feedback, thank you.

  2. WSLUser commented on May 10, 2018

    @WSLUser

    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 ~/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

  3. kelps commented on May 10, 2018

    @kelps
    Author

    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:

    1. 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)
    2. 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...

  4. kelps commented on May 10, 2018

    @kelps
    Author

    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...)

  5. WSLUser commented on May 11, 2018

    @WSLUser

    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.

  6. gep13 commented on May 11, 2018

    @gep13
    Collaborator

    Kelps Leite de Sousa (@kelps) can you perhaps to the documentation that you were looking at? Thanks!

  7. kelps commented on May 11, 2018

    @kelps
    Author

    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

  8. gep13 commented on May 11, 2018

    @gep13
    Collaborator

    Kelps Leite de Sousa (@kelps) thanks for providing those links, appreciate it!

  9. kelps commented on May 11, 2018

    @kelps
    Author

    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 ;)

  10. WSLUser commented on May 11, 2018

    @WSLUser

    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).

  11. bitcrazed commented on May 15, 2018

    @bitcrazed
    Contributor

    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 ;)

  12. WSLUser commented on May 15, 2018

    @WSLUser

    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)

  13. kelps commented on May 15, 2018

    @kelps
    Author

    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

  14. kelps commented on May 15, 2018

    @kelps
    Author

    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).

  15. WSLUser commented on May 15, 2018

    @WSLUser

    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.

  16. 15 remaining items

  17. added a commit that references this issue on Aug 8, 2018
  18. jjulianoatnv commented on Aug 26, 2019

    @jjulianoatnv

    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?

  19. kelps commented on Aug 26, 2019

    @kelps
    Author

    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...

    image

  20. jjulianoatnv commented on Aug 26, 2019

    @jjulianoatnv

    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.

  21. kelps commented on Aug 26, 2019

    @kelps
    Author

    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

  22. changed the title [-]Make is possible to install apps from the Store [/-] [+]Make it possible to install apps from the Store[/+] on Aug 28, 2019
  23. wireddown commented on Sep 9, 2019

    @wireddown

    Thanks for responding. FWIW, when I click your link to feedback hub I get, "Your account doesn't have access to this feedback."

    Same for me :(

  24. VijayS1 commented on Jan 13, 2020

    @VijayS1

    I have found a temporary solution by allowing the user to manually click the install button in the store app. see my solution here

  25. Floccinaucinihilipilification11 commented on Jun 30, 2020

    @Floccinaucinihilipilification11

    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.

  26. WSLUser commented on Jun 30, 2020

    @WSLUser

    Winget would most likely be the best way forward with this

  27. manhinhang commented on Jul 1, 2020

    @manhinhang

    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

  28. bitcrazed commented on Jul 1, 2020

    @bitcrazed
    Contributor

    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 ;)

  29. Floccinaucinihilipilification11 commented on Jul 1, 2020

    @Floccinaucinihilipilification11

    Rich Turner (@bitcrazed) You mean, about as error-prone as your average piece of Microsoft software? 🤣🤣🤣

  30. bitcrazed commented on Jul 1, 2020

    @bitcrazed
    Contributor
  31. Floccinaucinihilipilification11 commented on Jul 3, 2020

    @Floccinaucinihilipilification11

    Searching the MS Store from PowerShell, First Beta

    https://dev.to/ledgeruser2/search-microsoft-store-from-powershell-2bjj

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions