Win32 Application Supersedence

HOW TO: Update Win32 apps with Endpoint Manager

Updating Win32 applications with Endpoint Manger is a cumbersome task.  Newer versions of applications wont install if a previous versions of the application is present on the device. The first step is to remove the application from the device and then creating a new deployment. This could result that the user isn’t able to use a particular application since the admin had to wait for the uninstall deployment to complete. Or maybe you created some custom installation which would remove the application and then install the newer version of that application. Either way the process was not easy..

Microsoft has now introduced a new function called Win32 app Supersedence, which enables you to easily update or supersede newer applications. This article will describe the new functionality and how to use it in your environment. At the moment of writing this article the functionality is still in preview, so it might be subject to change.

Scenario

Let’s say you have deployed the Citrix Receiver application via a Win32 Endpoint Manager deployment. The Citrix Receiver applications is being replaced by the new Citrix Workspace application and you need to deploy the Citrix Workspace application to the devices which are being managed by Endpoint Manger.

Initial Deployment

For the initial deployment an IntuneWin package was created (if you’re interested in how to create one view this article) and deployed via Endpoint Manger. The applications were successfully installed on all the clients.

One topic that has now become more important is the ability to know what version is installed. How can one identity which version that is active on the client. The key in this whole process is the ability to identify an unique value that determines the version of the application. Maybe the version number can be found within the name of the .exe or can the version be found in the registry. For Citrix the version can be found in the registry. In the path Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Citrix\InstallDetect\{A9852000-047D-11DD-95FF-0800200C9A66} there is the value DisplayVersion which holds the value of the installed Citrix Receiver. This value can be used in the Detection rules to validate whether or not the application is installed. So when deploying your applications put some extra time in detecting the version of your application, which will make your life easier in the long run. How to use these detections rules I will show later on.

Supersedence

You have created a new package for the Citrix Workspace application and are ready to deploy the package via Endpoint Manger. Go to Endpoint.microsoft.com >Choose Apps > Windows > Add > For app type select Windows app (Win32)

Select your new package and fill out the necessary app information.

At the program settings fill in your install and uninstall commands. Make sure the also the uninstall command works as expected. This uninstall command can be used by the Supersedence functionality depending on your update strategy. I will explain this behavior later on in this article.

The detection rules are used to determine if an application is installed. As mentioned earlier it would be wise to use a value that the unique for the application and the version of that application. If there is no distinct difference between the two versions Endpoint Manger won’t be able to determine which application to install. For this article I’m using the registry detection rule.

  • Key path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Citrix\InstallDetect\{A9852000-047D-11DD-95FF-0800200C9A66}
  • Value name: DisplayVersion
  • Detection Method: String comparison
  • Operator: Equals
  • Value: 19.9.0.21

We will skip the Dependencies tab and go straight to the new Supersedence tab. Here you will be able to select the application that is being superseded by the new application. In our case this is the Citrix receiver version 14.12.0.18020.

600

You now have the option to select yes or no at the Uninstall previous version. When to use what option? When you choose to uninstall the previous application Endpoint Manger will use the uninstall command configured in your Endpoint Manger Deployed, in the example uninstall.cmd. This option can be used if you completely replace the application with a new application, let’s say Citrix Receiver with the Windows Virtual Desktop client. Or you can use the uninstall feature to completely reconfigure the new application. In the Supersedence configuration this option is referred as Replace. If you enabled toast notifications the user will also be informed that the application is begin uninstalled and the new application is begin installed.

If you chose not to uninstall the application Endpoint Manger will try to update the application with the newer version. For this to function the application installer needs to be able to update from an older version. This way any configured settings should be honored as long as the application support this. In the Supersedence configuration this option is referred as Update. If you enabled toast notifications the user will also be informed that the application is begin updated and the new application is begin installed.

What option to choose really depends on your application. In many cases updating the application would be preferable, but replacing the applications can also have its advantages. As always the answer would be, it depends. So make sure to test and validate before going into production with the new application.

More information

MSIX App Attach with CIM

HOW TO: Use CIM for WVD App Attach

To use MSIX App Attach you need to extract an MSIX package to a VHD or a VHDx format to then mount the drive to the Virtual Machine. But there’s a third format that can be used, namely Composite Image Files System or .CIM in short. This is a new file system introduced by Microsoft to use in combination with MSIX App Attach. Why need a new file system? CIM provides better performance when compared to VHD(x). Microsoft preformed a comparison test between VHDX and CIM where they mounted 500 files in each format, each file being 300 MB. With the following results:

SpecsVHDCimFS
Average mount time356 ms255 ms
Average unmount time1615 ms36 ms
Memory consumptions6% (of 8 GB)2% (of 8 GB)
CPU (count spike)Maxed out multiple timesNo impact

As you can see the load on the machine with CIMFS is significantly lower than when compared to the mounting of VHD’s. This information was shared during the Windows Virtual Desktop masterclass. Microsoft host these sessions every few month and are free to follow, so make sure to sign up for the next one! The sessions are always packed with information and new announcements. That begin said let see how to create a CIM file.

Prerequisites

Creating CIM file

The MSIXMGR tool has some handy functionalities backed in. Extracting a MSIX to a VHDx there were many steps involved like creating a VHDx file, mounting and extracting the MSIX and dismounting the disk again. The MSIXMGR tool automates these steps. Now we are going to generate the CIM files but the same steps can be used for the creation of VHD(x) files.

  • Open Command prompt in elevated mode
  • Navigate to the MSIXMGR location (c:\temp\msixmgr)
  • Run the following command
msixmgr.exe -Unpack -packagePath "C:\Users\Stephan\Desktop\ CitrixReceiver_3.0.1.0_x64__v1hrd262mcs5e.msix" -destination c:\temp\output\CitrixReceiver_3.0.1.0_x64.cim -applyacls -create -vhdSize 100 -filetype “CIM” -rootDirectory apps

In c:\temp\output you will find all the different .cim files. You will need all the files for in order to make this work.

If you don’t want to use CIM and just a VHDx file you can use the same command but simply replace cim with VHD(x).

msixmgr.exe -Unpack -packagePath "C:\Users\Stephan\Desktop\ CitrixReceiver_3.0.1.0_x64__v1hrd262mcs5e.msix" -destination c:\temp\output\CitrixReceiver_3.0.1.0_x64.vhdx -applyacls -create -vhdSize 100 -filetype “VHDX” -rootDirectory apps

MSIX App Attach

Copy all the .cim files you created to the file share that have been set up for MSIX App Attach.

In the Azure Portal go to your host pool and select MSIX Packages. Choose Add and provide the UNC path to the cim file. In my case this is \\man-0\appattach\CitrixReceiver_3.0.1.0_x64.cim. Make sure to put the State on Active.

640640Add MSIX App Attach Package

Go to your Application Group settings. Here you have two options. The first option is to include the application in the Default Desktop application group. The application will be available to the users when he signs in. Or you can create a remote application group which will only provide the remote app. In my case I will be using the default desktop group. So select the group, choose Applications and choose Add. From the dropdown you can select the newly added application. In my case this is Citrix Workspace. Make sure the assign the application group to you users.

To test sign in on the host pool where you should now see the newly added application based!

Other resources