Azure Virtual Desktop (AVD) - Packaging the SQL Server Management Studio (SSMS) to MSIX

Published Jun 01 2022 05:13 PM 2,112 Views

In this post I will demonstrate how to package the Win32 SQL Server Management Studio (SSMS) to MSIX, that will be consumed later on Azure Virtual Desktop through MSIX App Attach.


MSIX is a Windows app package format that provides a modern packaging experience to all Windows apps. The MSIX package format preserves the functionality of existing app packages and/or install files in addition to enabling new, modern packaging and deployment features to Win32, WPF, and Windows Forms apps.


MSIX reduces the complexity of managing applications and golden images in AVDs. Through AVD application groups, applications can be instantly available without the need to create new Golden images. When FSLogix FSLogix Profile Containers and MSIX App Attach are used together, the operating system remains clean and the data, profile, and applications are completely separate.


The MSIX Packaging Tool enables you to repackage your existing desktop applications to the MSIX format. It offers both an interactive UI and a command line for conversions and gives you the ability to convert an application without having the source code. We want to enable IT Pros to convert their existing assets to MSIX, to give them a better way to do packaging and app management.




In case you can't install the MSIX Packaging Tool from Microsoft Store, you can download the offline version here.


Another great option is to use the free Hyper-V image Windows 10 MSIX packaging environment that provides a Windows 10 image with the MSIX Packaging Tool already installed.





Packaging the SSMS to MSIX


Open the MSIX Packaging Tool and click Application package to create a new package for the application:






The MSIX Packaging Tool will monitor the changes that will be made to the operating system. For this, it is possible to use a virtual machine to install the application or the physical machine itself.


The best scenario is to use a virtual machine so that the same process can be repeated if necessary. It is important that the machine, used to install the application, does not contain the previously installed applications and their components.


Choose the desired scenario and click the Next button. While running the tool on a virtual machine, I selected the first option:




n this step, the tool will check if the MSIX Packaging Tool driver is already installed and will also disable Windows Update to decrease the number of changes to the operating system. The driver is already installed in the version provided by Hyper-V.





If you got an error to install the tool driver, please refer to this post that describes how to manually download and install the driver up to version 1809. Starting with version 1903, you need to download the Windows 10 Features on Demand ISO and copy the

After verifying that the driver is installed, click the Next button.


Provide the installer of your application. It is important to note that the installer is not required, as the tool monitors all changes made to the operating system. I will provide the SSMS-Setup-ENU.exe installer.


Select the certificate that will be used to sign the package. The certificate is only required in case you want to install the app outside of the Microsoft Store (sideloading). For more information about how to create a self-signed certificate, please check this doc.




The next step is to fill in information such as the package name, the description that will be displayed to the user during installation, the vendor's name (must be the same as the certificate), and the version number. Fill in the requested information and click the Next button:





The following screen will appear and from then on, the tool will monitor the changes made to the operating system.




The installation will start automatically because we provided the SSMS installer.





In this step, I am just changing the destination path to reduce the path size. This is totally optional.





Click on Install and wait for the installation.




After completing the setup:




At the end of the installation, click the Next button. On the next screen, you need to define which apps will be visible in the start menu. I am keeping the suggested ones:




Click the Next button to continue.


The next screen asks for confirmation if the environment monitoring is done. Click the Yes, move on to continue:





On the next screen, just click on the Next button, since the SSMS application doesn't implements any service:





Now it is necessary to inform where the package will be generated, as well as it is possible to edit the package before saving it. Click the Package Editor button to review the package structure.


If we just finish the packaging process here, we will get the following error after trying to run the Microsoft SQL Server Management Studio 18 packaged version:


Cannot find one or more components. Please reinstall the application

Using PROCMON, I just figured out that the issue happens because the SSMS tries to write an entry in the virtual registry of the package:


Process: C:\Program Files\WindowsApps\SSMS_1.0.0.0_x64__kz5d2ck10dqg4\VFS\ProgramFilesX86\SSMS\Common7\IDE\Ssms.exe
Operation: RegCreateKey
Path: \REGISTRY\WC\Silo1fa4901f-dcbc-d730-8d7c-9e234216dc86user_sid\SOFTWARE\Microsoft\SQL Server Management Studio\


It can be fixed using the new flexible virtualization feature that provides a way for your app to declare that some set of its files and Registry entries should be visible to other apps; and that those should persist on app uninstall. All other files and Registry entries are not visible to other apps; and are removed on uninstall.


Starting from Windows 10, version 21H1, the system retains the existing behavior of the unvirtualizedResources restricted capability, and the RegistryWriteVirtualization and FilesystemWriteVirtualization properties. In addition, the system adds the ability for your app to declare specific folders and/or Registry keys that you want to be unvirtualized.


Click on the Open File button to edit the package manifest (AppxManifest.xml file):





Add the following line in the XML namespace session:








The next step is to declare the following code inside the Properties session:


       <virtualization:ExcludedKey>HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\</virtualization:ExcludedKey>





Finally, the last change is to add the following required capability:


<rescap:Capability Name="unvirtualizedResources" />





Save and close the file.


Click on the Virtual registry menu item, browse the REGISTRY\USER[{CurrentUserSID}]\SOFTWARE\Microsoft\, and delete the SQL Server Management Studio key:






Follows the expected result:






When finished, click the Create button and inform where the file should be generated:






The following message will be displayed informing you that the package has been generated.






Please notice that now the package can be deployed only using PowerShell or via App Attach.




Follows the package details:





Follows the app running as MSIX on Windows 11:





I hope you like it.


Version history
Last update:
‎Jun 01 2022 05:13 PM
Updated by: