2 TortoiseSVNInstallKey
='SOFTWARE\TortoiseSVN';
3 TortoiseCVSUninstallKey
='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TortoiseCVS_is1';
4 PuTTYUninstallKey
='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PuTTY_is1';
5 PuTTYPrivateKeyAssoc
='PuTTYPrivateKey\shell\open\command';
7 // Tries
to detect the path
to a PuTTY installation
/ an application that comes
8 // with an improved version
of Plink
. TortoisePlink from TortoiseSVN features a
9 // GUI dialog
to accept new host keys
, for example
.
10 function GetPuTTYLocation
:string;
12 // Prefer TortoisePlink over vanilla Plink
for its GUI dialog
to accept host keys
.
13 if (IsWin64
and RegQueryStringValue(HKEY_LOCAL_MACHINE_64
,TortoiseSVNInstallKey
,'Directory',Result
)) or
14 RegQueryStringValue(HKEY_LOCAL_MACHINE_32
,TortoiseSVNInstallKey
,'Directory',Result
) then begin
15 // C
:\
Program Files\TortoiseSVN\
16 Result
:=Result
+'bin\';
17 // C:\Program Files\TortoiseSVN\bin\
19 if not (IsWin64 and RegQueryStringValue(HKEY_LOCAL_MACHINE_64,TortoiseCVSUninstallKey,'InstallLocation
',Result)) then begin
20 RegQueryStringValue(HKEY_LOCAL_MACHINE_32,TortoiseCVSUninstallKey,'InstallLocation
',Result);
22 // C:\Program Files\TortoiseCVS\
25 if DirExists(Result) then begin
26 Result:=Result+'TortoisePlink
.exe
'
30 if not RegQueryStringValue(HKEY_LOCAL_MACHINE,PuTTYUninstallKey,'InstallLocation
',Result) then begin
31 if RegQueryStringValue(HKEY_CLASSES_ROOT,PuTTYPrivateKeyAssoc,'',Result) then begin
32 // "C:\Program Files\PuTTY\pageant.exe" "%1"
33 Result:=RemoveQuotes(Result);
34 // C:\Program Files\PuTTY\pageant.exe" "%1
35 Result:=ExtractFilePath(Result);
38 // C:\Program Files\PuTTY\
40 if not DirExists(Result) then begin
42 Result:=ExpandConstant('{pf}\PuTTY
\');
45 Result
:=Result
+'plink.exe'