TFS in context menu

Features wanted...
Post Reply
jerry.nothstine
Posts: 1
Joined: 26 Jan 2016 06:58

TFS in context menu

Post by jerry.nothstine »

In Windows Explorer, when I right click on an item that is under TFS source control, I have a "Team Foundation Server" sub-menu option that allows me to perform TFS actions.

I have another tool, "File Locator Lite" that has the same thing. I haven't done anything special for File Locator Lite to do that, I think it just offers the same menu that Windows Explorer has.

It would be really cool if this option were available in XYplorer. This is the only reason I ever open Windows Explorer and it would be much nicer if I didn't have to go there to perform these actions.

I have attached a PDF file that shows the Windows Explorer context menu and also the File Locator Lite context menu.

Thanks,

Jerry.

highend
Posts: 14639
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: TFS in context menu

Post by highend »

Welcome to the club.

Try the "Show 64-bit context menu" in XY's normal right click context menu. Is it visible then?
One of my scripts helped you out? Please donate via Paypal

mkolaski
Posts: 33
Joined: 16 Jul 2013 20:16
Location: UK

Re: TFS in context menu

Post by mkolaski »

On a slightly different note, I have a catalog entry set up so that File Locator will open and default to search in the current folder.

I have the Pro version so you'll need to adapt the command to suit:

"pathto\FileLocator Pro\FileLocatorPro.exe" -d "<curpath>"

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: TFS in context menu

Post by TheQwerty »

highend wrote:Welcome to the club.

Try the "Show 64-bit context menu" in XY's normal right click context menu. Is it visible then?
No.. The TFS extension does some odd things and I haven't been able to figure out how to get it to show in XY.

In my research I found some threads talking about how the extension checks to see if it is being initialized from a directory under source control before displaying itself. This occasionally takes too long and causes it to not be displayed (in WE) until pulling up the menu a second or third time.

I have a script at work that pulls up the history for a file so I'm not jumping to WE but haven't taken the time to expand it to cover the other context menu commands. (I'll try to remember to share it on Monday.)

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: TFS in context menu

Post by TheQwerty »

Turns out I was just getting lost in the details. highend is correct in that it comes down to the TFS Power Tools installer (at least v2013 Update 2) not installing & registering the x86 shell extension.

Normally it would still be available in the 64-bit context menu but there remains some wrinkle that I cannot explain without a deeper exploration. (This distracted me from thinking it was a bitness issue.)

Turns out you can get it working in XY by extracting the x86 DLL from the installer and configuring your registry appropriately.
  1. Get yourself 7-Zip.
  2. Open the Power Tools Installer (MSI) in 7-Zip.
  3. Extract TfsShellExt.dll_x86.
    In my case the tools install to: C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\ so I extracted the file above to the same folder.
  4. Rename it to TfsShellExtx86.dll (or similar).
  5. Run regedit and for convenience do it again with regedit -m
  6. Do some sleuthin'. ;)
    You need to register the extracted DLL in similar fashion to the existing one so you first need to figure out how the existing one is registered.
    1. Check under HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\TFSContextMenu for the (Default) key.
      In my case the value was the GUID: {DEF52C03-E6D8-4b47-BD08-DF416EF3E950}
    2. Using the found GUID check for the key HKEY_CLASSES_ROOT\CLSID\{DEF52C03-E6D8-4b47-BD08-DF416EF3E950} (replacing the GUID if need be).
    3. The (Default) value tells Windows (& XY) which DLL to load context menu items from.
  7. In the second instance of regedit navigate to Software\Classes\Wow6432Node\CLSID under either HKEY_LOCAL_MACHINE (if you want to to apply to all users) or HKEY_CURRENT_USER (for just the current user). (For me the existing registration was made for all users in HKLM.)
  8. Now you need to recreate the entries found above under the Classes\Wow6432Node\CLSID so for me that meant:
    1. Create a new key using the found GUID as its name: {DEF52C03-E6D8-4b47-BD08-DF416EF3E950}.
    2. Set its (Default) value to match the other entry: TfsContextMenu.
    3. Create a new key under the GUID key named: InprocServer32.
    4. Under that key create a new String Value named: ThreadingModel with value Apartment.
    5. The one key difference is you now set the InprocServer32's (Default) value to point to the extracted DLL: C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\TfsShellExtx86.dll
    This means I ended up with the following:

    Code: Select all

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{DEF52C03-E6D8-4b47-BD08-DF416EF3E950}]
    @="TfsContextMenu"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{DEF52C03-E6D8-4b47-BD08-DF416EF3E950}\InprocServer32]
    @="C:\\Program Files (x86)\\Microsoft Team Foundation Server 2013 Power Tools\\TfsShellExtx86.dll"
    "ThreadingModel"="Apartment"
After all that the TFS menu should show within XYplorer's 32-bit context menu. As mentioned earlier the extension checks if it is being called for a mapped workspace before making itself visible and this can occasionally time-out resulting in it not showing (even in Windows Explorer). Thus if it doesn't appear the first time you pull up the context menu wait a couple seconds and try again.

Hope that helps and welcome to the club!
Last edited by TheQwerty on 18 Apr 2016 17:15, edited 1 time in total.
Reason: Corrected Wow6432Node paths.

Post Reply