In case you want to add context menu item to Windows Explorer for folders or files of any kind, here is what you need to do:
To achieve this, just follow the steps from the following article:
1) Create a new project of Professional type in Advanced Installer:
2) Select the Files and Folders view to add the application files:
In our demo, our application will just display the path for the delected folder or file in a message box.
3) Select the Registry view.
The context menu options for Windows Explorer are added through registries.
- Context menu for right click on folders in left panel of Windows Explorer:
Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell
Here is how the registry should look like in Advanced Installer:
where Display path.exe is my exe app that will handle the folder operation - Context menu for right click on on background of a directory in Windows Explorer:
Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell
Here is how the registry should look like in Advanced Installer:
where Display path.exe is the exe app that will handle the folder operation - Context menu for right click on any file:
Code: Select all
HKEY_CLASSES_ROOT\*\shell
Here is how the registry should look like in Advanced Installer:
where Display path.exe is my exe app that will handle the file operation
In all cases:
- add a new key under shell, naming it as you want to name the context menu item (e.g. My context menu option)
- add a new key inside this key, named command (mandatory name)
- edit the default property in command to your executable. Also, we need to pass the path to the folder or to the file.
- "%1" to pass the file path and name of the selected file
- "%V" to pass the folder path and name of the selected folder
- Add icon: add a string value named icon for key created at step 1 with value matching an icon resource path.
- Change menu entry location: add a string value named Position with one of: Top, Bottom
If you need to associate files with a particular extension with with your application then you can follow the steps from the Create new file extensions and make file associations.
The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.
Hope you will find this information helpful and let us know if you want to see more samples from our side.
All the best,
Dan