Some users have reported that TortoiseSVN adds its entry to the context menu even for the trashbin. Of course, it's pretty useless to have the menu appear on that context menu, because you can't do any Subversion operations on the trash.
The problem was that we have some checks in our code which prevents the entry from getting added to the context menu for the trashbin. So why do some users still see the menu entry?
Last week I finally found a computer in our office where TortoiseSVN really added the entry to the trash context menu. Of course I couldn't let such an opportunity just pass by, so I started debugging to find out what's going on.
The check TortoiseSVN does is by comparing the paths of the item where the context menu should be shown with some system paths. For this, we use SHGetSpecialFolderPath function with CSIDL_BITBUCKET.
But on this particular machine, SHGetSpecialFolderPath would return with an error when getting the path to the trashbin. The error code was 0x80070057 which means "One or more arguments are invalid". Very strange. Why would a Windows API return such an error when CSIDL_BITBUCKET clearly is a valid argument for this function? And why only on this particular machine?
Investigating further, I found that the junction point for the trashbin was missing. The junction point is a registry key at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{645FF040-5081-101B-9F08-00AA002F954E}, and it was not there. Something or someone must have removed it.
But I knew that on that machine there were not much programs installed, and the user working there would never mess around manually in the registry.
The only tool I could think of which could have done this was TweakUI, but that's a tool from Microsoft and wouldn't break the OS, would it?
Yes it would! At least, an older version of it would. The latest version of TweakUI doesn't remove that key anymore if you want the trashbin not shown on the desktop.
If you want to try the buggy version of TweakUI, it's still available for download.
But I strongly recommend using the latest version.
I've now implemented a workaround for this problem. Which means in the next version (version 1.5), TortoiseSVN won't add its entry to the context menu of the trashbin anymore, even if the junction point is removed. But until that version gets released, you'll either have to live with it or manually create the registry entry for the junction point.