mirror of
https://github.com/clechasseur/pathcopycopy.git
synced 2026-04-25 12:15:58 +03:00
[GH-ISSUE #161] [FEATURE] Set default options for context menu #158
Labels
No labels
bug
duplicate
enhancement
enhancement
enhancement
fixed
help wanted
help wanted
invalid
pull-request
question
waiting for input
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pathcopycopy#158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Dysterkind on GitHub (Dec 22, 2022).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/161
Originally assigned to: @clechasseur on GitHub.
Hi,
maybe there is already some possiblity - unfortunately I wasn't able to find anything for the following request:
Is it somehow possible to alter the default shown options in the context menu right at the installation process (regardless of the user, I will be installing the application for "all users").
I would be in need to alter the selectable shown Options not to default, advanced nor power-user layout but simply to just show only one entry without submenu, "Copy Long UNC Path" - with the extra Option "Add Quotes..." "...only if paths contain spaces".
My initial thought was to use the Export/Import Settings feature but somehow I could not find any how to automate such an import when installing the application on another computer?
Thank you in advance!
/Dorian
Seems to point in the directory of a request already posted- so I'll reference it here:
Originally posted by @SnkrLifeAndStyle in https://github.com/clechasseur/pathcopycopy/issues/80#issuecomment-886632753
@clechasseur commented on GitHub (Jan 1, 2023):
There is a way, but it is highly undocumented currently. Basically, the installer supports command-line parameters to set default settings. Two of them will be of interest to you:
/PCCREGPIPELINEPLUGIN=<<plugin ID>>,<<plugin pipeline>>,<<description>>This command-line argument will install a new custom command. If the installation is for all users, then all users will have access to the command. The command-line argument needs three things to install the command:
All these informations can be found in the registry for a custom command. Example:
After you copy all these informations, you can craft a command-line argument to install such a command:
/PCCREGPIPELINEPLUGIN="{0656d3db-895a-4427-a45b-518157852f9e},02{{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28}k,Long UNC Path (follow symlink)"The second command-line argument that you will need to use is:
/PCCREGVALUESZ=<<value name>>,<<string value>>This can be used to save a string registry value in the main Path Copy Copy registry key. In this case, you'll want to override the
MainMenuDisplayOrdervalue. This value contains a comma-separated list of commands to display in the main contextual menu. In your case, you'll want it to contain a single ID, which is the ID of the custom command installed earlier. In our example:/PCCREGVALUESZ=MainMenuDisplayOrder,{0656d3db-895a-4427-a45b-518157852f9e}By using the two command-line arguments above when invoking the installer on a computer, you should be able to properly configure Path Copy Copy as you want it.
@Dysterkind commented on GitHub (Jan 2, 2023):
Astonishing!
This was what I was looking for!
Just a short question for my understanding - why are we generating a custom command instead of "just" activating the "on-board" one?
I am currently using the technique with the custom command (which allows me to change the description for translate reasons) and setting options with PCCREGVALUESZ & PCCREGVALUEDWORD respectively.
Thank you!
/D
@clechasseur commented on GitHub (Jan 2, 2023):
It's also possible to use a default command. It's just that I thought you wanted a custom one from your initial question.
Each default command also has an ID, but they cannot be found in the registry and are unfortunately mostly undocumented. They can be found in the code in a couple of places, perhaps more easily here:
https://github.com/clechasseur/pathcopycopy/blob/default/PathCopyCopySettings/Properties/Resources.resx
From this file, for example, we see that the Long UNC Path command ID is
{EA24BCC3-35F5-46b9-A2A5-A12A0AED2D28}(as seen here).@Dysterkind commented on GitHub (Jan 3, 2023):
Ah, I see, an assumption turning out quite handy, for translation reasons :)
Thank you for the ID, so I can use both flavors where applicable.
Thank you for your quick response and the very detailed information!
/D