From cbdadc7bc481db84cd3f25c591f21c59aa915708 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Sun, 2 Jun 2013 11:54:28 +0200 Subject: [PATCH] Installer: Prefer custom GIT_SSH over previous data for Plink In case the user has modified GIT_SSH manually after the last installation, prefer that path over the one from the previous installation for the Plink location in case it points to a valid Plink executable. Signed-off-by: Sebastian Schuberth --- share/WinGit/install.iss | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/share/WinGit/install.iss b/share/WinGit/install.iss index eeb5a3d9..a087eae0 100644 --- a/share/WinGit/install.iss +++ b/share/WinGit/install.iss @@ -374,7 +374,7 @@ var PrevPageID:Integer; LblGitBash,LblGitCmd,LblGitCmdTools,LblGitCmdToolsWarn:TLabel; LblOpenSSH,LblPlink:TLabel; - PuTTYSessions:TArrayOfString; + PuTTYSessions,EnvSSH:TArrayOfString; LblLFOnly,LblCRLFAlways,LblCRLFCommitAsIs:TLabel; BtnPlink:TButton; Data:String; @@ -554,13 +554,21 @@ begin EdtPlink:=TEdit.Create(PuTTYPage); with EdtPlink do begin Parent:=PuTTYPage.Surface; - Text:=GetPreviousData('Plink Path',''); + + EnvSSH:=GetEnvStrings('GIT_SSH',IsAdminLoggedOn); + if (GetArrayLength(EnvSSH)=1) and (Pos('plink',LowerCase(EnvSSH[0]))>0) then begin + Text:=EnvSSH[0]; + end; + if not FileExists(Text) then begin + Text:=GetPreviousData('Plink Path',''); + end; if not FileExists(Text) then begin Text:=GuessPlinkExecutable; end; if not FileExists(Text) then begin Text:=''; end; + Left:=ScaleX(28); Top:=ScaleY(161); Width:=ScaleX(316); -- 2.11.4.GIT