mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-02 08:32:46 +02:00
added FindDefaultLazarusSrcDirectory
git-svn-id: trunk@8735 -
This commit is contained in:
parent
01282aa76a
commit
47580b39ef
@ -71,6 +71,7 @@ type
|
|||||||
TPropertyLinkOption = (
|
TPropertyLinkOption = (
|
||||||
ploReadOnIdle,
|
ploReadOnIdle,
|
||||||
ploAutoSave
|
ploAutoSave
|
||||||
|
//ploDisableOnNil // disable control, if link not connected
|
||||||
//ToDo: ploReadOnly
|
//ToDo: ploReadOnly
|
||||||
);
|
);
|
||||||
TPropertyLinkOptions = set of TPropertyLinkOption;
|
TPropertyLinkOptions = set of TPropertyLinkOption;
|
||||||
|
@ -49,7 +49,7 @@ type
|
|||||||
procedure LoadContributors;
|
procedure LoadContributors;
|
||||||
public
|
public
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
constructor Create(THeOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -160,8 +160,6 @@ begin
|
|||||||
,FPixmap.Canvas, Rect(0,0, Width, Height));
|
,FPixmap.Canvas, Rect(0,0, Width, Height));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I aboutfrm.lrs}
|
{$I aboutfrm.lrs}
|
||||||
{$I lazarus_about_logo.lrs}
|
{$I lazarus_about_logo.lrs}
|
||||||
|
@ -42,6 +42,16 @@ const
|
|||||||
'/usr/src/fpc',
|
'/usr/src/fpc',
|
||||||
'/vol/src/fpc'
|
'/vol/src/fpc'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
DefaultLazarusSrcDirs: array[1..7] of string = (
|
||||||
|
'/usr/share/lazarus',
|
||||||
|
'/usr/local/share/lazarus',
|
||||||
|
'/usr/local/lib/lazarus',
|
||||||
|
'/usr/local/lazarus',
|
||||||
|
'/usr/lib/lazarus',
|
||||||
|
'~/pascal/lazarus',
|
||||||
|
'~/lazarus'
|
||||||
|
);
|
||||||
|
|
||||||
var
|
var
|
||||||
PrimaryConfigPath,
|
PrimaryConfigPath,
|
||||||
|
@ -28,6 +28,10 @@ const
|
|||||||
'c:\pp\source'
|
'c:\pp\source'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
DefaultLazarusSrcDirs: array[1..1] of string = (
|
||||||
|
'c:\pp\source'
|
||||||
|
);
|
||||||
|
|
||||||
var
|
var
|
||||||
PrimaryConfigPath,
|
PrimaryConfigPath,
|
||||||
SecondaryConfigPath: string;
|
SecondaryConfigPath: string;
|
||||||
|
@ -133,8 +133,11 @@ var
|
|||||||
r: integer;
|
r: integer;
|
||||||
begin
|
begin
|
||||||
CurLazDir:=EnvironmentOptions.LazarusDirectory;
|
CurLazDir:=EnvironmentOptions.LazarusDirectory;
|
||||||
if CurLazDir='' then
|
if CurLazDir='' then begin
|
||||||
CurLazDir:=ProgramDirectory;
|
CurLazDir:=ProgramDirectory;
|
||||||
|
if not CheckLazarusDirectory(CurLazDir) then
|
||||||
|
CurLazDir:=FindDefaultLazarusSrcDirectory;
|
||||||
|
end;
|
||||||
if not CheckLazarusDirectory(CurLazDir) then begin
|
if not CheckLazarusDirectory(CurLazDir) then begin
|
||||||
if not InteractiveSetup then exit;
|
if not InteractiveSetup then exit;
|
||||||
if CurLazDir='' then begin
|
if CurLazDir='' then begin
|
||||||
|
@ -90,6 +90,7 @@ const
|
|||||||
function FindDefaultCompilerPath: string;
|
function FindDefaultCompilerPath: string;
|
||||||
function FindDefaultMakePath: string;
|
function FindDefaultMakePath: string;
|
||||||
function FindDefaultFPCSrcDirectory: string;
|
function FindDefaultFPCSrcDirectory: string;
|
||||||
|
function FindDefaultLazarusSrcDirectory: string;
|
||||||
function CheckFPCSourceDir(const ADirectory: string): boolean;
|
function CheckFPCSourceDir(const ADirectory: string): boolean;
|
||||||
function CheckLazarusDirectory(const ADirectory: string): boolean;
|
function CheckLazarusDirectory(const ADirectory: string): boolean;
|
||||||
|
|
||||||
@ -241,6 +242,17 @@ begin
|
|||||||
Result:='';
|
Result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function FindDefaultLazarusSrcDirectory: string;
|
||||||
|
var
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
for i:=Low(DefaultLazarusSrcDirs) to High(DefaultLazarusSrcDirs) do begin
|
||||||
|
Result:=DefaultLazarusSrcDirs[i];
|
||||||
|
if CheckLazarusDirectory(Result) then exit;
|
||||||
|
end;
|
||||||
|
Result:='';
|
||||||
|
end;
|
||||||
|
|
||||||
function CheckLazarusDirectory(const ADirectory: string): boolean;
|
function CheckLazarusDirectory(const ADirectory: string): boolean;
|
||||||
var
|
var
|
||||||
Dir: String;
|
Dir: String;
|
||||||
@ -251,6 +263,7 @@ begin
|
|||||||
Result:=DirPathExists(Dir+'lcl')
|
Result:=DirPathExists(Dir+'lcl')
|
||||||
and DirPathExists(Dir+'lcl'+PathDelim+'units')
|
and DirPathExists(Dir+'lcl'+PathDelim+'units')
|
||||||
and DirPathExists(Dir+'components')
|
and DirPathExists(Dir+'components')
|
||||||
|
and DirPathExists(Dir+'ideintf')
|
||||||
and DirPathExists(Dir+'designer')
|
and DirPathExists(Dir+'designer')
|
||||||
and DirPathExists(Dir+'debugger');
|
and DirPathExists(Dir+'debugger');
|
||||||
end;
|
end;
|
||||||
|
@ -786,12 +786,18 @@ end;
|
|||||||
function ProgramDirectory: string;
|
function ProgramDirectory: string;
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function ProgramDirectory: string;
|
function ProgramDirectory: string;
|
||||||
|
var
|
||||||
|
Flags: TSearchFileInPathFlags;
|
||||||
begin
|
begin
|
||||||
Result:=ParamStr(0);
|
Result:=ParamStr(0);
|
||||||
if ExtractFilePath(Result)='' then begin
|
if ExtractFilePath(Result)='' then begin
|
||||||
// program was started via PATH
|
// program was started via PATH
|
||||||
Result:=SearchFileInPath(Result,'',GetEnvironmentVariable('PATH'),':',
|
{$IFDEF windows}
|
||||||
[sffDontSearchInBasePath]);
|
Flags:=[];
|
||||||
|
{$ELSE}
|
||||||
|
Flags:=[sffDontSearchInBasePath];
|
||||||
|
{$ENDIF}
|
||||||
|
Result:=SearchFileInPath(Result,'',GetEnvironmentVariable('PATH'),':',Flags);
|
||||||
end;
|
end;
|
||||||
// resolve links
|
// resolve links
|
||||||
Result:=ReadAllLinks(Result,false);
|
Result:=ReadAllLinks(Result,false);
|
||||||
|
Loading…
Reference in New Issue
Block a user