From: Sebastian Schuberth Date: Sun, 2 Jun 2013 09:54:28 +0000 (+0200) Subject: Installer: Prefer custom GIT_SSH over previous data for Plink X-Git-Url: https://repo.or.cz/w/msysgit.git/commitdiff_plain/cbdadc7bc481db84cd3f25c591f21c59aa915708 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 --- 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);