Tortoisehg does not start from any context menu item

Issue #100 resolved
Vilen Tambovtsev
created an issue

Installed tortoisehg-unstable-1.9.1782.3569-x64-afed0285-1add-4d0e-9b79-79b2d550e895. Log off - Log on. Try to use some context menu items -> no reaction, thg does not start. The app was 32-bit.

Comments (18)

  1. Adrian Buehlmann

    Might be that you managed to get a build that needs shift key + right mouse button (=extended context menu, as known from Vista and Windows 7) to see the thg cmenu entries. Inside repos, the thg cmenu is shown with out shift key.

    They changed that later. So in newer builds you will probably find everything as it was before.

  2. Adrian Buehlmann

    Ah. Sorry. I just reread. You installed the 64 bit installer, which by default does not install the 32 bit shell extension.

    Rerun the installer, then click the "Change" button, then select the disabled feature "Shell extension x86" and click "Next".

  3. Adrian Buehlmann

    xumix is most likely trying to use the shell extension in a 32 bit application on x64 Windows. This might be an explorer replacement or just the file open dialog fired up by a 32 bit application.

  4. Adrian Buehlmann

    Alright, I've installed tortoisehg-unstable-1.9.1782.3569-x64-afed0285-1add-4d0e-9b79-79b2d550e895.msi on Windows 7 x64, including the x86 shell extension feature.

    If I start a 32 bit application (aka x86 app) and do an open file dialog (not in a library though!) the thg cmenu entries are there, but the icons are missing (!). And they do nothing if chosen.

    Wild guess: a problem with finding the install path? thg.exe is an x64 executable, maybe the x86 cmenu code is looking for it in the wrong path?

  5. Adrian Buehlmann

    I think this doesn't need a 32 bit machine :). Rather the contrary. Maybe I'll look into it (very low prio though, feel free to beat me to it).

    Hypothesis: GetTHgProgRoot() from TortoiseUtils.cpp tries to read the install path from Software\TortoiseHg from the registry, which the installer most likely writes to the x64 areas of the registry, but the x86 shell extension reads the 32 bit registry, which most likely doesn't have that entry.

  6. Steve Borho

    I tried adding a registry key as:


    With a default value of the install path, just like:


    But this had no effect. I think the shell extension is looking under HKLM. So I looked there and found what I suspect to be an obsolete key:


    It had a value of C:\Program Files (x86)\TortoiseHg\. When I edited the key and make it correctly point to C:\Program Files\TortoiseHg\, the menu icons and launching were both fixed.

    So the "fix" for this will be to figure out how to make the x64 installer correctly write that key.

  7. Steve Borho

    I was wrong, our x64 installer is generating that key with the wrong path. I saw it go away when I uninstalled and re-appear when a re-installed.


  8. Adrian Buehlmann

    I'd bet component thgshellx86dll in tortoisehg.wxs will have INSTALLDIR set to

    C:\Program Files (x86)\TortoiseHg\

    because it is an x86 component...

                <Component Id='thgshellx86dll' Guid='$(var.thgshellx86dll.guid)' Win64='no'>
                  <File Id='thgshellx86dll' Name='ThgShellx86.dll' KeyPath='yes'
                    Root='HKLM' Key='$(var.ProgramRegKey)'
                    Type='string' Value='[INSTALLDIR]'
                    Root='HKCR' Key='CLSID\$(var.CLSID_TortoiseHgCmenu)\InProcServer32'
                    Type='string' Value='[INSTALLDIR]ThgShellx86.dll'
                  <?foreach CLSID in $(var.OverlayCLSIDList) ?>
                      Root='HKCR' Key='CLSID\$(var.CLSID)\InProcServer32'
                      Type='string' Value='[INSTALLDIR]ThgShellx86.dll'
  9. Log in to comment