Each shared menu settings file is saved in a separate .ini files stored on a shared drive or folder. User can add a shared menu using the Add Favorite command. The info about the added shared menu is stored in the user’s QuickAccessPopup.ini file in a line like this:
Favorite1=External|HR Menu|> HR Menu|C:IconsJLicons.dll,42||C:SharedMenusHR_Menu.ini||||||||0||||||
Anatomy of a shared menu settings file
Users having access to the shared menu ini file on a network drive or shared folder (Dropbox, etc.) can manage the shared menu in a text editor. They can also be generated from an external data source. If you edit or generate a settings file, make sure its content is fully compliant with the QAP structure because little or no validation is done when QAP loads a settings file. QAP assumes that the settings file contains valid data as if it was saved by QAP itself.
The shared menu settings file is composed of three sections:
- [Global]: information about the shared menu
- [Favorites]: the list of favorites shared in this menu
- [Favorites-backup]: a backup of the favorites as they were before the last time the shared menu was saved
Here is an example of a shared menu. Its content is detailed below.
MenuName=HR Resources Menu
WriteAccessMessage=Please contact Mary at HR for suggestions about the HR shared menu.
The shared favorites are listed in the [Favorites] section in the order they are saved and loaded by QAP. The details of the favorites structure is the same as for the user’s QuickAccessPopup.ini file. You can find more info about the favorites in a settings file here: What is the structure of QAP settings (ini) file?
The content of the [Global] section depends on the type of shared menu. The four first values are common to all types of shared menus:
- Personal (default)
The shared menu name is shown in various dialog boxes and used as default name when user adds the shared menu from the Shared Menus Catalogue.
The last modified date-time is used to detect if a shared menu file was modified by another user since the QAP menu was loaded. This prevents the user to edit the menu based on an older version of its content.
When saved on a network drive, the last modification date-time of the shared menu ini file is taken from the file system and is independent from various user’s clocks or time zones. Of course, the date-time being written to the file right after its modification, the real file’s date-time can be a few milliseconds after the value saved in the file but this will not impact the conflict protection.
But if the shared menu file is saved on a cloud drive, the last modification date-time of the shared menu ini file is taken from the PC’s clock in the Coordinated Universal Time (UTC). These PCs clock should be kept as sync as much as possible.
In both cases (network or cloud drive), the time is stored in the “yyyymmddhh24miss” format with the addition of the “UTC” when suffix when saved on a cloud drive (more info about date-time format in AHK documentation).
The file modification date-time in the ini file is updated only when changes are done to the content itself (shared favorites), not for actions modifying the file’s date-time without real modifications in the content. This value must be updated if the content of the shared menu file is changed outside QAP by an administrator using a text editor or by an automatic process.
This value is used to track current editing of a shared menu. If this value is empty, the menu is not currently reserved. When the menu is edited, it is flagged as reserved by setting the value to the Windows logon name and computer name of the user currently editing the shared menu (you can find the current user’s logon name in the QAP About dialog box).
The shared menu is released and the value of MenuReservedBy is erased when the user who reserved the menu saves or cancels the changes to the Shared menu, or quits QAP. This value can be erased manually by an administrator if, for any reason, a file is locked by a user who could not access the file using QAP.
This value is critical to collaborative shared menus where the risk of simultaneous editing is more likely to occur. But it is also used to alert a personal shared menu user if the menu was left unsaved on another PC and to alert administrator of a centralized menu if another administrator is currently editing the menu.
The last two values are specific to Centralized shared menus:
Only users listed in this value can edit a centralized shared menu. Enter one or multiple Windows logon names, separated by comma. Note: of course, any user having write-access to the shared menu settings file itself could edit it using a text editor.
This is the message displayed to user having only read-only access to a centralized menu when they try to edit the menu with QAP. It can be used to direct the user to the menu administrator.
Personal shared menu example
MenuName=My Personal Menu
Collaborative shared menu example
for a menu saved on a network drive
MenuName=Team Shared Menu
for a menu saved on a cloud drive
MenuName=Team Shared Menu
Centralized shared menu example
MenuName=HR Toolkit Menu
WriteAccessMessage=Please forward suggestions to Peter, Paul or Mary.