Oct 31 2022 07:04 AM
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.
Oct 31 2022 02:59 PM
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.
Nov 02 2022 11:58 AM
@alexmarin89 Can you provide a specific example of which xml elements need to be used to get a context menu item with an icon?
Nov 02 2022 02:02 PM
@Edijs_Perkums_MasterPackagerPretty much any context-menu entry for the Windows Shell is stored in the registry, which you can access using console APIs, Win32 API, or console applications ( some could require a standalone UWP app, although you could also use WinUI 2/3, or another built-in API. )
"Windows Command-Line: Introducing the Windows Pseudo Console (ConPTY)" -> https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-conso...
"Find the Application User Model ID of an installed app" -> https://learn.microsoft.com/en-us/windows/configuration/find-the-application-user-model-id-of-an-ins...
"Application User Model IDs (AppUserModelIDs)" -> https://learn.microsoft.com/en-us/windows/win32/shell/appids#registering-an-application-as-a-host-pr...
"Verbs and File Associations" -> https://learn.microsoft.com/en-us/windows/win32/shell/fa-verbs
"Extending the Context Menu and Share Dialog in Windows 11" -> https://blogs.windows.com/windowsdeveloper/2021/07/19/extending-the-context-menu-and-share-dialog-in...
"Application Registration" -> https://learn.microsoft.com/en-us/windows/win32/shell/app-registration
"Shell (COM)" -> https://learn.microsoft.com/en-us/windows/win32/com/shell
"WinUI" -> https://microsoft.github.io/microsoft-ui-xaml/
"Registry Reference" -> https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry-reference
"reg commands" -> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
"regini" -> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/regini
"about_Registry_Provider (PowerShell)" -> https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_registry_p...
"Windows registry information for advanced users" -> https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-...
"Registry Hives" -> https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry-hives
Nov 02 2022 02:15 PM
@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.
Nov 03 2022 02:25 AM