0

I have multiple versions of an application where the executable has always the same name, just the file's path is different. When installing I would like to create a entry in the Open With... context menu and add the app's version to the label.

While this question here:

Name program in the Open With... context menu

is essentially the same, the answer only eludes to the situation where the executable has a different name for each version and by writing a string value called FriendlyAppName into

[HKEY_CLASSES_ROOT\Applications\**YOUR PROGRAM HERE***.exe\shell\open]

you can set the label. Is there a procedure for my case where the executable has always the same name?

Thanks Markus

Markus Heckmann
  • 307
  • 1
  • 6
  • Write a `[Registry]` key section value item for `FriendlyAppName` [as such](https://learn.microsoft.com/en-us/windows/win32/shell/app-registration?redirectedfrom=MSDN#registering-applications) then. What do you need to help with? – TLama Dec 09 '19 at 18:30
  • I must be missing something obvious. If my applications are installed under _c:\AppV1\app.exe_ and _c:\AppV2\app.exe_, can I not only register one _app.exe_ in the `App Paths` registry section and both installed versions would get the label specified under the `FriendlyAppName` item? – Markus Heckmann Dec 09 '19 at 19:15
  • 1
    Should be easy to answer by a simple test, ask the shell... Select open with one, then the other, and then inspect the open with menu. If there is one entry, then your answer is no. If there are two, inspect more. – Sertac Akyuz Dec 09 '19 at 20:21
  • 1
    @Markus, yes, you can (according to the documentation). You can make entries for all your application versions, whereas under the `App Paths` registry key, all will have unique key and all will have unique `(default)` registry key value pointing to the file name of your application. – TLama Dec 09 '19 at 21:05
  • @TLama - thank you! It was my understanding that the keys must be the exact name of the executable. This clears it up. – Markus Heckmann Dec 09 '19 at 21:12
  • 1
    No problem :-) But no, the`App Paths` keys must be unique (like `myappv1`, `myappv2` etc.). What will be inside the keys is upon you. Feel free to answer your question when you get the solution, I hope there is enough information around. If you have any problems, let us know (there's a few of us monitoring this tag ;-) – TLama Dec 09 '19 at 23:58
  • 1
    @TLama - Thank you - very much appreciate all the help. The registry feels like a maze. I'm not sure if this constitutes an answer, but after failing with the changes in the `Applications` key (I tried to use a _string_ as the value for `FriendlyAppName`) I resorted to writing into the `HKCR:Local Settings\Software\Microsoft\Windows\Shell\MuiCache` key which lead to success. I'm just unsure, this being called _Cache_ - sounds like it could get rebuild at any point by windows? – Markus Heckmann Dec 10 '19 at 19:07

1 Answers1

0

While the above mentioned question seems to hint at the possibility to specify the FriendlyAppName as a string, my tests didn't come to the right results and Microsoft's documentation seems to indicate that it needs to be a lookup into a file resource.

Hence my current "solution" is to write to the HKCR\Local Settings\Software\Microsoft\Windows\Shell\MuiCache key and the associated value for my application as follows:

[Registry]
Root: HKCR; SubKey: "Local Settings\Software\Microsoft\Windows\Shell\MuiCache"; ValueData: "{#MyAppNameLong} Build {#MyAppVersion}"; Flags: uninsdeletevalue; ValueType: string; ValueName: "{app}\bin\{#MyAppExeName}.FriendlyAppName"

For now this works and I'm hoping that the Cache in the key name doesn't hint to this being rebuild out of the blue by windows...

Markus Heckmann
  • 307
  • 1
  • 6