[Lazarus] [ANN] Lazarus Manager v0.8

Reinier Olislagers reinierolislagers at gmail.com
Sat Jan 11 02:51:06 CET 2014


On 10/01/2014 19:40, Kjow wrote:
> 2014/1/10 Hans-Peter Diettrich <DrDiettrich1 at aol.com
> <mailto:DrDiettrich1 at aol.com>>
>     SVN is not found, even if TortoiseSVN\bin is in the path, and I
>     don't remember SVM problems with fpcup.
>     - what exactly should be in the path?
>     - does it harm when another SVN is installed by the manager?
>     - Clicking "Cancel" makes the program unresponsive, Windows kills it.
>     - The same when clicking "OK". The last log entry is

@Kjow: perhaps you can adapt this code from fpcup:
file svnclient.pas
function TSVNClient.FindRepoExecutable: string;
const
  // Application name:
  SVNName = 'svn';
begin
  Result := FRepoExecutable;
  // Look in path
  // Windows: will also look for <SVNName>.exe
  if not FileExists(FRepoExecutable) then
    FRepoExecutable := FindDefaultExecutablePath(SVNName);

{$IFDEF MSWINDOWS}
  // Some popular locations for SlikSVN, Subversion, and TortoiseSVN:
  // Covers both 32 bit and 64 bit Windows.
  if not FileExists(FRepoExecutable) then
    FRepoExecutable :=
GetEnvironmentVariable('ProgramFiles\Subversion\bin\svn.exe');
  if not FileExists(FRepoExecutable) then
    FRepoExecutable :=
GetEnvironmentVariable('ProgramFiles(x86)\Subversion\bin\svn.exe');
  if not FileExists(FRepoExecutable) then
    FRepoExecutable :=
GetEnvironmentVariable('ProgramFiles\SlikSvn\bin\svn.exe');
  if not FileExists(FRepoExecutable) then
    FRepoExecutable :=
GetEnvironmentVariable('ProgramFiles(x86)\SlikSvn\bin\svn.exe');
  if not FileExists(FRepoExecutable) then
    FRepoExecutable :=
GetEnvironmentVariable('ProgramFiles\TorToiseSVN\bin\svn.exe');
  if not FileExists(FRepoExecutable) then
    FRepoExecutable :=
GetEnvironmentVariable('ProgramFiles(x86)\TorToiseSVN\bin\svn.exe');
  //Directory where current executable is:
  if not FileExists(FRepoExecutable) then
    FRepoExecutable := (ExtractFilePath(ParamStr(0)) + 'svn');
{$ENDIF MSWINDOWS}

  if not FileExists(FRepoExecutable) then
  begin
    //current directory. Note: potential for misuse by malicious program.
    {$ifdef mswindows}
    if FileExists(SVNName + '.exe') then
      FRepoExecutable := SVNName + '.exe';
    {$endif mswindows}
    if FileExists('svn') then
      FRepoExecutable := SVNName;
  end;

  if FileExists(FRepoExecutable) then
  begin
    if ExecuteCommand(DoubleQuoteIfNeeded(FRepoExecutable) + '
--version', Verbose) <> 0 then
    begin
      // File exists, but is not a valid svn client
      FRepoExecutable := '';
    end;
  end
  else
  begin
    // File does not exist
    // Make sure we don't call an arbitrary executable:
    FRepoExecutable := '';
  end;
  Result := FRepoExecutable;
end;





More information about the Lazarus mailing list