Forum Discussion
Edijs_Perkums_MasterPackager
Oct 31, 2022Brass Contributor
Windows 11 context menu
I want to create a Windows 11 context menu for my Win32 app, but I don't want to write the dll that uses IExplorerCommand . Is it possible to add a context menu item with an icon using a sparse package without having a dll with IExplorerCommand? I would like to achive something similar like PowerRename uses from PowerToys, but it uses a dll for the context menu.
- alexmarin89Iron Contributor
Yes you can add context menus by using MSIX Sparse Packages. First, you need to set your MSIX to allow external content to reference content outside its package, in a specific location on disk. Next, the app must point to your Win32 executable and lastly enable the Unvirtualized Resources capability. Once you have done all that, install the sparse package from your MSI package and you should by on your way. A more in-depth article on this here.
PS: I work for the Advanced Installer team.
- Edijs_Perkums_MasterPackagerBrass Contributor
alexmarin89 Can you provide a specific example of which xml elements need to be used to get a context menu item with an icon?
- alexmarin89Iron Contributor
Edijs_Perkums_MasterPackagerThe easiest example I can give if you want to use other tools such as VS or MSIX Packaging tool is to check this example here.