Deploying Microsoft Store Apps
May 6, 2020
Senior Consultant Dan Svendsen. Employed by CapaSystems since 2006. Dan is a competent and careful consultant with much focus on the client. He is detail-oriented in all he does. He is also the driving force behind CapaFactory.

Store Apps: The primary purpose of this article is to provide you with a solution on how to install Microsoft Store apps through CapaInstaller.

However, much of the content can also be valuable, if you are managing another client management tool.

Challenge

If you want to deploy Microsoft Store apps through a client management tool, you will probably face 2 major challenges.

  1. Installation files for Microsoft Store apps are not always easy to obtain and are rarely provided as MSI or EXE files.
  2. Microsoft Store Apps are user-based, and most client management tools are executing scripts in the SYSTEM account context

Download application files for deployment

First we need to download the installation files for the Microsoft Store app – these files are using AppxBundle as file extension.

In this article we will use the Microsoft Wireless Display Adapter app.

Open the Microsoft Online Store (not the built-in Microsoft Store) in your favorite webbrowser and search for the desired app.

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-1.png

Copy the URL from the address bar.

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-2.png

Remove all text after and including the question mark.

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-3.png

Open your favorite online link generator for Microsoft Store. In this example we are using https://store.rg-adguard.net/

Copy the link into the online link generator and choose Retail as type

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-4.png

You are now presented with a long list of files for the both the application and for all the mandatory prerequisites.

Download the newest version of the application (AppxBundle) you want to install.

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-5.png
Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-6.png


Enable Apps Sideload

Before we can install the application, we need to allow Windows to Sideload apps

You can use the interface to enable the setting

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-7.png
Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-8.png

.. or you can use the registry editor to enable the setting

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-9.png

Test installation

We are now ready to test the installation. Install the downloaded application using the PowerShell command below from an elevated PowerShell command prompt.

Add-AppxPackage -Path C:\temp\Microsoft.SurfaceWirelessDisplayAdapter_3.4.137.1000_neutral___8wekyb3d8bbwe.AppxBundle

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-10.png

Deploy through CapaInstaller

CapaInstaller has an option to execute package scripts in user context – the scripts are called User Configuration Scripts

User configuration scripts are executed the first time a user logs on, after the computer package containing the user configuation script has been installed.

Hence, all you need to do, is to create a computer package with a user configuration script.

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-10-2.png

The main script in the computer package is used to copy the installation files to a temporary location on the computer.

The user configuration ccript in the computer package is used to install the application from the temporary location.

You have now solved the second major challenge and are ready to deploy the Microsoft Store app.

Field Notes

This section contains various notes from the field, that might come in handy when deploying or testing Microsoft Store apps.

Application Dependencies

Even though AppxBundle files contains all mandatory dependencies, sometimes a core component in the operating system is outdated and not compatible with the application that you are trying to install.

In the example below, we are trying to install the Microsoft Company Portal 2019 app, but the Microsoft .NET Framework component is outdated. The required .NET component version is 2.2.27405.0 but the installed version is 2.2.27011.0

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-15.png

If you already have the concerned app installed somewhere, you can query all the mandatory dependencies using the PowerShell command described later in this post.

Installation as Local System Account

As I mentioned earlier, one of the major challenges when you want to install Microsoft Store apps, is that they are user-based.

Trying to install a Microsoft Store app using the SYSTEM account often causes failure, as the one below.

Add-AppxPackage -Path C:\temp\Microsoft.SurfaceWirelessDisplayAdapter_3.4.137.1000_neutral___8wekyb3d8bbwe.AppxBundle

Internet Access

Microsoft Store apps requires internet access the first time they are started.

Without internet access, the app will only blink, the first time it is started.

PowerShell Commands

Get-AppxPackage

When a Microsoft Store app is installed, you can view the prerequisites (also called dependencies) by running the command below.

Get-AppxPackage -Name Microsoft.Surface*

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-11.png

Remove-AppxPackage

If you need to uninstall a Microsoft Store app, you can run the command below.

Get-AppxPackage -Name Microsoft.Surface* | Remove-AppxPackage

Dette billede har en tom ALT-egenskab (billedbeskrivelse). Filnavnet er Microsoft-Store-App-HQ-12.png