Context menu in MSIX

Written by Alex Marin · May 10th, 2019

In our days, many apps offer you a context menu. A context menu is a pop-up menu that appears after a user interaction, for example, in Windows, when you perform a right-click. However, there are two types of context menus:

  • Shell menus - which point to the application exe that you want to run, with or without parameters
  • Shell extensions - point to a dll.

MSIX Context Menus

According to Microsoft's documentation you have the option to add file type associations in your MSIX. A file type association can have a context menu, but there are some downsides regarding this.

For a file type association to appear on the system, this must be added in AppManifest.xml inside the MSIX. This means that even if you have the registry captured in the Registry.dat, but not in the manifest, those registries are not sideloaded like in APPV, and the context menu does not appear.

Another downside regarding this is the fact that you have to point precisely to a file type to add a context menu. If you want a general context menu for all file types, like Notepad++ for example, you cannot achieve that with MSIX.

We also observed that even if you want to add a context menu for a single file type association, this must point to an executable. Going back to Notepad++, this adds a context menu that points to “C:\Program Files (x86)\Notepad++\NppShell_06.dll”. However, even if we declare a file type association for .txt extensions in the Manifest, and add the context menu to point to the above dll, after installation your context menu does not appear.

Conclusion

In the past, adding a context menu to your application was easy with MSI. With MSIX, Microsoft adds a bit of complexity in achieving this, but there are still some missing pieces in some scenarios. Hopefully, in the future Microsoft will address this.

However, with Advanced Installer you don’t have to worry about manually changing the manifest file, everything is done automatically with a dedicated GUI for Advanced Configuration.

Comments: