Create shell context menu for your application
The following article uses options that are available starting with the Professional edition and project type.
The Context Menu Options, also known as the shell context menu or simply the context menu, refers to the menu that appears when you right-click on various items such as files, directories (folders), the background of the Windows Explorer window, or drives in the file manager.
The context menu provides a convenient way to access various actions or commands related to the selected item.
These actions can vary depending on the type of item clicked and the applications installed on your system, but common options include:
- Open: Opens the selected item using its default application.
- Cut, Copy, Paste: Opens the selected item using its default application.
- Delete: Deletes the selected item permanently.
- Rename: Allows you to rename the selected item.
- Properties: Opens a dialog box displaying properties and information about the selected item.
These are just a few examples of common context menu options. The actual options available may vary depending on your system configuration, installed applications, and any customizations you have made. The context menu is a versatile tool that provides quick access to various actions and commands, helping to streamline file management and navigation in Windows.
1. Create project
After launching Advanced Installer, you will be presented with a dialog where you can choose the type of the project you want to create.
Select Professional and press the Create Project button. The new project has been created and from now on you will edit it.
Save the project and give it an appropriate name - let's say "Shell Entension
Demo" for this example.
2. Enter product details
Now you can see the main view split into two panes. In the left pane, you can see all the options you have to edit in your current project, grouped in categories.
Switch to “Product
Details” page to set the information seen by the user for your installation
package. Fill the fields in the right pane with the corresponding data.
The information from this view will be displayed in the Control Panel.
3. Add files and folders to your project
The next step is to add to the project the files and/or folders that compose your application.
Select “Files and Folders” from the
“Resources” menu on the left pane.
Click on the toolbar button and select the files
of your application, or use the drag-and-drop to add resources from
the disk to the project.
Once you’ve added the files of your application in the Files and Folders view, we can create the Shell Extension.
4. Create Shell Extension
Our sample application is a text editor and it’s able to load a file from its context menu. That means, we can define a shell extension, for any file. Please take into consideration this option is valid for applications that zip files, or file upload apps etc. So, the functionality of having a shell extension for any file is perfectly valid.
Use the [ New Shell Context Menu ] toolbar button and then select which type of context menu you want to create : Files Context Menu, Directory Context Menu, Background Context Menu, Drive Context Menu or a subentry for the currently selected shell context menu.
After creating the Shell Context Menu entries, you may end with a similar structure as below:
Now, there are 2 classes that we need to take into consideration:
- Target machine has the modern context menu e.g. Windows 11 style
- Target machine has the classic context menu e.g. Windows 10 style
Advanced Installer will handle both scenarios and make the context menu options available no matter the UI style used by the user. Although the sparse package is installed on both machines, the context menu options will be handled through the sparse package only for modern context menu e.g. Windows 11 style, leaving the classic context menu e.g. Windows 10 style to be handled through classic registries support.
For Windows 11 context menu you need to enable the Windows 11 Context Menu option. When using this option a Sparse Package is required to configure this option. It will be automatically generated and included into your setup package.
Digital signature is mandatory for this option. All Sparse Packages have to be
digitally signed, thus the above Sparse Package will be signed with the digital signature
configured in your project.
"Windows 11 Context Menu" option takes effect at install time only if the digital
certificate used to signed the setup package is a trusted certificate on target machine
(i.e. is installed in "Trusted Root Certification Authorities" certificates store).
Otherwise its installation will be skipped.
The current sample comes with a self-signed certificate, so if you built the project, you may need to install the certificate to the machine store so that changes can take effect.
To install a self-signed certificate, please follow these steps from the Installing a test certificate directly from an package article.
5. Check Digital Signature properties
You can use the current certificate for signing or you can create a new self-signed certificate in the Digital Signature view.
6. Build and install
If you build and install the resulted setup package, you should notice the shell entries made for files and folders, accordingly with the project settings.
Here's a side by side comparison for the shell context menu on files, on a Windows 11.
You need to make sure that the certificate that is used to sign the installer is
trusted on the machine. Also, you may need to restart explorer after package installation so
that changes can take effect.