Cybersecurity
DevOps Cloud (ADM)
IT Operations Cloud
ZENworks – Installing Microsoft Store Applications using Bundles.
I have been seeing more and more customers requesting the ability to deliver Microsoft Store Apps via ZENworks. Thankfully, ZENworks is already up to this task. The sample bundles demonstrated can downloaded at the end of the article.
There are quite a few reasons why being able to deliver applications from the Microsoft Store is desirable. The first is that some applications are ONLY available from the store. “DigiTrak” is one such application and is used as an example since I specifically had a customer request to deliver this application via ZENworks. The ability to deliver applications to ZENworks to managed devices scattered over the internet without needing to actually host or even provide access to install files can be very beneficial. Example – When a device is on the corporate network, ZENworks could be configured to deliver the Firefox install from a corporate share or from the ZENworks repository. When a device is on the internet and possibly completed disconnected from all corporate and ZENworks servers, it could install the Microsoft Store via the Internet Cloud. The device simply needs to have previously received the assignment while connected to the cloud.
To see the installation of Microsoft Store Applications from the Windows Store in Action watch the following video:
The key will be using ZENworks to leverage the built-in “Winget” Tool from Microsoft. Winget is installed on all supported versions of Windows 10 and 11 by default and updated via System Updates.
https://learn.microsoft.com/en-us/windows/package-manager/winget/
Microsoft also maintains “Winget” on GitHub where the latest and even preview released of Winget can be downloaded and then deployed via ZENworks. This way an administrator can ensure they have the latest Winget outside of the traditional Windows update process. I will cover the process of downloading and deploying updated versions of Winget from GitHub in a later article.
Everything covered in today’s article and Demo should work just fine, even without the most current version of Winget.
Some “Store Apps” install into the “User Space/Profile” and do not require any special elevation. Other “Store Apps” install “Per Machine” and require elevation. We will cover both types of applications in today’s demo.
It is also possible to deliver “Windows Store Applications” offline without any direct connection to the Microsoft Store. ZENworks can handle this as well, but it will be covered in a follow-up article. The follow-up article will also cover how to present end-users with a list of “App Store” applications as a form of Self-Service and minimize the need for individual ZENworks Application Shortcuts for every possible Store App the users are permitted to install.
We will now delve into the more technical details on delivering “Windows Store Apps” to managed devices with ZENworks.
“User Based Microsoft Store App Installs – DigiTrak Exmple”
The first bundle we will look at is would be the most basic form of a bundle to install a Windows Store Application. This bundle installs “DigiTrak LWD Mobile” for the user and does so without the use of any support bundles.
The bundle simply calls “Winget.exe” as the logged-in user with the parameters of ‘install "%StoreApp%" --accept-source-agreements --accept-package-agreements’ and runs as the Logged-In-User.
(Note: Winget does not permit the installation of Applications as “Dynamic Administrator”. Running as the “System” account requires customer handling.)
On the “Settings” tab of the bundle, %StoreApp% is defined to match the name of the bundle being installed. How to determine the proper “Value” for %StoreApp% for different applications will be detailed later. To create a ZENworks bundle to install a different Microsoft Store Application as the logged-on user, simply make a copy of the application object and tweak the value of the variable.
The install tab has two additional actions to assist with native Microsoft Store Applications. The method required to launch a store app from the “Command line” is rather complex and launching via a “Shortcut” is one of the simplest methods. Since the “Shortcut” for such apps tend to be “Advertised” Shortcuts versus a standard shortcut with a target executable, the simplest way to deploy the shortcut is to make a copy of the advertised shortcut as an LNK file and then use an “Install Directory” to install the LNK file to the desired location. LNK files tend to confuse the “Install Fille” upload, which is why “Install Directory” is recommended.
The “Launch” tab of the bundle simply launches the LNK file directly to open the installed application.
(Note: Because this sample bundle is designed to work totally disconnected without access to any ZENworks server, the actual action used to create the LNK file is an advanced PowerShell script. The details on how the script works will be covered in a future update to a prior article on how to create Shortcuts with ZENworks.
System Based Microsoft Store App Installs – FireFox Example
Installing Microsoft Store-based applications with elevated rights to the entire PC is a little trickier. “Dynamic Administrator” will not work because when installing as a “User”, Winget will not function until the profile used has logged in via the normal Windows logon process. As a result, then the Dynamic Administrator loads its profile, Winget will not permit the application to install.
When attempting to launch “Winget” as the SYSTEM administrator, Winget will not run because Windows adds it to the “User” path and not the “System” path and as a result, will not be located. To get around this issue, the script to run as “SYSTEM” is slightly more complex. The PowerShell script needs to search for the most current version of Winget under “WindowsApps” and execute it. The only difference in the command to install the application in this bundle is that it uses the “AppID” instead of the “App Name”. Either method is acceptable so I chose to use both methods between the two bundles.
The %StoreApp% variable is again defined under the “Settings” tab as in the prior bundle.
Firefox installs to a traditional application files location, so it can be launched directly by calling “Firefox.exe” so there is no need to create a custom shortcut as with the prior bundle.
Finding “App Name” or “App ID” for the %STOREAPP%
The simplest way to find the required parameters is to manually install the application from https://apps.microsoft.com/store/apps on a given PC and then from PowerShell run “Winget list |select-string “*******” as shown above to get a list of all installed apps that match.
(Note: The “FIRST” time you run “Winget List” on a device, do not use the “Select-String” option. Without additional parameters, it will prompt to accept a license and ‘hang’.)
Future ZENworks “Microsoft Store” Articles
The article above is only the first of multiple articles planned on this topic.
One future article will demonstrate how to install applications from the “Windows Store” when access to the “Windows Store” is not available. This could be cases where the corporate network is disconnected from the internet or access to the store is blocked by Firewall or similar rules.
Another article is going to discuss how to create a generic “Microsoft Store Installer” bundle so that the core code for installing apps is stored in a single central place. This way if Microsoft ever changes how “Winget” works, one will only need to tweak the central bundle instead of every “Microsoft Store Bundle”.
Yet another article will do a “Deeper Dive” into “Winget” itself, how to ensure the latest versions is installed, and some additional features of “Winget” not covered in this article.
However, before I get the above articles published….My next “To Do” is to publish an article on how to enhance “ZESM Wifi Control” Policies so that when a Laptop is at School or the office, the device can only connect to the Corporate/School network but while away from the office, it can connect to other Wireless networks.
To see some of my favorite “ZENworks Tips and Tricks” check out the link: https://community.microfocus.com/members/craigdwilson/bookmarks
The ZIP below can be used to import the Sample Bundles into your Zone via the ZCC:
Top Comments