Jerry Nixon
Jerry Nixon

Reputation: 31831

Using a Script; install a Windows Store App

Requirement: install a Windows Store app without requiring the user to nav to the store and click Install. Perhaps a batch file. Perhaps a Powershell script. Perhaps something else.

This is not a side-load question; this is a public, Windows Store question

Scenario 1: Maybe, my company has a new app in the Store that I want to push it out to every single employee without requiring them to nav to the Store and click Install.

Scenario 2: Maybe, my company has just subscribed to online CRM (or something) and I want to push out the CRM client to every single employee without requiring them to nav to the Store and click Install.

Scenario 3: Maybe, my company is hiring new employees & preparing new computers. In their first-time login script (or something) I want to ensure they have the Apps important to my business - without requiring they nav to the Store and click Install (perhaps several times).

Scenario 4: Maybe, my company is very virtualized, and we provision new VMs all the time. The VM performs fine, but bandwidth is our problem. To streamline the user experience, users logon and watch as the VM prepares itself for them by downloading and installing Windows Store Apps for them.

Please don't pick on the scenarios, I am just trying to give a possible use case.

Complication: I have been told (by people who know this sort of thing) that there is no built-in API to accomplish this. But we are developers. Nobody dares tell us something is impossible. But, if there isn't a built-in API, how could a network administrator or developer on a team solve this problem? I realize this question is somewhat brainstorming. But it gets asked over and over and over and over. I would like to provide a resource for others who might be considering the same scenario.

Hey, perhaps this is easy. Please share.

Upvotes: 15

Views: 10351

Answers (3)

Willie
Willie

Reputation: 121

Almost 8 years into the future and we are getting closer to an answer! Recent versions of Windows 10 now come with "winget" and they've added some Microsoft Store support.

It seems hit and miss as to what apps I can install. Using Spotify as an example,

winget search "Spotify"

Probably best to install via id instead though:

winget install 9NCBCSZSJRSB

Since it stops and asks if you want to agree to the terms and conditions, you answer automatically via:

echo Y | winget install 9NCBCSZSJRSB

As one of my references states: "What’s interesting is that if you have the Microsoft Store open at the same time as running winget install, you’ll see the install progress updating in real time in both the command line window and the Store GUI."

There is plenty left to be desired with this answer since most automated installs will probably just run into the error "Verifying/Requesting package acquisition failed: no store account found". But, if you're able to run it as the user, you might have some more luck. I'd love to see this tool get more finished so it can actually accomplish all the scenarios you listed. As Microsoft updates the tool, we could update this answer accordingly.

References and notes:

Upvotes: 1

stevlars
stevlars

Reputation: 96

We have SCCM in our environment and some PS scripts are deployed in C:\Windows\CCM\SignedScripts that may be worth investigating. They are not SCCM specific. The most relevant of the three is "C:\Windows\CCM\SignedScripts\installwindows8app.ps1". The script just passes parameters to Add-AppxPackage though I am not sure how it would get the path to the .appx in the MS store. You can get the location of installed apps on a model machine with (Get-AppxPackage -Name "*").InstallLocation but then you would need to repackage, store, deploy, and maintain them--not really the solution you were looking for. Between investigating how SCCM would do it with these scripts and digging in the installed apps, maybe someone runs across something.

Upvotes: 3

Related Questions