Commits

Anonymous committed dfaa2d2

setup: install software registry key to HKLM

so we don't have to install one copy of TortoiseHg per user.

  • Participants
  • Parent commits 8eec490

Comments (0)

Files changed (5)

 
 :: Look in the registry for TortoiseHg location
 for /f "skip=2 tokens=3*" %%A in (
-    '"reg query "HKEY_CURRENT_USER\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B
+    '"reg query "HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B
 if "%TortoisePath%"=="" (goto :notfound) else (goto :run)
 
 :run
 
 :: Look in the registry for TortoiseHg location
 for /f "skip=2 tokens=3*" %%A in (
-    '"reg query "HKEY_CURRENT_USER\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B
+    '"reg query "HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B
 if "%TortoisePath%"=="" (goto :notfound) else (goto :hgproc)
 
 :hgproc
 
 :: Look in the registry for TortoiseHg location
 for /f "skip=2 tokens=3*" %%A in (
-    '"reg query "HKEY_CURRENT_USER\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B
+    '"reg query "HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseHg" /ve 2> nul"' ) do set TortoisePath=%%B
 if "%TortoisePath%"=="" (goto :notfound) else (goto :merge)
 
 :merge

tortoise/thgutil.py

     import _winreg
     
     key = r"Software\TortoiseHg"
-    cat = _winreg.HKEY_CURRENT_USER     # HKEY_LOCAL_MACHINE
+    cat = _winreg.HKEY_LOCAL_MACHINE
     dir = _winreg.QueryValue(cat, key)
     return dir
 
 # TortoiseHg registry setup
 def register_tortoise_path(unregister=False):
     key = r"Software\TortoiseHg"
-    cat = _winreg.HKEY_CURRENT_USER     # HKEY_LOCAL_MACHINE
+    cat = _winreg.HKEY_LOCAL_MACHINE
     if (unregister):
         _winreg.DeleteKey(cat, key)
         print "TortoiseHg unregistered"